File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -353,15 +353,20 @@ func (g *generalGraph) compileBaseImage() (llb.State, error) {
353
353
// 1. configured paths in the Starlark frontend `runtime.environ(extra_path=[...])`
354
354
// 2. paths in the base image
355
355
// 3. others added during the image building (Python paths, etc.)
356
- extraPaths := make (map [string ]bool )
357
- for _ , path := range strings .Split (kv [1 ], ":" ) {
358
- extraPaths [path ] = true
359
- }
356
+
357
+ // iterate over the original paths and add them to the map
358
+ pathMap := make (map [string ]bool )
360
359
for _ , path := range g .RuntimeEnvPaths {
361
- extraPaths [path ] = false
360
+ pathMap [path ] = true
362
361
}
363
- for path , required := range extraPaths {
364
- if required {
362
+ // split the PATH into different paths
363
+ newPaths := strings .Split (kv [1 ], ":" )
364
+ // iterate over the new paths
365
+ for _ , path := range newPaths {
366
+ // check if the path is already in the map
367
+ if _ , ok := pathMap [path ]; ! ok {
368
+ // if not, add the path to the map and slice
369
+ pathMap [path ] = true
365
370
g .RuntimeEnvPaths = append (g .RuntimeEnvPaths , path )
366
371
}
367
372
}
You can’t perform that action at this time.
0 commit comments