@layerzerolabs/vm-tooling-stellar 1.2.10 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PFRVJTS7.js +79 -0
- package/dist/PFRVJTS7.js.map +1 -0
- package/dist/{AY7HGKNR.js → YKDO3PL4.js} +3 -3
- package/dist/{AY7HGKNR.js.map → YKDO3PL4.js.map} +1 -1
- package/dist/commands/sync-toolchain.d.ts.map +1 -1
- package/dist/commands/sync-toolchain.js +1 -1
- package/dist/config.js +2 -2
- package/dist/index.js +2 -2
- package/dist/scripts/generate-github-matrix.js +2 -2
- package/package.json +6 -6
- package/dist/P6KJGYNA.js +0 -62
- package/dist/P6KJGYNA.js.map +0 -1
package/dist/PFRVJTS7.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { __name } from './VUOMXK5T.js';
|
|
2
|
+
import { access, readFile } from 'fs/promises';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { parse } from 'toml';
|
|
5
|
+
import { executeToolCommand } from '@layerzerolabs/vm-tooling';
|
|
6
|
+
|
|
7
|
+
var syncedInstalls = /* @__PURE__ */ new Set();
|
|
8
|
+
var RUSTUP_TOOLCHAIN_ENV = "RUSTUP_TOOLCHAIN";
|
|
9
|
+
async function syncToolchain(context, options) {
|
|
10
|
+
const envVariable = options.env.find(({ name }) => name === RUSTUP_TOOLCHAIN_ENV);
|
|
11
|
+
const envToolchain = envVariable?.value.trim();
|
|
12
|
+
if (envVariable && !envToolchain) {
|
|
13
|
+
throw new Error(`${RUSTUP_TOOLCHAIN_ENV} must not be empty`);
|
|
14
|
+
}
|
|
15
|
+
if (envToolchain && !/^[A-Za-z0-9._-]+$/.test(envToolchain)) {
|
|
16
|
+
throw new Error(`${RUSTUP_TOOLCHAIN_ENV} is not a valid toolchain: ${envToolchain}`);
|
|
17
|
+
}
|
|
18
|
+
const filePath = path.join(options.cwd, "rust-toolchain.toml");
|
|
19
|
+
let installCmd;
|
|
20
|
+
if (envToolchain) {
|
|
21
|
+
installCmd = `rustup toolchain install ${envToolchain} --no-self-update`;
|
|
22
|
+
} else {
|
|
23
|
+
const hasToolchainFile = await access(filePath).then(() => true, () => false);
|
|
24
|
+
if (hasToolchainFile) {
|
|
25
|
+
const parsed = parse(await readFile(filePath, "utf-8"));
|
|
26
|
+
const channel = parsed.toolchain?.channel;
|
|
27
|
+
if (typeof channel !== "string") {
|
|
28
|
+
throw new Error(`Missing 'toolchain.channel' in ${filePath}`);
|
|
29
|
+
}
|
|
30
|
+
const targets = parsed.toolchain?.targets ?? [];
|
|
31
|
+
const components = parsed.toolchain?.components ?? [];
|
|
32
|
+
const installArgs = [
|
|
33
|
+
`rustup toolchain install ${channel} --no-self-update`
|
|
34
|
+
];
|
|
35
|
+
for (const target of targets) {
|
|
36
|
+
installArgs.push(`--target ${target}`);
|
|
37
|
+
}
|
|
38
|
+
for (const component of components) {
|
|
39
|
+
installArgs.push(`--component ${component}`);
|
|
40
|
+
}
|
|
41
|
+
installCmd = installArgs.join(" ");
|
|
42
|
+
} else {
|
|
43
|
+
installCmd = "rustup default stable";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const cacheKey = JSON.stringify([
|
|
47
|
+
options.cwd,
|
|
48
|
+
installCmd
|
|
49
|
+
]);
|
|
50
|
+
if (syncedInstalls.has(cacheKey)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const script = [
|
|
54
|
+
"mkdir -p $CARGO_HOME/bin",
|
|
55
|
+
"ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup",
|
|
56
|
+
installCmd
|
|
57
|
+
].join(" && ");
|
|
58
|
+
console.info(`\u{1F527} Syncing Rust toolchain: ${installCmd}`);
|
|
59
|
+
syncedInstalls.add(cacheKey);
|
|
60
|
+
await executeToolCommand(context, "stellar", [], {
|
|
61
|
+
...options,
|
|
62
|
+
script,
|
|
63
|
+
volumes: [
|
|
64
|
+
...options.volumes,
|
|
65
|
+
{
|
|
66
|
+
type: "isolate",
|
|
67
|
+
containerPath: "/cache/rustup",
|
|
68
|
+
name: "stellar-rustup",
|
|
69
|
+
shared: true,
|
|
70
|
+
locked: true
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
__name(syncToolchain, "syncToolchain");
|
|
76
|
+
|
|
77
|
+
export { syncToolchain };
|
|
78
|
+
//# sourceMappingURL=PFRVJTS7.js.map
|
|
79
|
+
//# sourceMappingURL=PFRVJTS7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/sync-toolchain.ts"],"names":["syncedInstalls","Set","RUSTUP_TOOLCHAIN_ENV","syncToolchain","context","options","envVariable","env","find","name","envToolchain","value","trim","Error","test","filePath","path","join","cwd","installCmd","hasToolchainFile","access","then","parsed","parse","readFile","channel","toolchain","targets","components","installArgs","target","push","component","cacheKey","JSON","stringify","has","script","console","info","add","executeToolCommand","volumes","type","containerPath","shared","locked"],"mappings":";;;;;;AAeA,IAAMA,cAAAA,uBAAqBC,GAAAA,EAAAA;AAC3B,IAAMC,oBAAAA,GAAuB,kBAAA;AAE7B,eAAsBC,aAAAA,CAClBC,SACAC,OAAAA,EAAoC;AAEpC,EAAA,MAAMC,WAAAA,GAAcD,QAAQE,GAAAA,CAAIC,IAAAA,CAAK,CAAC,EAAEC,IAAAA,EAAI,KAAOA,IAAAA,KAASP,oBAAAA,CAAAA;AAC5D,EAAA,MAAMQ,YAAAA,GAAeJ,WAAAA,EAAaK,KAAAA,CAAMC,IAAAA,EAAAA;AACxC,EAAA,IAAIN,WAAAA,IAAe,CAACI,YAAAA,EAAc;AAC9B,IAAA,MAAM,IAAIG,KAAAA,CAAM,CAAA,EAAGX,oBAAAA,CAAAA,kBAAAA,CAAwC,CAAA;AAC/D,EAAA;AAEA,EAAA,IAAIQ,YAAAA,IAAgB,CAAC,mBAAA,CAAoBI,IAAAA,CAAKJ,YA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nimport { parse } from 'toml';\n\nimport type { ChainContext, ToolCommandExecutionOptions } from '@layerzerolabs/vm-tooling';\nimport { executeToolCommand } from '@layerzerolabs/vm-tooling';\n\ninterface RustToolchainToml {\n toolchain?: {\n channel?: string;\n targets?: string[];\n components?: string[];\n };\n}\n\nconst syncedInstalls = new Set<string>();\nconst RUSTUP_TOOLCHAIN_ENV = 'RUSTUP_TOOLCHAIN';\n\nexport async function syncToolchain(\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n): Promise<void> {\n const envVariable = options.env.find(({ name }) => name === RUSTUP_TOOLCHAIN_ENV);\n const envToolchain = envVariable?.value.trim();\n if (envVariable && !envToolchain) {\n throw new Error(`${RUSTUP_TOOLCHAIN_ENV} must not be empty`);\n }\n\n if (envToolchain && !/^[A-Za-z0-9._-]+$/.test(envToolchain)) {\n throw new Error(`${RUSTUP_TOOLCHAIN_ENV} is not a valid toolchain: ${envToolchain}`);\n }\n\n const filePath = path.join(options.cwd, 'rust-toolchain.toml');\n\n let installCmd: string;\n if (envToolchain) {\n installCmd = `rustup toolchain install ${envToolchain} --no-self-update`;\n } else {\n const hasToolchainFile = await access(filePath).then(\n () => true,\n () => false,\n );\n\n if (hasToolchainFile) {\n const parsed: RustToolchainToml = parse(await readFile(filePath, 'utf-8'));\n\n const channel = parsed.toolchain?.channel;\n if (typeof channel !== 'string') {\n throw new Error(`Missing 'toolchain.channel' in ${filePath}`);\n }\n\n const targets: string[] = parsed.toolchain?.targets ?? [];\n const components: string[] = parsed.toolchain?.components ?? [];\n\n // --no-self-update: rustup's self-update downloads a new binary to\n // $CARGO_HOME/bin/rustup-init and chmod's it. Inside Docker the\n // download can fail, leaving no file for chmod → \"failed to set\n // permissions: No such file or directory\". The rustup version is\n // pinned by the Docker image so self-update is unnecessary.\n const installArgs = [`rustup toolchain install ${channel} --no-self-update`];\n for (const target of targets) {\n installArgs.push(`--target ${target}`);\n }\n for (const component of components) {\n installArgs.push(`--component ${component}`);\n }\n\n installCmd = installArgs.join(' ');\n } else {\n // No rust-toolchain.toml found — install stable as the default so that\n // cargo (a rustup proxy) can resolve a toolchain from the empty RUSTUP_HOME volume.\n installCmd = 'rustup default stable';\n }\n }\n\n // The resolved install command captures every toolchain input that affects the\n // installation. In particular, changes to channel, targets, or components in\n // rust-toolchain.toml produce a new key, while irrelevant formatting changes do not.\n const cacheKey = JSON.stringify([options.cwd, installCmd]);\n if (syncedInstalls.has(cacheKey)) {\n return;\n }\n\n // rustup expects to find itself at $CARGO_HOME/bin/rustup to manage proxy\n // binaries there. At runtime CARGO_HOME points to /cache/cargo (volume),\n // so we symlink the image-installed rustup binary into the volume.\n const script = [\n 'mkdir -p $CARGO_HOME/bin',\n 'ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup',\n installCmd,\n ].join(' && ');\n console.info(`🔧 Syncing Rust toolchain: ${installCmd}`);\n\n // Mark as synced before executeToolCommand to prevent recursive preExecute calls\n syncedInstalls.add(cacheKey);\n\n await executeToolCommand(context, 'stellar', [], {\n ...options,\n script,\n volumes: [\n ...options.volumes,\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n locked: true,\n },\n ],\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { syncToolchain } from './
|
|
1
|
+
import { syncToolchain } from './PFRVJTS7.js';
|
|
2
2
|
import { DockerRegistryMirror } from '@layerzerolabs/vm-tooling';
|
|
3
3
|
|
|
4
4
|
var tools = [
|
|
@@ -106,5 +106,5 @@ var versionCombinations = [
|
|
|
106
106
|
];
|
|
107
107
|
|
|
108
108
|
export { images, tools, versionCombinations };
|
|
109
|
-
//# sourceMappingURL=
|
|
110
|
-
//# sourceMappingURL=
|
|
109
|
+
//# sourceMappingURL=YKDO3PL4.js.map
|
|
110
|
+
//# sourceMappingURL=YKDO3PL4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":["tools","name","preExecute","syncToolchain","dockerPlatform","defaultVolumes","type","containerPath","shared","hostPath","defaultEnv","value","images","versions","stellar","patch","mirrorRegistries","DockerRegistryMirror","PUBLIC_GAR","dependencies","rust","versionCombinations","description","stable"],"mappings":";;;AASO,IAAMA,KAAAA,GAAoC;AAC7C,EAAA;IACIC,IAAAA,EAAM,SAAA;IACNC,UAAAA,EAAYC,aAAAA;IACZC,cAAAA,EAAgB,aAAA;IAChBC,cAAAA,EAAgB;;;AAGZ,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,gBAAA;QACfN,IAAAA,EAAM,gBAAA;QACNO,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,cAAA;QACfN,IAAAA,EAAM,eAAA;QACNO,MAAAA,EAAQ;AACZ,OAAA;;;AAGA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfN,IAAAA,EAAM,gBAAA;QACNO,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,MAAA;QACNC,aAAAA,EAAe,gBAAA;QACfE,QAAAA,EAAU;AACd;;IAEJC,UAAAA,EAAY;;AAER,MAAA;QAAET,IAAAA,EAAM,eAAA;QAAiBU,KAAAA,EAAO;AAAyB,OAAA;;AAEzD,MAAA;QAAEV,IAAAA,EAAM,8CAAA;QAAgDU,KAAAA,EAAO;AAAQ,OAAA;AACvE,MAAA;QAAEV,IAAAA,EAAM,+CAAA;QAAiDU,KAAAA,EAAO;AAAQ,OAAA;AACxE,MAAA;QACIV,IAAAA,EAAM,iDAAA;QACNU,KAAAA,EAAO;AACX,OAAA;AACA,MAAA;QACIV,IAAAA,EAAM,kDAAA;QACNU,KAAAA,EAAO;AACX;;AAER;;AAGG,IAAMC,MAAAA,GAAS;AAClB,EAAA,CAAC,gCAAA,GAAmC;IAChCX,IAAAA,EAAM,SAAA;IACNY,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO,CAAA;IACPC,gBAAAA,EAAkB;MAACC,oBAAAA,CAAqBC;;AAC5C,GAAA;AACA,EAAA,CAAC,gCAAA,GAAmC;IAChCjB,IAAAA,EAAM,SAAA;IACNY,QAAAA,EAAU;MACNC,OAAAA,EAAS;AACb,KAAA;IACAC,KAAAA,EAAO,CAAA;IACPI,YAAAA,EAAc;MACVC,IAAAA,EAAM;AACV,KAAA;IACAJ,gBAAAA,EAAkB;MAACC,oBAAAA,CAAqBC;;AAC5C;AACJ;AAIO,IAAMG,mBAAAA,GACT;AACI,EAAA;IACIT,MAAAA,EAAQ;MACJE,OAAAA,EAAS;AACb,KAAA;IACAQ,WAAAA,EAAa,uBAAA;IACbC,MAAAA,EAAQ;AACZ,GAAA;AACA,EAAA;IACIX,MAAAA,EAAQ;MACJE,OAAAA,EAAS;AACb,KAAA;IACAQ,WAAAA,EAAa,gBAAA;IACbC,MAAAA,EAAQ;AACZ","file":"
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":["tools","name","preExecute","syncToolchain","dockerPlatform","defaultVolumes","type","containerPath","shared","hostPath","defaultEnv","value","images","versions","stellar","patch","mirrorRegistries","DockerRegistryMirror","PUBLIC_GAR","dependencies","rust","versionCombinations","description","stable"],"mappings":";;;AASO,IAAMA,KAAAA,GAAoC;AAC7C,EAAA;IACIC,IAAAA,EAAM,SAAA;IACNC,UAAAA,EAAYC,aAAAA;IACZC,cAAAA,EAAgB,aAAA;IAChBC,cAAAA,EAAgB;;;AAGZ,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,gBAAA;QACfN,IAAAA,EAAM,gBAAA;QACNO,MAAAA,EAAQ;AACZ,OAAA;;AAEA,MAAA;QACIF,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,cAAA;QACfN,IAAAA,EAAM,eAAA;QACNO,MAAAA,EAAQ;AACZ,OAAA;;;AAGA,MAAA;QACIF,I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S;AACb,KAAA;IACAQ,WAAAA,EAAa,gBAAA;IACbC,MAAAA,EAAQ;AACZ","file":"YKDO3PL4.js","sourcesContent":["import {\n DockerRegistryMirror,\n type Image,\n type Tool,\n type VersionCombination,\n} from '@layerzerolabs/vm-tooling';\n\nimport { syncToolchain } from './commands/sync-toolchain';\n\nexport const tools: readonly [Tool, ...Tool[]] = [\n {\n name: 'stellar',\n preExecute: syncToolchain,\n dockerPlatform: 'linux/amd64',\n defaultVolumes: [\n // NOTE: for configuration commands, you should never put it in your package.json#build or #test, since the config is locked for parallel builds\n // while common commands like contract build and binding generation are allowed since they are not writing to the config files\n {\n type: 'isolate',\n containerPath: '/cache/stellar',\n name: 'stellar-config',\n shared: true,\n },\n // safe to be unlocked as it is POSIX lock guarded\n {\n type: 'isolate',\n containerPath: '/cache/cargo',\n name: 'stellar-cargo',\n shared: true,\n },\n // shared across packages — toolchain is pre-synced via `sync-toolchain` (locked)\n // so concurrent reads from build/test/lint are safe\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n },\n // safe as the wort case of corruption is cache miss, since it is key-based cache, concurrent writes will produce identical content\n {\n type: 'host',\n containerPath: '/cache/sccache',\n hostPath: '~/.sccache',\n },\n ],\n defaultEnv: [\n // sccache configuration\n { name: 'RUSTC_WRAPPER', value: '/usr/local/bin/sccache' },\n // mold linker for faster linking\n { name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n { name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER', value: 'clang' },\n {\n name: 'CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n {\n name: 'CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS',\n value: '-C link-arg=-fuse-ld=mold',\n },\n ],\n },\n];\n\nexport const images = {\n ['stellar:stellar-25.1.0-patch-2']: {\n name: 'stellar',\n versions: {\n stellar: '25.1.0',\n },\n patch: 2,\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n ['stellar:stellar-25.2.0-patch-1']: {\n name: 'stellar',\n versions: {\n stellar: '25.2.0',\n },\n patch: 1,\n dependencies: {\n rust: '1.91.0',\n },\n mirrorRegistries: [DockerRegistryMirror.PUBLIC_GAR],\n },\n} satisfies Record<string, Image>;\n\nexport type ImageId = keyof typeof images;\n\nexport const versionCombinations: [VersionCombination<ImageId>, ...VersionCombination<ImageId>[]] =\n [\n {\n images: {\n stellar: 'stellar:stellar-25.1.0-patch-2',\n },\n description: 'Latest stable release',\n stable: true,\n },\n {\n images: {\n stellar: 'stellar:stellar-25.2.0-patch-1',\n },\n description: 'Stellar 25.2.0',\n stable: true,\n },\n ];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-toolchain.d.ts","sourceRoot":"","sources":["../../src/commands/sync-toolchain.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-toolchain.d.ts","sourceRoot":"","sources":["../../src/commands/sync-toolchain.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAc3F,wBAAsB,aAAa,CAC/B,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CAyFf"}
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { images, tools, versionCombinations } from './
|
|
2
|
-
import './
|
|
1
|
+
export { images, tools, versionCombinations } from './YKDO3PL4.js';
|
|
2
|
+
import './PFRVJTS7.js';
|
|
3
3
|
import './VUOMXK5T.js';
|
|
4
4
|
//# sourceMappingURL=config.js.map
|
|
5
5
|
//# sourceMappingURL=config.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { packageSource } from './LCHYL2IQ.js';
|
|
2
2
|
import { runVerifiableBuildFromArchive, parsePackageSpec } from './D25LP26W.js';
|
|
3
|
-
import { versionCombinations, images, tools } from './
|
|
4
|
-
import { syncToolchain } from './
|
|
3
|
+
import { versionCombinations, images, tools } from './YKDO3PL4.js';
|
|
4
|
+
import { syncToolchain } from './PFRVJTS7.js';
|
|
5
5
|
import { __name } from './VUOMXK5T.js';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { runCli } from '@layerzerolabs/vm-tooling';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { images, versionCombinations } from '../
|
|
2
|
-
import '../
|
|
1
|
+
import { images, versionCombinations } from '../YKDO3PL4.js';
|
|
2
|
+
import '../PFRVJTS7.js';
|
|
3
3
|
import '../VUOMXK5T.js';
|
|
4
4
|
import { runGithubMatrixGenerator } from '@layerzerolabs/vm-tooling';
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"fflate": "^0.8.3",
|
|
23
23
|
"toml": "^3.0.0",
|
|
24
|
-
"@layerzerolabs/
|
|
25
|
-
"@layerzerolabs/
|
|
24
|
+
"@layerzerolabs/deterministic-zip": "1.2.12",
|
|
25
|
+
"@layerzerolabs/vm-tooling": "1.2.12"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"tsup": "^8.4.0",
|
|
29
29
|
"tsx": "^4.21.0",
|
|
30
30
|
"typescript": "^5.8.2",
|
|
31
31
|
"vitest": "^3.2.6",
|
|
32
|
-
"@layerzerolabs/tsup-configuration": "1.2.
|
|
33
|
-
"@layerzerolabs/
|
|
34
|
-
"@layerzerolabs/
|
|
32
|
+
"@layerzerolabs/tsup-configuration": "1.2.12",
|
|
33
|
+
"@layerzerolabs/typescript-configuration": "1.2.12",
|
|
34
|
+
"@layerzerolabs/vitest-configuration": "1.2.12"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"onesig-client"
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
|
-
"version": "1.2.
|
|
48
|
+
"version": "1.2.12",
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsup",
|
|
51
51
|
"generate-github-matrix": "tsx src/scripts/generate-github-matrix.ts",
|
package/dist/P6KJGYNA.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { __name } from './VUOMXK5T.js';
|
|
2
|
-
import { access, readFile } from 'fs/promises';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { parse } from 'toml';
|
|
5
|
-
import { executeToolCommand } from '@layerzerolabs/vm-tooling';
|
|
6
|
-
|
|
7
|
-
var syncedCwds = /* @__PURE__ */ new Set();
|
|
8
|
-
async function syncToolchain(context, options) {
|
|
9
|
-
if (syncedCwds.has(options.cwd)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const filePath = path.join(options.cwd, "rust-toolchain.toml");
|
|
13
|
-
let installCmd;
|
|
14
|
-
const hasToolchainFile = await access(filePath).then(() => true, () => false);
|
|
15
|
-
if (hasToolchainFile) {
|
|
16
|
-
const parsed = parse(await readFile(filePath, "utf-8"));
|
|
17
|
-
const channel = parsed.toolchain?.channel;
|
|
18
|
-
if (typeof channel !== "string") {
|
|
19
|
-
throw new Error(`Missing 'toolchain.channel' in ${filePath}`);
|
|
20
|
-
}
|
|
21
|
-
const targets = parsed.toolchain?.targets ?? [];
|
|
22
|
-
const components = parsed.toolchain?.components ?? [];
|
|
23
|
-
const installArgs = [
|
|
24
|
-
`rustup toolchain install ${channel} --no-self-update`
|
|
25
|
-
];
|
|
26
|
-
for (const target of targets) {
|
|
27
|
-
installArgs.push(`--target ${target}`);
|
|
28
|
-
}
|
|
29
|
-
for (const component of components) {
|
|
30
|
-
installArgs.push(`--component ${component}`);
|
|
31
|
-
}
|
|
32
|
-
installCmd = installArgs.join(" ");
|
|
33
|
-
} else {
|
|
34
|
-
installCmd = "rustup default stable";
|
|
35
|
-
}
|
|
36
|
-
const script = [
|
|
37
|
-
"mkdir -p $CARGO_HOME/bin",
|
|
38
|
-
"ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup",
|
|
39
|
-
installCmd
|
|
40
|
-
].join(" && ");
|
|
41
|
-
console.info(`\u{1F527} Syncing Rust toolchain: ${installCmd}`);
|
|
42
|
-
syncedCwds.add(options.cwd);
|
|
43
|
-
await executeToolCommand(context, "stellar", [], {
|
|
44
|
-
...options,
|
|
45
|
-
script,
|
|
46
|
-
volumes: [
|
|
47
|
-
...options.volumes,
|
|
48
|
-
{
|
|
49
|
-
type: "isolate",
|
|
50
|
-
containerPath: "/cache/rustup",
|
|
51
|
-
name: "stellar-rustup",
|
|
52
|
-
shared: true,
|
|
53
|
-
locked: true
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
__name(syncToolchain, "syncToolchain");
|
|
59
|
-
|
|
60
|
-
export { syncToolchain };
|
|
61
|
-
//# sourceMappingURL=P6KJGYNA.js.map
|
|
62
|
-
//# sourceMappingURL=P6KJGYNA.js.map
|
package/dist/P6KJGYNA.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/sync-toolchain.ts"],"names":["syncedCwds","Set","syncToolchain","context","options","has","cwd","filePath","path","join","installCmd","hasToolchainFile","access","then","parsed","parse","readFile","channel","toolchain","Error","targets","components","installArgs","target","push","component","script","console","info","add","executeToolCommand","volumes","type","containerPath","name","shared","locked"],"mappings":";;;;;;AAeA,IAAMA,UAAAA,uBAAiBC,GAAAA,EAAAA;AAEvB,eAAsBC,aAAAA,CAClBC,SACAC,OAAAA,EAAoC;AAEpC,EAAA,IAAIJ,UAAAA,CAAWK,GAAAA,CA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b,KAAK,GAAA,CAAA;EAClC,CAAA,MAAO;AAGHC,IAAAA,UAAAA,GAAa,uBAAA;AACjB,EAAA;AAKA,EAAA,MAAMgB,MAAAA,GAAS;AACX,IAAA,0BAAA;AACA,IAAA,2DAAA;AACAhB,IAAAA;AACFD,GAAAA,CAAAA,IAAAA,CAAK,MAAA,CAAA;AACPkB,EAAAA,OAAAA,CAAQC,IAAAA,CAAK,CAAA,kCAAA,EAA8BlB,UAAAA,CAAAA,CAAY,CAAA;AAGvDV,EAAAA,UAAAA,CAAW6B,GAAAA,CAAIzB,QAAQE,GAAG,CAAA;AAE1B,EAAA,MAAMwB,kBAAAA,CAAmB3B,OAAAA,EAAS,SAAA,EAAW,EAAA,EAAI;IAC7C,GAAGC,OAAAA;AACHsB,IAAAA,MAAAA;IACAK,OAAAA,EAAS;SACF3B,OAAAA,CAAQ2B,OAAAA;AACX,MAAA;QACIC,IAAAA,EAAM,SAAA;QACNC,aAAAA,EAAe,eAAA;QACfC,IAAAA,EAAM,gBAAA;QACNC,MAAAA,EAAQ,IAAA;QACRC,MAAAA,EAAQ;AACZ;;GAER,CAAA;AACJ;AA1EsBlC,MAAAA,CAAAA,aAAAA,EAAAA,eAAAA,CAAAA","file":"P6KJGYNA.js","sourcesContent":["import { access, readFile } from 'node:fs/promises';\nimport path from 'node:path';\nimport { parse } from 'toml';\n\nimport type { ChainContext, ToolCommandExecutionOptions } from '@layerzerolabs/vm-tooling';\nimport { executeToolCommand } from '@layerzerolabs/vm-tooling';\n\ninterface RustToolchainToml {\n toolchain?: {\n channel?: string;\n targets?: string[];\n components?: string[];\n };\n}\n\nconst syncedCwds = new Set<string>();\n\nexport async function syncToolchain(\n context: ChainContext<string>,\n options: ToolCommandExecutionOptions,\n): Promise<void> {\n if (syncedCwds.has(options.cwd)) {\n return;\n }\n\n const filePath = path.join(options.cwd, 'rust-toolchain.toml');\n\n let installCmd: string;\n const hasToolchainFile = await access(filePath).then(\n () => true,\n () => false,\n );\n\n if (hasToolchainFile) {\n const parsed: RustToolchainToml = parse(await readFile(filePath, 'utf-8'));\n\n const channel = parsed.toolchain?.channel;\n if (typeof channel !== 'string') {\n throw new Error(`Missing 'toolchain.channel' in ${filePath}`);\n }\n\n const targets: string[] = parsed.toolchain?.targets ?? [];\n const components: string[] = parsed.toolchain?.components ?? [];\n\n // --no-self-update: rustup's self-update downloads a new binary to\n // $CARGO_HOME/bin/rustup-init and chmod's it. Inside Docker the\n // download can fail, leaving no file for chmod → \"failed to set\n // permissions: No such file or directory\". The rustup version is\n // pinned by the Docker image so self-update is unnecessary.\n const installArgs = [`rustup toolchain install ${channel} --no-self-update`];\n for (const target of targets) {\n installArgs.push(`--target ${target}`);\n }\n for (const component of components) {\n installArgs.push(`--component ${component}`);\n }\n\n installCmd = installArgs.join(' ');\n } else {\n // No rust-toolchain.toml found — install stable as the default so that\n // cargo (a rustup proxy) can resolve a toolchain from the empty RUSTUP_HOME volume.\n installCmd = 'rustup default stable';\n }\n\n // rustup expects to find itself at $CARGO_HOME/bin/rustup to manage proxy\n // binaries there. At runtime CARGO_HOME points to /cache/cargo (volume),\n // so we symlink the image-installed rustup binary into the volume.\n const script = [\n 'mkdir -p $CARGO_HOME/bin',\n 'ln -sf /usr/local/cargo/bin/rustup $CARGO_HOME/bin/rustup',\n installCmd,\n ].join(' && ');\n console.info(`🔧 Syncing Rust toolchain: ${installCmd}`);\n\n // Mark as synced before executeToolCommand to prevent recursive preExecute calls\n syncedCwds.add(options.cwd);\n\n await executeToolCommand(context, 'stellar', [], {\n ...options,\n script,\n volumes: [\n ...options.volumes,\n {\n type: 'isolate',\n containerPath: '/cache/rustup',\n name: 'stellar-rustup',\n shared: true,\n locked: true,\n },\n ],\n });\n}\n"]}
|