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

Add alternate path for tools that conflict with /bin tools + mechanism to add them to your PATH #766

Merged
merged 5 commits into from
Jun 24, 2024

Conversation

IgorTodorovskiIBM
Copy link
Collaborator

@IgorTodorovskiIBM IgorTodorovskiIBM commented May 23, 2024

We're making modifications to move tools conflicting with /bin tools like Gawk's awk to an altbin/ directory.

To add altbin to their PATH, users can set ZOPEN_TOOLSET_OVERRIDE=1 and then source zopen-config.

You can also do this:

. /home/itodoro/zopen/etc/zopen-config --override-zos-tools

Copy link
Collaborator

@DevonianTeuchter DevonianTeuchter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lbdyck
Copy link
Collaborator

lbdyck commented May 29, 2024

won't this lead to a violation of the principle of least astonishment with accompanying confusion?

@IgorTodorovskiIBM
Copy link
Collaborator Author

won't this lead to a violation of the principle of least astonishment with accompanying confusion?

I've added a caveat for tools that have an altbin.

We can invert the defaults if preferred, such that conflicting tools are added to your PATH unless you explicitly say you dont want that.

@lbdyck
Copy link
Collaborator

lbdyck commented May 29, 2024

If I install a tool then I expect to use it and have it available. This should be up to the individual site/installer to decide how to handle things and it needs to be obvious. :)

@IgorTodorovskiIBM
Copy link
Collaborator Author

If I install a tool then I expect to use it and have it available. This should be up to the individual site/installer to decide how to handle things and it needs to be obvious. :)

In the case of gawk, it will still be available as gawk, but not as awk. awk will be available under altbin/.

Brew has a similar caveat here: https://formulae.brew.sh/formula/gawk

GNU "awk" has been installed as "gawk".
If you need to use it as "awk", you can add a "gnubin" directory
to your PATH from your ~/.bashrc and/or ~/.zshrc like:
PATH="$HOMEBREW_PREFIX/opt/gawk/libexec/gnubin:$PATH"

@IgorTodorovskiIBM
Copy link
Collaborator Author

PRs for the conflicting tools is ready:
coreutils - https://github.com/ZOSOpenTools/coreutilsport/pull/72/files
Sed - zopencommunity/sedport#12
findutils - zopencommunity/findutilsport#20
diffutils - zopencommunity/diffutilsport#31
Grep - zopencommunity/grepport#17
Awk - https://github.com/ZOSOpenTools/gawkport/blob/main/buildenv
Make - https://github.com/ZOSOpenTools/makeport/pull/42/files
Openssh - zopencommunity/opensshport#11
gawk: https://github.com/ZOSOpenTools/gawkport/pull/21/files

There may be cases for more granularity in --override-zos-tools. If the need comes, we could extend it to accept a comma or space delimited list of tools to add. So for example, if the file system includes all of the tools, but a user wants to include altbin/make, they can specify --override-zos-tools=make

@IgorTodorovskiIBM IgorTodorovskiIBM merged commit 2947ec3 into main Jun 24, 2024
1 check passed
@IgorTodorovskiIBM IgorTodorovskiIBM deleted the altbin branch June 24, 2024 15:48
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

Successfully merging this pull request may close these issues.

4 participants