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

setenv shouldn't add /usr/bin to PATH #4099

Open
tothtamas28 opened this issue Mar 14, 2024 · 2 comments
Open

setenv shouldn't add /usr/bin to PATH #4099

tothtamas28 opened this issue Mar 14, 2024 · 2 comments

Comments

@tothtamas28
Copy link
Contributor

Related:

For example, on a Debian package installation, the script prepends /usr/lib/kframework/../../bin to PATH:

export PATH="$K_LIB_DIR/../../bin:$PATH"

As a consequence, the user cannot override a dependency in /usr/bin by updating the PATH, although that might be necessary in certain cases:

Instead of prepending /usr/bin to PATH, the script should prepend a directory that only contains K executables: #2974 (comment).

Also, to make replacing the java dependency easier, consider increasing the priority of JAVA_HOME:

_java="$JAVA_HOME/bin/java"

@tothtamas28 tothtamas28 changed the title setenv shouldn't add /usr/bin to PATH. setenv shouldn't add /usr/bin to PATH Mar 14, 2024
@Baltoli
Copy link
Collaborator

Baltoli commented Mar 15, 2024

Currently, the K packaging workflow installs executables by directly copying them into the target directory from where they're built by Maven:

cp -R k-distribution/target/release/k/bin/* $DESTDIR$PREFIX/bin

k/nix/k.nix

Line 59 in 67ef71b

cp -r k-distribution/target/release/k/bin/* $out/bin-unwrapped/

We can probably implement the fix suggested here by instead copying all the binaries to an isolated directory, and symlinking them into the output binary directory. Then, setenv can prepend the isolated directory instead of the global install location.

NB. I think this only actually applies to the non-Nix configuration as Nix takes care of paths for us via wrapper scripts.

@Baltoli
Copy link
Collaborator

Baltoli commented Mar 19, 2024

There may be a way to do this without PATH tinkering; all the binaries live near each other on disk so maybe they can know where their siblings are somehow.

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

2 participants