Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeScript - $PATH inheritance issue #381

Open
oneingan opened this issue Jul 23, 2024 · 3 comments
Open

writeScript - $PATH inheritance issue #381

oneingan opened this issue Jul 23, 2024 · 3 comments

Comments

@oneingan
Copy link
Contributor

I recently discovered that the operable script in your library is not as pure as expected because it inherits the $PATH from the running system. While this is not problematic in a minimal container, I encountered an issue when conducting integration tests for the operable layer. Running the script standalone revealed this potential bug.

You can find the relevant code here:

export PATH="${l.makeBinPath runtimeInputs}:$PATH"

Do you consider this a bug that should be addressed to ensure the script's path purity?

@oneingan oneingan changed the title $PATH Inheritance Issue $PATH Inheritance Jul 23, 2024
@oneingan oneingan changed the title $PATH Inheritance Operable Script - $PATH Inheritance Jul 23, 2024
@oneingan oneingan changed the title Operable Script - $PATH Inheritance writeScript - $PATH inheritance issue Jul 23, 2024
@nrdxp
Copy link
Contributor

nrdxp commented Jul 23, 2024

@blaggacao was the original author here iirc. Do you perhaps remember why you did this? Was it intentional?

@whs-dot-hk
Copy link
Contributor

Hi, I think it is good, because the base image can be any docker e.g. alpine (the binary from base image can be use)

@blaggacao
Copy link
Collaborator

blaggacao commented Jul 29, 2024

We could consider this a bug on the grounds of your reasoning, yes.

I don't actually think that this had been a conscientious decision to inherit the environment's PATH.

Happy to merge a patch.

the binary from base image can be use

The operable was designed to be as close to a complete runtime just short of being an OCI image or having a special root mount, so that it can run in any environment / root mount.

So in terms of runtime dependencies, they should be brought with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants