Skip to content

Commit 3f833a5

Browse files
refactor: Remove unnecessary Xargo.toml and update dependencies in rust_template.rs (#3748)
This commit eliminates the deprecated Xargo.toml file reference and adds new dependencies for modern Solana builds, enhancing the project's compatibility and maintainability.
1 parent b5aced5 commit 3f833a5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cli/src/rust_template.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn create_program(name: &str, template: ProgramTemplate, with_mollusk: bool)
3737
program_path.join("Cargo.toml"),
3838
cargo_toml(name, with_mollusk),
3939
),
40-
(program_path.join("Xargo.toml"), xargo_toml().into()),
40+
// Note: Xargo.toml is no longer needed for modern Solana builds using SBF
4141
];
4242

4343
let template_files = match template {
@@ -204,11 +204,17 @@ no-entrypoint = []
204204
no-idl = []
205205
no-log-ix-name = []
206206
idl-build = ["anchor-lang/idl-build"]
207+
anchor-debug = []
208+
custom-heap = []
209+
custom-panic = []
207210
{2}
208211
209212
[dependencies]
210213
anchor-lang = "{3}"
211214
{4}
215+
216+
[lints.rust]
217+
unexpected_cfgs = {{ level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] }}
212218
"#,
213219
name,
214220
name.to_snake_case(),
@@ -218,12 +224,6 @@ anchor-lang = "{3}"
218224
)
219225
}
220226

221-
fn xargo_toml() -> &'static str {
222-
r#"[target.bpfel-unknown-unknown.dependencies.std]
223-
features = []
224-
"#
225-
}
226-
227227
/// Read the program keypair file or create a new one if it doesn't exist.
228228
pub fn get_or_create_program_id(name: &str) -> Pubkey {
229229
let keypair_path = Path::new("target")

0 commit comments

Comments
 (0)