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

cyrus-sasl: Remove private libs from .la files (fixes spice build) #51651

Merged
merged 3 commits into from Dec 8, 2018

Conversation

hedning
Copy link
Contributor

@hedning hedning commented Dec 7, 2018

Motivation for this change

Version 2.1.27 added the private libs to a bunch of .la files, which in turn
broke spice's build, #51444 (comment)

A cleaner approach would be to just remove the .la files, but I'm unsure if
that will break anything else.

cc #51444

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@hedning
Copy link
Contributor Author

hedning commented Dec 7, 2018

@GrahamcOfBorg build spice

@hedning
Copy link
Contributor Author

hedning commented Dec 7, 2018

@GrahamcOfBorg build cyrus_sasl

@@ -44,6 +39,7 @@ stdenv.mkDerivation rec {
postInstall = ''
for f in $out/lib/*.la $out/lib/sasl2/*.la; do
substituteInPlace $f --replace "${openssl.dev}/lib" "${openssl.out}/lib"
sed -i $f -e 's,-lresolv\|-lgssapi_krb5\|-lkrb5\|-lk5crypto\|-lcom_err,,g'
Copy link
Member

Choose a reason for hiding this comment

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

Why do you remove libresolv?

Copy link
Member

Choose a reason for hiding this comment

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

And what is libcom_err?

Copy link
Contributor Author

@hedning hedning Dec 7, 2018

Choose a reason for hiding this comment

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

Took it form the libsasl2.pc, where they're all listed as private libraries. Might be wrong though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're all added to the .la files, without the necessary -L flags.

Copy link
Member

@Mic92 Mic92 Dec 7, 2018

Choose a reason for hiding this comment

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

It comes from here:

https://github.com/cyrusimap/cyrus-sasl/blob/master/m4/sasl2.m4#L121

I would say there are two options: Either put kerberos in propagatedBuildInputs or disable kerberos for cyrus-sasl (maybe enabling via flags would work too).

Copy link
Member

Choose a reason for hiding this comment

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

I am surprised though that you can just drop the libraries without having any missing symbols during linking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with either alternative, though I'm not using this derivation myself, so cc @eburimu who did the upgrade to 2.1.27.

I guess downgrading is also an option, the release is very fresh while the previous release is many years old.

Copy link
Member

Choose a reason for hiding this comment

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

Just wanted to mention that the commit that added pruneLibtoolFiles setup hook has some very useful notes on how to handle .la files - fd97db4

Copy link
Member

@Mic92 Mic92 Dec 8, 2018

Choose a reason for hiding this comment

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

Ok. So adding pruneLibtoolFiles should be safe in our case. The derivation only contains shared libraries.

hedning and others added 2 commits December 8, 2018 17:52
Version 2.1.27 adds `-lkrb5` etc. to `dependency_libs` in all the .la files,
which in turn breaks spice's build. Prune .la's dependency_libs with
pruneLibtoolFiles.
@hedning
Copy link
Contributor Author

hedning commented Dec 8, 2018

Switched to pruneLibtoolFiles. Opted to keep the existing openssl modifications in postInstall, though it's most likely unnecessary.

since pruneLibtoolFiles is used openssl is no longer referenced
@Mic92
Copy link
Member

Mic92 commented Dec 8, 2018

It is unnecessary, I checked it.

@Mic92 Mic92 merged commit 7d216be into NixOS:staging-next Dec 8, 2018
Mic92 added a commit that referenced this pull request Dec 9, 2018
cyrus_sasl: merge PR #51651 into master
@hedning hedning deleted the fix-spice branch October 15, 2019 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants