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

gcc@12 overrides basic commands #111236

Closed
2 tasks done
mikhailkoliada opened this issue Sep 20, 2022 · 7 comments
Closed
2 tasks done

gcc@12 overrides basic commands #111236

mikhailkoliada opened this issue Sep 20, 2022 · 7 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@mikhailkoliada
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

HOMEBREW_CASK_OPTS: []
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650
HOMEBREW_MAKE_JOBS: 2
HOMEBREW_NO_AUTO_UPDATE: set
Homebrew Ruby: 2.6.8 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8_1/bin/ruby
CPU: dual-core 64-bit haswell
Clang: 11.0.0
Git: 2.37.3 => /bin/git
Curl: 7.68.0 => /bin/curl
Kernel: Linux 5.15.0-1019-azure x86_64 GNU/Linux
OS: Ubuntu 20.04.5 LTS (focal)
Host glibc: 2.31
/usr/bin/gcc: 9.4.0
/usr/bin/ruby: 2.7.0
glibc: 2.35_1
gcc@11: N/A
gcc@12: 12.2.0
xorg: N/A


brew doctor
Your system is ready to brew.

Verification

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

Our customer runs a code which invokes gfortran. It looks like brew-provided gfortran is not versioned, and as a result brew's provided command is used rather than the system-supplied one. More info can be found here: actions/runner-images#6274

What happened (include all command output)?

which -a gfortran

shows you brew gfortran

What did you expect to happen?

system gfortran is used, not the brew's one

Step-by-step reproduction instructions (by running brew commands)

brew install gcc@12

which -a gfortran
@mikhailkoliada mikhailkoliada added the bug Reproducible Homebrew/homebrew-core bug label Sep 20, 2022
@SMillerDev
Copy link
Member

That is the designed behavior, Homebrew on Linux shadows system binaries by design.

@dawidd6
Copy link
Contributor

dawidd6 commented Sep 20, 2022

Shouldn't versioned formulae be keg-only though? Here we have a case about gcc@12, so one could assume this is a versioned formula and should be keg-only, not shadowing anything.

@carlocab
Copy link
Member

gcc@12 is an alias for gcc.

You can just delete "$(brew --prefix)/bin/gfortran". This is already what you do on macOS. See https://github.com/actions/runner-images/blob/ab475d3ed707b236b0042140faab1a326c7dbe54/images/macos/provision/core/gcc.sh#L10-L14.

@mikhailkoliada
Copy link
Author

@carlocab oh!

Indeed, brew ls -v gcc@12 | grep "/bin/"

Shows that there is gfortran (symlink) and gfortran-12, could you please give me any hint why the symlink is needed here?

@SMillerDev
Copy link
Member

Because gcc == gcc@12, so you should be able to call the unversioned gfortran too.

@carlocab
Copy link
Member

@carlocab oh!

Indeed, brew ls -v gcc@12 | grep "/bin/"

Shows that there is gfortran (symlink) and gfortran-12, could you please give me any hint why the symlink is needed here?

Because many of our builds look for Fortran as gfortran. Removing the symlink would break them.

@mikhailkoliada
Copy link
Author

@carlocab thanks for the hint and sorry for the noise!

We have removed the gfortran's symlink from the images by now.

@github-actions github-actions bot added the outdated PR was locked due to age label Oct 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

4 participants