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
binutils: make keg_only
#33419
binutils: make keg_only
#33419
Conversation
I also changed the |
Formula/binutils.rb
Outdated
@@ -32,6 +38,6 @@ def install | |||
end | |||
|
|||
test do | |||
assert_match "main", shell_output("#{bin}/gnm #{bin}/gnm") | |||
assert_match "__TEXT", shell_output("#{bin}/gstrings #{bin}/gstrings") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than an using an internal symbol like __TEXT
(which though unlikely could change) I'd suggest using some text from strings --help
such as the word Usage
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great idea!
Formula/binutils.rb
Outdated
@@ -12,6 +13,11 @@ class Binutils < Formula | |||
sha256 "7c693e68ebfcd654fd781480e68469e8f5af93c7397754a8caae1937322feb8f" => :el_capitan | |||
end | |||
|
|||
# See sourceware.org/bugzilla/show_bug.cgi?id=23728 and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# See sourceware.org/bugzilla/show_bug.cgi?id=23728 and | |
# See https://sourceware.org/bugzilla/show_bug.cgi?id=23728 and |
Formula/binutils.rb
Outdated
# https://github.com/Homebrew/homebrew-core/issues/32516 | ||
keg_only :provided_by_macos, | ||
"because Apple provides binutils and gnm is broken and breaks gcc" | ||
|
||
# No --default-names option as it interferes with Homebrew builds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove the comment, which is now irrelevant.
- The
--program-prefix=g
configure option should go too, since we don't put these tools in PATH anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fxcoudert Which comment? The # No --default-names ...
one? Also, should we add back --default-names
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to create a directory libexec/bin
of symlinks with the default names, that users can add to their path if they desire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I searched for explicit dependencies on binutils, and came up with 4 formula:
(I used brew uses --include-build --include-test --include-optional --recursive binutils
to search.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through the four formula above and none had any obvious adjustments that were required in the formula itself, however, virtually all of them require access to binutils binaries at runtime. Will the cause issues because the binutils
executables are not on the default PATH
anymore? Would formula revision bumps solve this, if it is indeed an issue?
8016b79
to
b325233
Compare
@Homebrew/core It looks like pwntools 3.12.0 is failing due to Gallopsled/pwntools#1191. I'm having trouble figuring out what is causing the build failure for pwntools to 3.12.1. There are a bunch of undefined symbols. Do we have to add missing (new) dependencies? I sort of pinged upstream in Gallopsled/pwntools#683. Should I just leave pwntools as is and merge binutils? |
@zbeekman We should avoid merging PRs we know will break other software in Homebrew/homebrew-core. |
@MikeMcQuaid I agree. I was (erroneously) under the impression that changes outside my binutils PR were responsible for breaking pwn tools. I tested building pwntools 3.12.0 and 3.12.1 locally, without the binutils changes and the do in fact build for me. Since pwntools 3.12.1 fixes a bug that the binutils keg_only migration seems to trigger before the build fails in different ways, I'll open a PR just for upgrading pwntools, while I investigate what needs to be done to get it working with migrated binutils. |
@zbeekman Sounds good, thanks 👍 |
8f6cec2
to
61130fb
Compare
Summary:
|
Formula/binutils.rb
Outdated
# See https://sourceware.org/bugzilla/show_bug.cgi?id=23728 and | ||
# https://github.com/Homebrew/homebrew-core/issues/32516 | ||
keg_only :provided_by_macos, | ||
"because Apple provides binutils and gnm is broken and breaks gcc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either we decide that keg-only is temporary, and the comment (and links) is adequate, or we decide that even when gnm is fixed we'd prefer binutils to stay keg-only (which I think is preferable). But then discussion about gnm bugs is irrelevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
decide that even when gnm is fixed we'd prefer binutils to stay keg-only (which I think is preferable)
👍 I'll remove comments.
`gnm` is broken with macOS 10.14 Mojave/XCode 10. This breaks gcc when binutils is linked. Fixes: Homebrew#32516 See also: https://sourceware.org/bugzilla/show_bug.cgi?id=23728
- Putting binutils on the path at build time breaks the build - The test passes without the binutils dependency
gnm
is broken with macOS 10.14 Mojave/XCode 10. This breaks gcc whenbinutils is linked.
Fixes: #32516
See also: https://sourceware.org/bugzilla/show_bug.cgi?id=23728
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?