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

Spurious linkage errors to GCC on Linux #17303

Closed
3 tasks done
carlocab opened this issue May 15, 2024 · 7 comments · Fixed by #17306
Closed
3 tasks done

Spurious linkage errors to GCC on Linux #17303

carlocab opened this issue May 15, 2024 · 7 comments · Fixed by #17306
Labels
bug Reproducible Homebrew/brew bug

Comments

@carlocab
Copy link
Member

brew doctor output

Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.3.0-18-gf4a9869
ORIGIN: https://github.com/Homebrew/brew
HEAD: f4a9869d27f5f3ece082e74da38a5a06a67a2637
Last commit: 3 hours ago
Core tap HEAD: c633ed746d07a54def764bdeaca1e224a2a9ad65
Core tap last commit: 4 minutes ago
Core tap JSON: 14 May 20:01 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_BOOTSNAP: set
HOMEBREW_CASK_OPTS: []
HOMEBREW_COLOR: set
HOMEBREW_CURL_PATH: /usr/bin/curl
HOMEBREW_DEVELOPER: set
HOMEBREW_FAIL_LOG_LINES: 150
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_GIT_EMAIL: 1589480+BrewTestBot@users.noreply.github.com
HOMEBREW_GIT_NAME: BrewTestBot
HOMEBREW_GIT_PATH: /usr/bin/git
HOMEBREW_LOGS: /__w/homebrew-core/homebrew-core/logs
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_COLOR: set
HOMEBREW_NO_EMOJI: set
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set
HOMEBREW_NO_INSTALL_FROM_API: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: quad-core 64-bit zen3
Clang: N/A
Git: 2.43.2 => /usr/bin/git
Curl: 7.81.0 => /usr/bin/curl
Kernel: Linux 6.5.0-1018-azure x86_64 GNU/Linux
OS: Ubuntu 22.04.4 LTS
Host glibc: 2.35
/usr/bin/gcc: 11.4.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A

What were you trying to do (and why)?

Run brew linkage --cached --test --strict on a formula with an indirect GCC dependency, because it's part of the tests run by test-bot.

What happened (include all command output)?

==> brew linkage --cached --test --strict sherlock
==> FAILED
Full linkage --cached --test --strict sherlock output
  Indirect dependencies with linkage:
    gcc

What did you expect to happen?

No errors or output.

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

# `sherlock` can be replaced with `sextractor` below if you don't want to wait for Homebrew/homebrew-core#171701
brew install sherlock
brew linkage --test --strict sherlock
@carlocab carlocab added the bug Reproducible Homebrew/brew bug label May 15, 2024
@carlocab
Copy link
Member Author

@p-linnane also mentioned something about an audit failure, but I don't see it in the CI log at Homebrew/homebrew-core#171701, so I'll let Patrick chime in on how to reproduce that.

@MikeMcQuaid
Copy link
Member

Thanks @carlocab for opening!

Either brew linkage shouldn't complain about this or it should be fixed.

@p-linnane
Copy link
Member

Repro: check out the PR, build and then:

==> brew linkage --cached sherlock
System libraries:
  /lib/x86_64-linux-gnu/libc.so.6
  /lib/x86_64-linux-gnu/libm.so.6
Homebrew libraries:
  /home/linuxbrew/.linuxbrew/opt/gcc/lib/gcc/current/libgcc_s.so.1 (gcc)
  /home/linuxbrew/.linuxbrew/opt/gcc/lib/gcc/current/libstdc++.so.6 (gcc)
Indirect dependencies with linkage:
  gcc
Dependencies with no linkage:
  certifi

@carlocab
Copy link
Member Author

I was referring to this audit failure, which I can't find in the log:

Full audit --formula sherlock --online --new output
  sherlock
    * Formulae in homebrew/core should not have a Linux-only dependency on GCC.
  Error: 1 problem in 1 formula detected.

@Bo98
Copy link
Member

Bo98 commented May 15, 2024

That audit is correct. "Fixing" the linkage error by adding a dependency would fail that audit. The bug is that we shouldn't be flagging indirect (or undeclared) GCC linkage in brew linkage because of how the rpaths are set up. Every formula depends on GCC (or rather near enough most that we call it every formula) and we have magic in brew that auto-installs GCC when the system GCC is too old.

@carlocab
Copy link
Member Author

Right, ok, so the audit failure appears if you add a Linux-only dependency on GCC, which explains why I couldn't find it in the log.

@carlocab
Copy link
Member Author

Should be fixed by #17306.

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

Successfully merging a pull request may close this issue.

4 participants