Skip to content

Commit

Permalink
Revert "Remove opt_level from DFX configuration"
Browse files Browse the repository at this point in the history
This reverts commit 0bec2a3.
  • Loading branch information
dansteren committed Sep 27, 2023
1 parent 44c16d7 commit 4ea2f00
Show file tree
Hide file tree
Showing 10 changed files with 331 additions and 280 deletions.
3 changes: 2 additions & 1 deletion examples/basic_bitcoin/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"declarations": {
"output": "test/dfx_generated/basic_bitcoin",
"node_compatibility": true
}
},
"opt_level": "1"
}
}
}
3 changes: 2 additions & 1 deletion examples/ledger_canister/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"output": "test/dfx_generated/ledger_canister",
"node_compatibility": true
},
"env": ["ICP_CANISTER_PRINCIPAL"]
"env": ["ICP_CANISTER_PRINCIPAL"],
"opt_level": "1"
},
"icp_ledger": {
"type": "custom",
Expand Down
3 changes: 2 additions & 1 deletion examples/plugins/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"declarations": {
"output": "test/dfx_generated/plugins",
"node_compatibility": true
}
},
"opt_level": "1"
}
}
}
5 changes: 5 additions & 0 deletions examples/primitive_ops/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
members = [
"canisters/rust",
]

[profile.release]
lto = true
opt-level = 'z'
codegen-units = 1
5 changes: 5 additions & 0 deletions examples/query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
members = [
"canisters/rust",
]

[profile.release]
lto = true
opt-level = 'z'
codegen-units = 1
1 change: 1 addition & 0 deletions examples/simple_user_accounts/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"ts": "src/index.ts",
"candid": "src/index.did",
"wasm": ".azle/simple_user_accounts/simple_user_accounts.wasm.gz",
"opt_level": "1",
"declarations": {
"output": "test/dfx_generated/simple_user_accounts",
"node_compatibility": true
Expand Down
5 changes: 5 additions & 0 deletions examples/update/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
members = [
"canisters/rust",
]

[profile.release]
lto = true
opt-level = 'z'
codegen-units = 1
3 changes: 2 additions & 1 deletion src/compiler/typescript_to_rust/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export async function compileTypeScriptToRust(
candidJavaScript: string;
};
const workspaceCargoToml: Toml = generateWorkspaceCargoToml(
canisterConfig.root
canisterConfig.root,
canisterConfig.opt_level ?? '0'
);
const workspaceCargoLock: Toml = generateWorkspaceCargoLock();

Expand Down
Loading

0 comments on commit 4ea2f00

Please sign in to comment.