Skip to content

fix: Add edition and rust-version to workspace.package template - #4048

Merged
jamie-osec merged 5 commits into
otter-sec:masterfrom
AvhiMaz:fix/workspace-package-edition-rust-version
Apr 16, 2026
Merged

fix: Add edition and rust-version to workspace.package template#4048
jamie-osec merged 5 commits into
otter-sec:masterfrom
AvhiMaz:fix/workspace-package-edition-rust-version

Conversation

@AvhiMaz

@AvhiMaz AvhiMaz commented Nov 8, 2025

Copy link
Copy Markdown
Contributor

Summary

Ensures proper dependency resolution by specifying edition and rust-version
in [workspace.package] instead of at program level, allowing dependency
resolution to respect these constraints and prevent incompatible crate
versions from being selected.

Changes

File: cli/src/rust_template.rs

Fixes #4047

@vercel

vercel Bot commented Nov 8, 2025

Copy link
Copy Markdown

@AvhiMaz is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@AvhiMaz

AvhiMaz commented Nov 8, 2025

Copy link
Copy Markdown
Contributor Author

hi @jamie-osec can you please review this? thank you

@swaroop-osec swaroop-osec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jamie-osec

Copy link
Copy Markdown
Collaborator

LGTM, though we'll need to ensure users have an up-to-date platform-tools somehow

@AvhiMaz

AvhiMaz commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

LGTM, though we'll need to ensure users have an up-to-date platform-tools somehow

pub fn get_solana_version() -> Option<String> {
    let output = std::process::Command::new("solana")
        .arg("--version")
        .output()
        .ok()?;

    if output.status.success() {
        let version_str = String::from_utf8(output.stdout).ok()?;
        version_str
            .split_whitespace()
            .last()
            .map(|v| v.trim().to_string())
    } else {
        None
    }
}

can we create a func like this and call it which automatically injects the detected version into Anchor.toml?

@jamie-osec

Copy link
Copy Markdown
Collaborator

We can evaluate this in another PR, this change LGTM for now 🙂

@AvhiMaz

AvhiMaz commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

We can evaluate this in another PR, this change LGTM for now 🙂

got it ser, If you create this issue, please assign it to me, I’d like to work on it.

@0x4ka5h 0x4ka5h left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jamie-osec

Copy link
Copy Markdown
Collaborator

Needs #4098

@jamie-osec

Copy link
Copy Markdown
Collaborator

@AvhiMaz Please git rebase master now that #4098 is merged and CI should pass

  Ensures proper dependency resolution by specifying edition and rust-version
  in [workspace.package] instead of at program level, allowing dependency
  resolution to respect these constraints and prevent incompatible crate
  versions from being selected.

  Fixes otter-sec#4047

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
@AvhiMaz
AvhiMaz force-pushed the fix/workspace-package-edition-rust-version branch from 39f28c1 to 2b438fa Compare November 28, 2025 11:29
@AvhiMaz

AvhiMaz commented Nov 28, 2025

Copy link
Copy Markdown
Contributor Author

@AvhiMaz Please git rebase master now that #4098 is merged and CI should pass

done!

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
@AvhiMaz

AvhiMaz commented Nov 29, 2025

Copy link
Copy Markdown
Contributor Author

@jamie-osec a test was failing. fixed it, lmk what you think about the fix made

Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
@jamie-osec
jamie-osec merged commit 1fa2b0a into otter-sec:master Apr 16, 2026
3 of 4 checks passed
@jamie-osec jamie-osec added this to the v1.1.0 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add edition/rust-version to Rust template workspace root

5 participants