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

strongswan: fix Linux build #87998

Closed
wants to merge 4 commits into from
Closed

Conversation

carlocab
Copy link
Member

  • 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 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 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

These changes are based on feedback from upstream in
strongswan/strongswan#683.

@carlocab carlocab added CI-force-linux [DEPRECATED] Don't pass --skip-unbottled-linux to brew test-bot. CI-no-bottles Merge without publishing bottles labels Oct 25, 2021
@BrewTestBot BrewTestBot added the no Linux bottle Formula has no Linux bottle label Oct 25, 2021
@tobiasbrunner
Copy link
Contributor

The resolve plugin (--enable-resolve) could also be enabled on Linux, it installs DNS servers received from the server and serves a similar purpose as the osx-attr plugin does on macOS.

These changes are based on feedback from upstream in
strongswan/strongswan#683.
@carlocab
Copy link
Member Author

carlocab commented Oct 25, 2021

Hmm, the Linux build fails with

==> /home/linuxbrew/.linuxbrew/Cellar/strongswan/5.9.4/bin/charon-cmd --version
/home/linuxbrew/.linuxbrew/Cellar/strongswan/5.9.4/bin/charon-cmd: symbol lookup error: /home/linuxbrew/.linuxbrew/Cellar/strongswan/5.9.4/lib/ipsec/libstrongswan.so.0: undefined symbol: XXX

I wonder if we're missing dependencies on Linux.

@tobiasbrunner
Copy link
Contributor

It literally says the missing symbol is XXX?

@carlocab
Copy link
Member Author

carlocab commented Oct 26, 2021

Unfortunately, yes. Also, I misspoke. The build succeeded. What failed is trying to run charon-cmd --version. Very odd.

@tobiasbrunner
Copy link
Contributor

tobiasbrunner commented Oct 26, 2021

Is it possible to build with clang on Linux? The only reference to a similar issue I found is this, and the solution apparently was to build with clang. There is more here: NixOS/nixpkgs#5045 NixOS/patchelf#45

@carlocab
Copy link
Member Author

Yes, it is possible. Though, let's try using a newer GCC first (it pulls in a smaller dep tree). Thanks for the hint!

Building with host GCC leads to executables that don't work. The errors
they produce are very puzzling.
@carlocab
Copy link
Member Author

Oh wait, the Nix issues probably explain it. We do rely heavily on patchelf on Linux. Let's try building with one of a newer GCC or Clang first. If that doesn't work I'll ping one of our Linux maintainers to have a look.

@SMillerDev
Copy link
Member

@Homebrew/linux ideas?

@carlocab
Copy link
Member Author

Looks like patchelf breaks this.

@carlocab carlocab added linux Linux is specifically affected test failure CI fails while running the test-do block labels Oct 26, 2021
@dawidd6
Copy link
Member

dawidd6 commented Oct 26, 2021

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

Umm. Wut

@carlocab
Copy link
Member Author

Oh right, forgot about that bug. Look at the PR runs from the earlier commits.

@tobiasbrunner
Copy link
Contributor

Yeah, seems to be an issue with our choice of naming a global variable in libstrongswan lib (which is referenced in all binaries of strongSwan), an RPATH that ends with lib, the linker trying to optimize by letting the symbol point at the end of that path (which is also stored in .dynstr) instead of a separate string, and finally patchelf replacing the strings RPATH points to with X. Apparently, it does so without considering that a symbol could point to the replaced content.

@github-actions
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 Nov 17, 2021
@github-actions github-actions bot closed this Nov 24, 2021
@github-actions github-actions bot added the outdated PR was locked due to age label Dec 24, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 24, 2021
@carlocab carlocab deleted the strongswan branch September 17, 2022 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI-force-linux [DEPRECATED] Don't pass --skip-unbottled-linux to brew test-bot. CI-no-bottles Merge without publishing bottles linux Linux is specifically affected no Linux bottle Formula has no Linux bottle outdated PR was locked due to age stale No recent activity test failure CI fails while running the test-do block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants