Skip to content

Commit dbfec67

Browse files
committed
feat: multipl env inheritance
1 parent 0c5f785 commit dbfec67

File tree

6 files changed

+252
-208
lines changed

6 files changed

+252
-208
lines changed

.ghjk/lock.json

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,7 @@
44
"moduleEntries": {
55
"ports": {
66
"version": "0",
7-
"configResolutions": {
8-
"bciqjlw6cxddajjmznoemlmnu7mgbbm7a3hfmnd2x5oivwajmiqui5ey": {
9-
"version": "v0.2.63",
10-
"buildDepConfigs": {},
11-
"portRef": "[email protected]",
12-
"specifiedVersion": false
13-
},
14-
"bciqao2s3r3r33ruox4qknfrxqrmemuccxn64dze2ylojrzp2bwvt4ji": {
15-
"version": "3.7.1",
16-
"buildDepConfigs": {
17-
"cpy_bs_ghrel": {
18-
"version": "3.12.3",
19-
"buildDepConfigs": {
20-
"tar_aa": {
21-
"version": "1.35",
22-
"buildDepConfigs": {},
23-
"portRef": "[email protected]",
24-
"specifiedVersion": false
25-
},
26-
"zstd_aa": {
27-
"version": "v1.5.5,",
28-
"buildDepConfigs": {},
29-
"portRef": "[email protected]",
30-
"specifiedVersion": false
31-
}
32-
},
33-
"portRef": "[email protected]",
34-
"specifiedVersion": false
35-
}
36-
},
37-
"portRef": "[email protected]",
38-
"packageName": "pre-commit",
39-
"specifiedVersion": false
40-
},
41-
"bciqij3g6mmbjn4a6ps4eipcy2fmw2zumgv5a3gbxycthroffihwquoi": {
42-
"version": "3.12.3",
43-
"buildDepConfigs": {
44-
"tar_aa": {
45-
"version": "1.35",
46-
"buildDepConfigs": {},
47-
"portRef": "[email protected]",
48-
"specifiedVersion": false
49-
},
50-
"zstd_aa": {
51-
"version": "v1.5.5,",
52-
"buildDepConfigs": {},
53-
"portRef": "[email protected]",
54-
"specifiedVersion": false
55-
}
56-
},
57-
"portRef": "[email protected]",
58-
"specifiedVersion": false
59-
},
60-
"bciqj4p5hoqweghbuvz52rupja7sqze34z63dd62nz632c5zxikv6ezy": {
61-
"version": "1.35",
62-
"buildDepConfigs": {},
63-
"portRef": "[email protected]",
64-
"specifiedVersion": false
65-
},
66-
"bciqe6fwheayositrdk7rkr2ngdr4wizldakex23tgivss7w6z7g3q3y": {
67-
"version": "v1.5.5,",
68-
"buildDepConfigs": {},
69-
"portRef": "[email protected]",
70-
"specifiedVersion": false
71-
}
72-
}
7+
"configResolutions": {}
738
},
749
"tasks": {
7510
"version": "0"

examples/kitchen/ghjk.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,18 @@ env("main")
3333
.var("RUST_LOG", "info,actix=warn")
3434
// provision programs to be avail in the env
3535
.install(ports.jq_ghrel())
36-
.allowedBuildDeps([
36+
.allowedBuildDeps(
3737
// ports can use the following installs at build time
3838
// very WIP mechanism but this is meant to prevent ports from
3939
// pulling whatever dependency they want at build time unless
4040
// explicityl allowed to do so
41-
ports.cpy_bs({ version: "3.8.18", releaseTag: "20240224" }),
4241
ports.node({}),
4342
ports.rust({ version: "stable" }),
4443
// add the std deps including the runtime ports.
4544
// These includes node and python but still, precedence is given
4645
// to our configuration of those ports above
4746
...stdDeps({ enableRuntimes: true }),
48-
]);
47+
);
4948

5049
// these top level installs go to the main env as well
5150
install(
@@ -97,9 +96,24 @@ task("build-app", {
9796
},
9897
});
9998

99+
env("python")
100+
// all envs will inherit from `defaultBaseEnv`
101+
// unles set to false which ensures true isolation
102+
.inherit(false)
103+
.install(
104+
ports.cpy_bs({ version: "3.8.18", releaseTag: "20240224" }),
105+
)
106+
.allowedBuildDeps(
107+
ports.cpy_bs({ version: "3.8.18", releaseTag: "20240224" }),
108+
);
109+
100110
env("dev")
101-
.inherit("main")
111+
// we can inherit from many envs
112+
// if conflict on variables or build deps, the one declared
113+
// later overrides
114+
.inherit(["main", "python"])
102115
// we can set tasks to run on activation/decativation
116+
// which are inheritable
103117
.onEnter(task(($) => $`echo enter`))
104118
.onEnter(task({
105119
workingDir: "..",

0 commit comments

Comments
 (0)