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

brew test CompilerSelectionError when using fails_with & build-only compiler dependency #11795

Closed
2 tasks done
cho-m opened this issue Jul 30, 2021 · 3 comments · Fixed by #13913
Closed
2 tasks done
Assignees
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age

Comments

@cho-m
Copy link
Member

cho-m commented Jul 30, 2021

brew config output

==> Running Setup#run!
==> brew install-bundler-gems
==> brew config
HOMEBREW_VERSION: 3.2.5-17-g689c1fd
ORIGIN: https://github.com/Homebrew/brew
HEAD: 689c1fdb6ec2637964a004727a4f407861809bbd
Last commit: 6 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: bdbfc4fcbcdef82b3d06c8ecb85c2464c61512bb
Core tap last commit: 6 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_BOOTSNAP: set
HOMEBREW_CASK_OPTS: []
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650
HOMEBREW_COLOR: set
HOMEBREW_DEVELOPER: set
HOMEBREW_FAIL_LOG_LINES: 150
HOMEBREW_FORCE_HOMEBREW_ON_LINUX: set
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_GIT_EMAIL: 1589480+BrewTestBot@users.noreply.github.com
HOMEBREW_GIT_NAME: BrewTestBot
HOMEBREW_MAKE_JOBS: 2
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set
HOMEBREW_NO_EMOJI: set
Homebrew Ruby: 2.6.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: dual-core 64-bit skylake
Clang: N/A
Git: 2.32.0 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 5.8.0-1039-azure x86_64 GNU/Linux
OS: Ubuntu 16.04.7 LTS (xenial)
Host glibc: 2.23
/usr/bin/gcc: 5.4.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@5: N/A
xorg: N/A

brew doctor output

==> brew doctor
All steps passed!

  • 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)?

Linux CI run on envoy Homebrew/homebrew-core#82077 with diff to disable default GCC for build (fails_with gcc: "5") and only enable working GCC in necessary section, i.e. build (depends_on "gcc@9" => :build).

EDIT: Issue is more for LLVM rather than GCC since GCC-dependency often carries newer runtime library dependency. Specific examples:

It would also be more accurate to test without extra brewed gcc/llvm dependency to make sure it truly isn't used by runtime.

What happened (include all command output)?

brew test fails during set up due to compiler selection error. The error message complains about being unable to "build" the formula, even though it should be testing an already built/installed formula.

See https://github.com/Homebrew/homebrew-core/runs/3190458966

==> FAILED
Error: test failed
==> Testing envoy
Error: envoy: failed
An exception occurred within a child process:
  CompilerSelectionError: envoy cannot be built with any available compilers.
Install Clang or run `brew install gcc`.

What did you expect to happen?

brew test should not fail on CompilerSelectionError. It should run in the test block as is, without requiring extra/unneeded compiler dependencies.

Some clarification/changes to fails_with is necessary so that there is a way to just disable GCC-5(Linux) or Apple Clang in build, but allow usage during test.

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

https://github.com/Homebrew/homebrew-core/runs/3190458966
@cho-m cho-m added the bug Reproducible Homebrew/brew bug label Jul 30, 2021
@MikeMcQuaid
Copy link
Member

Both of these don't need the compiler for runtime/test.

They don't need for runtime but they do for testing because that's how Homebrew works. This is something I'd review a PR for but I don't see as being a high priority given the workaround is so trivial on our side.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Aug 25, 2021
@cho-m cho-m added help wanted We want help addressing this in progress Maintainers are working on this and removed stale No recent activity labels Aug 25, 2021
@cho-m cho-m changed the title brew test CompilerSelectionError even if test doesn't need compiler brew test CompilerSelectionError when using fails_with & build-only compiler dependency Sep 5, 2021
@cho-m cho-m removed the in progress Maintainers are working on this label Sep 21, 2021
@carlocab
Copy link
Member

carlocab commented Oct 8, 2021

Related issue, with no workarounds that I know of: Homebrew/homebrew-core#86826 (comment) See @Bo98's comments for an explanation of why it's related.

@github-actions github-actions bot added the outdated PR was locked due to age label Feb 14, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2022
carlocab added a commit to carlocab/brew that referenced this issue Sep 21, 2022
The compiler used to a build a formula is typically not needed during
the test.

This will allow us to get rid of some `:test` dependencies, which were
added to prevent `brew` from throwing a `CompilerSelectionError` because
the formula declares `fails_with` the default compiler.

This also helps us get more accurate results from `brew linkage` in
cases of unintended linkage with the compiler used to build.

Fixes Homebrew#11795.
@carlocab carlocab reopened this Sep 21, 2022
@carlocab carlocab removed help wanted We want help addressing this outdated PR was locked due to age labels Sep 21, 2022
@carlocab carlocab self-assigned this Sep 21, 2022
@Homebrew Homebrew unlocked this conversation Sep 21, 2022
@github-actions github-actions bot added the outdated PR was locked due to age label Oct 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/brew bug outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants