Skip to content

util-linux: fix build failure, add LDFLAGS="-lm" #204576

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

Closed
wants to merge 1 commit into from

Conversation

jacktose
Copy link

This fixes (on my machine) the build failure I reported in discussion #5421. It wasn't linking libm and now it does, with LDFLAGS="-LM", as suggested by @eviatarbach.

It built on the weird CentOS 7 machine where I encountered the error, and it built and tested fine on my normal WSL Ubuntu instance.


  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Install & test results
$ brew tests
Randomized with seed 11893
20 processes for 399 specs, ~ 19 specs per process
...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................*................................................................................................................................................................................................................................................................................................................................................................
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................................................................................................................................................................................................
................................................................................................................................................................................................................................................................................................................
..............
.......................
...............................................................
.........................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) UnpackStrategy::Zip when unzip is available #extract
     # Unzip is not installed.
     # ./test/unpack_strategy/shared_examples.rb:12

...................................................................................................................................................................
........................................................................
................................................................*.*........................................................................
..........................................
..........................

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) UnpackStrategy::Jar is correctly detected
     # Unzip is not installed.
     # ./test/unpack_strategy/shared_examples.rb:6

  2) UnpackStrategy::Jar #extract
     # Unzip is not installed.
     # ./test/unpack_strategy/shared_examples.rb:12

.................
..................................................................................................................
..
....
.......................
..................................................................................................
............................................................................



Took 18 seconds


$ brew uninstall --force util-linux

$ HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source util-linux
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Fetching util-linux
==> Downloading https://github.com/util-linux/util-linux/commit/9445f477cfcfb3615ffde8f93b1b98c809ee4eca.patch?full_index=1
########################################################################################################################################################################################################## 100.0%
==> Downloading https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/util-linux-2.40.4.tar.xz
########################################################################################################################################################################################################## 100.0%
==> Patching
==> Applying 9445f477cfcfb3615ffde8f93b1b98c809ee4eca.patch
==> ./configure --disable-silent-rules --disable-asciidoc --with-bashcompletiondir=/home/linuxbrew/.linuxbrew/Cellar/util-linux/2.40.4/etc/bash_completion.d --disable-use-tty-group --disable-kill --without-sys
==> make install
==> Caveats
Bash completion has been installed to:
  /home/linuxbrew/.linuxbrew/etc/bash_completion.d
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/util-linux/2.40.4: 443 files, 25.2MB, built in 25 seconds
==> Running `brew cleanup util-linux`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /home/jacktose/.cache/Homebrew/util-linux--patch--7a7fe4d32806e59f90ca0eb33a9b4eb306e59c9c148493cd6a57f0dea3eafc64.patch... (1.2KB)
==> Installation times
util-linux               25.014 s

$ brew test util-linux
==> Testing util-linux
==> /home/linuxbrew/.linuxbrew/Cellar/util-linux/2.40.4/bin/namei -lx /usr

$ brew audit --strict util-linux

$ brew style util-linux

1 file inspected, no offenses detected

@daeho-ro
Copy link
Member

From the discussion, the flag is actually not needed and so quite unsure about the changes. At least it is not required on macOS.

@jacktose
Copy link
Author

@daeho-ro It's certainly not required in most cases, or I wouldn't be first to report & patch it. There's a bottle for most systems. This only applies when building from source (of course) and only on systems with certain build infrastructure; I don't understand toolchains enough to explain more than the info in the discussion.
It definitely is required on the—admittedly edge-case—linux system from the discussion.

@jacktose
Copy link
Author

jacktose commented Feb 7, 2025

Anything I can do to help this along?

Bumping per the guide:

Post a comment on your pull request if you’ve provided all the requested changes/information and it hasn’t been merged after a week.

Copy link
Contributor

This pull request 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 Feb 28, 2025
@github-actions github-actions bot closed this Mar 7, 2025
@jacktose
Copy link
Author

Retrying in #214529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants