Skip to content

Commit 450ab48

Browse files
CoveMBericglau
andauthored
[Stellar] Rust environment download add release profile (#678)
Co-authored-by: Eric Lau <[email protected]>
1 parent 0a90806 commit 450ab48

File tree

4 files changed

+29
-17
lines changed

4 files changed

+29
-17
lines changed

packages/core/stellar/src/zip-rust.compile.test.ts.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,20 @@ Generated by [AVA](https://avajs.dev).
110110
stellar-contract-utils = "=0.4.1"␊
111111
stellar-macros = "=0.4.1"␊
112112
113+
114+
[profile.release]␊
115+
opt-level = "z"␊
116+
overflow-checks = true␊
117+
debug = 0␊
118+
strip = "symbols"␊
119+
debug-assertions = false␊
120+
panic = "abort"␊
121+
codegen-units = 1␊
122+
lto = true␊
123+
124+
[profile.release-with-logs]␊
125+
inherits = "release"␊
126+
debug-assertions = true␊
113127
`,
114128
`# Sample Rust Contract Environment␊
115129
106 Bytes
Binary file not shown.

packages/core/stellar/src/zip-rust.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,12 @@ import type { GenericOptions } from './build-generic';
33
import type { Contract } from './contract';
44
import { printContract, removeCreateLevelAttributes } from './print';
55
import {
6-
addDependenciesWith,
7-
libDependencies,
86
contractOptionsToContractName,
97
createRustLibFile,
108
printContractCargo,
119
printRustNameTest,
10+
workspaceCargo,
1211
} from './zip-shared';
13-
import { contractsVersion, compatibleSorobanVersion } from './utils/version';
14-
15-
const workspaceCargo = `[workspace]
16-
resolver = "2"
17-
members = ["contracts/*"]
18-
19-
[workspace.package]
20-
authors = []
21-
edition = "2021"
22-
license = "Apache-2.0"
23-
version = "0.0.1"
24-
25-
[workspace.dependencies]
26-
${addDependenciesWith(`"${compatibleSorobanVersion}"`, ['soroban-sdk'])}${addDependenciesWith(`"=${contractsVersion}"`, [...libDependencies])}
27-
`;
2812

2913
const readme = `\
3014
# Sample Rust Contract Environment

packages/core/stellar/src/zip-shared.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,18 @@ version = "0.0.1"
8989
9090
[workspace.dependencies]
9191
${addDependenciesWith(`"${compatibleSorobanVersion}"`, ['soroban-sdk'])}${addDependenciesWith(`"=${contractsVersion}"`, [...libDependencies])}
92+
93+
[profile.release]
94+
opt-level = "z"
95+
overflow-checks = true
96+
debug = 0
97+
strip = "symbols"
98+
debug-assertions = false
99+
panic = "abort"
100+
codegen-units = 1
101+
lto = true
102+
103+
[profile.release-with-logs]
104+
inherits = "release"
105+
debug-assertions = true
92106
`;

0 commit comments

Comments
 (0)