ZOSOpenTools / meta

Meta repository to tie together the various underlying z/OS Open Source tools repositories here
https://zosopentools.github.io/meta/
Apache License 2.0
37 stars 25 forks source link

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

Closed IgorTodorovskiIBM closed 1 week ago

IgorTodorovskiIBM commented 1 month ago

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
lbdyck commented 1 month ago

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

IgorTodorovskiIBM commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 week ago

PRs for the conflicting tools is ready: coreutils - https://github.com/ZOSOpenTools/coreutilsport/pull/72/files Sed - https://github.com/ZOSOpenTools/sedport/pull/12 findutils - https://github.com/ZOSOpenTools/findutilsport/pull/20 diffutils - https://github.com/ZOSOpenTools/diffutilsport/pull/31 Grep - https://github.com/ZOSOpenTools/grepport/pull/17 Awk - https://github.com/ZOSOpenTools/gawkport/blob/main/buildenv Make - https://github.com/ZOSOpenTools/makeport/pull/42/files Openssh - https://github.com/ZOSOpenTools/opensshport/pull/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