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

Fix grep build breakage #571

Closed

Conversation

jidicula
Copy link
Contributor

@jidicula jidicula commented May 3, 2023

Replaced by #573 and #574

jidicula and others added 3 commits May 2, 2023 22:10
For consistency with LIBRARY_PATH and CPATH appending, we should also append to
LDFLAGS at build-time, to ensure that the same version of gcc and its libs are
used throughout the build.
I found that on my system, I had a different incompatible version of grep from a
plan9 installation on my PATH that was superseding the builtin grep on one of my
Macs. This explains why the `with-native-comp` build was failing on one of my
Macs but not the other - the Mac with the successful emacs-plus@28
`with-native-comp` build only had the built-in version of grep on its PATH.

Adding GNU grep as a build-time dependency will include it in the `gnubin`
directory, which is prepended to the PATH in each formula. I've also added an
explicit PATH prepending step for each of the GNU build-time dependencies. This
indicates the coupling of those dependencies with the `gnubin` PATH prepending.

Related to d12frosted#555 and d12frosted#556
@@ -36,6 +36,7 @@ class EmacsPlusAT28 < EmacsBase
depends_on "autoconf" => :build
depends_on "gnu-sed" => :build
depends_on "gnu-tar" => :build
depends_on "grep" => :build
Copy link
Contributor Author

@jidicula jidicula May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@d12frosted I wonder if it may be worth explicitly adding all the autoconf GNU dependencies (perhaps in a future PR?) to cover this scenario better, where users may have different incompatible versions of these tools in their PATH before usr/bin/.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think yes. Ideally I would love to find a way to use homebrew superenv (e.g. default environment) which has everything properly configured. But path injection requires custom environment and hence all these issues 😢

@jidicula jidicula marked this pull request as draft May 3, 2023 13:07
@@ -36,6 +36,7 @@ class EmacsPlusAT28 < EmacsBase
depends_on "autoconf" => :build
depends_on "gnu-sed" => :build
depends_on "gnu-tar" => :build
depends_on "grep" => :build
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think yes. Ideally I would love to find a way to use homebrew superenv (e.g. default environment) which has everything properly configured. But path injection requires custom environment and hence all these issues 😢

@@ -156,6 +158,8 @@ def install
args << "--with-xwidgets" if build.with? "xwidgets"

ENV.prepend_path "PATH", Formula["gnu-sed"].opt_libexec/"gnubin"
ENV.prepend_path "PATH", Formula["gnu-tar"].opt_libexec/"gnubin"
ENV.prepend_path "PATH", Formula["grep"].opt_libexec/"gnubin"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment from #573 regarding this line.

@jidicula jidicula closed this May 3, 2023
@jidicula jidicula deleted the jidicula/fix-grep-build-breakage branch May 3, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants