Skip to content

Commit

Permalink
fix: Add environment variable PATH in run (#680)
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege committed Jul 28, 2022
1 parent cb8ed6b commit 6cbc53f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/lang/frontend/starlark/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func ruleFuncConda(thread *starlark.Thread, _ *starlark.Builtin,
var envFile starlark.String

if err := starlark.UnpackArgs(ruleConda,
args, kwargs, "name?", &name, "channel?", &channel, "envFile?", &envFile); err != nil {
args, kwargs, "name?", &name, "channel?", &channel, "env_file?", &envFile); err != nil {
return nil, err
}

Expand All @@ -216,7 +216,7 @@ func ruleFuncConda(thread *starlark.Thread, _ *starlark.Builtin,
path = &buf
}

logger.Debugf("rule `%s` is invoked, name=%v, channel=%v,envFile=%s", ruleConda, nameList, channelList, envFileStr)
logger.Debugf("rule `%s` is invoked, name=%v, channel=%v, env_file=%s", ruleConda, nameList, channelList, envFileStr)
if err := ir.CondaPackage(nameList, channelList, path); err != nil {
return starlark.None, err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/lang/ir/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func (g Graph) compileRun(root llb.State) llb.State {
if len(g.Exec) == 0 {
return root
}
root = root.AddEnv("PATH", "$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/conda/bin:/usr/local/julia/bin:/opt/conda/envs/envd/bin")
if len(g.Exec) == 1 {
return root.Run(llb.Shlex(g.Exec[0])).Root()
}
Expand Down

0 comments on commit 6cbc53f

Please sign in to comment.