Skip to content

Commit 730f91e

Browse files
authored
refactor: unify wrapper (#200)
1 parent fb24518 commit 730f91e

71 files changed

Lines changed: 3928 additions & 3586 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/std/Cargo.lock

Lines changed: 31 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/std/Cargo.toml

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[workspace]
22
members = [
3-
"packages/manifest_tool",
3+
"packages/common",
44
"packages/tgcc",
55
"packages/tgld",
66
"packages/tgstrip",
7-
"packages/wrapper",
7+
"packages/wrap",
88
]
99
resolver = "3"
1010

@@ -56,54 +56,15 @@ tracing = "0.1"
5656
tracing-subscriber = { version = "0.3", features = ["json", "parking_lot"] }
5757
zerocopy = { version = "0.8", features = ["derive"] }
5858

59-
tangram_std = { path = "." }
60-
manifest_tool = { path = "packages/manifest_tool" }
59+
60+
common = { path = "packages/common" }
61+
wrap = { path = "packages/wrap" }
6162
tgcc = { path = "packages/tgcc" }
6263
tgld = { path = "packages/tgld" }
6364
tgstrip = { path = "packages/tgstrip" }
64-
wrapper = { path = "packages/wrapper" }
6565

6666
[profile.release]
6767
codegen-units = 1
6868
lto = true
6969
panic = "abort"
7070
strip = true
71-
72-
[package]
73-
name = "tangram_std"
74-
75-
description = { workspace = true }
76-
edition = { workspace = true }
77-
homepage = { workspace = true }
78-
license = { workspace = true }
79-
publish = { workspace = true }
80-
repository = { workspace = true }
81-
rust-version = { workspace = true }
82-
version = { workspace = true }
83-
84-
[lib]
85-
path = "packages/std/lib.rs"
86-
87-
[lints]
88-
workspace = true
89-
90-
[dependencies]
91-
anstream = { workspace = true }
92-
manifest_tool = { workspace = true }
93-
bytes = { workspace = true }
94-
clap = { workspace = true }
95-
crossterm = { workspace = true }
96-
futures = { workspace = true }
97-
serde = { workspace = true }
98-
serde_json = { workspace = true }
99-
tangram_client = { workspace = true }
100-
tangram_either = { workspace = true }
101-
tangram_serialize = { workspace = true }
102-
tokio = { workspace = true }
103-
tempfile = { workspace = true }
104-
tracing = { workspace = true, optional = true }
105-
tracing-subscriber = { workspace = true, optional = true }
106-
107-
[features]
108-
tracing = ["dep:tracing", "dep:tracing-subscriber"]
109-
default = ["tracing"]

packages/std/autotools.tg.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,18 @@ export async function build(...args: std.Args<Arg>): Promise<tg.Directory> {
240240
const os = std.triple.os(host);
241241
const runtimeLibEnvVar =
242242
os === "darwin" ? "DYLD_FALLBACK_LIBRARY_PATH" : "LD_LIBRARY_PATH";
243-
defaultPrepareCommand = tg`${defaultPrepareCommand}\nexport ${runtimeLibEnvVar}=$LIBRARY_PATH`;
243+
defaultPrepareCommand = tg`
244+
${defaultPrepareCommand}
245+
export ${runtimeLibEnvVar}=$LIBRARY_PATH
246+
`;
244247
}
245248
if (defaultCrossEnv && isCross) {
246249
// Toolchain prefix is the canonical host triple (where output runs).
247250
const canonicalHost = std.sdkModule.sdk.canonicalTriple(host);
248251
const hostPrefix = `${canonicalHost}-`;
249-
defaultPrepareCommand = tg`${defaultPrepareCommand}\nexport CC=${hostPrefix}cc && export CXX=${hostPrefix}c++ && export AR=${hostPrefix}ar`;
252+
defaultPrepareCommand = tg`
253+
${defaultPrepareCommand}
254+
export CC=${hostPrefix}cc && export CXX=${hostPrefix}c++ && export AR=${hostPrefix}ar`;
250255
}
251256
const needsPrepare = buildInTree || setRuntimeLibraryPath || defaultCrossEnv;
252257

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[package]
2-
name = "wrapper"
31

2+
[package]
3+
name = "common"
44
description = { workspace = true }
55
edition = { workspace = true }
66
homepage = { workspace = true }
@@ -14,14 +14,22 @@ version = { workspace = true }
1414
workspace = true
1515

1616
[dependencies]
17-
libc = { workspace = true }
18-
fnv = { workspace = true }
17+
anstream = { workspace = true }
18+
bytes = { workspace = true }
19+
clap = { workspace = true }
20+
crossterm = { workspace = true }
21+
futures = { workspace = true }
1922
serde = { workspace = true }
2023
serde_json = { workspace = true }
2124
tangram_client = { workspace = true }
22-
tangram_std = { workspace = true }
25+
tangram_either = { workspace = true }
26+
tangram_serialize = { workspace = true }
27+
tempfile = { workspace = true }
28+
tokio = { workspace = true }
2329
tracing = { workspace = true, optional = true }
2430
tracing-subscriber = { workspace = true, optional = true }
31+
wrap = { workspace = true }
2532

2633
[features]
2734
tracing = ["dep:tracing", "dep:tracing-subscriber"]
35+
default = ["tracing"]

0 commit comments

Comments
 (0)