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

gnutls: fix guile bindings #80206

Merged
merged 1 commit into from May 7, 2020
Merged

gnutls: fix guile bindings #80206

merged 1 commit into from May 7, 2020

Conversation

Thra11
Copy link
Member

@Thra11 Thra11 commented Feb 15, 2020

Motivation for this change

The gnutls derivation fails to build if the guileBindings argument is set to true: It attempts to install some of the guile bits in what it presumes to be the system-wide guile path, i.e. inside the guile output path.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

I confirmed that it builds, and that the gnutls module is then available in the guile repl.

@Thra11 Thra11 changed the title gnutls: Fix guile bindings gnutls: fix guile bindings Feb 15, 2020
@JohnAZoidberg
Copy link
Member

JohnAZoidberg commented Feb 15, 2020

I had (almost) exactly this patch sitting on my machine for a couple of months :D

] ++ lib.optional guileBindings [
"--enable-guile"
"--with-guile-site-dir=\${out}/share/guile/site"
"--with-guile-site-ccache-dir=\${out}/share/guile/site"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"--with-guile-site-ccache-dir=\${out}/share/guile/site"
"--with-guile-site-ccache-dir=\${out}/share/guile/site/site-ccache"

Copy link
Member Author

Choose a reason for hiding this comment

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

I originally had it as ${out}/lib/guile/2.2/site-ccache, based on the guile default on other systems being /usr/lib/guile/2.2/site-ccache. However, I changed it to ${out}/share/guile/site because

  1. That's what the only other package (guile-xcb) using this configure flag does.
  2. There's no mention of a directory named site-ccache in pkgs/development/interpreters/guile/setup-hook-2.2.sh

Copy link
Member Author

Choose a reason for hiding this comment

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

Does the fact your suggested site-ccache is a subdirectory of the site directory (which is added to the guile load paths), mean that it will work?

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Since we seem to put it in /share/guile everywhere, let's do that and not lib/guile.

If it works without the site-ccache suffix, that's fine.
It's just a little bit more neat, if it's got its own subdirectory.
That's what they do upstream, too: https://gitlab.com/gnutls/gnutls/commit/499a021b968033057944492ee3074f0898aa4dba#d5b4de16d947214ec306bd57bed1bd23a939b5f9_23_27
And in Guix's "nixpkgs": http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/tls.scm#n200

"--enable-guile"
"--with-guile-site-dir=\${out}/share/guile/site"
"--with-guile-site-ccache-dir=\${out}/share/guile/site"
"--with-guile-extension-dir=\${out}/share/guile/site"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"--with-guile-extension-dir=\${out}/share/guile/site"
"--with-guile-extension-dir=\${out}/share/guile/site/site-ccache"

Copy link
Contributor

Choose a reason for hiding this comment

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

If this works, please update @Thra11

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/guile-module-packaging-guidelines/5909/1

@bqv
Copy link
Contributor

bqv commented Apr 1, 2020

Hi, might this be merged?

@timokau timokau mentioned this pull request May 7, 2020
10 tasks
@timokau
Copy link
Member

timokau commented May 7, 2020

This seems to be a strict improvement over the status quo, as it only touches the broken part of gnutls. Merging for now since the author seems to be unavailable for now and the only outstanding request for changes is not terribly important. It would be nice to adopt @JohnAZoidberg's suggestion in a follow-up though if somebody wants do to that.

@timokau timokau merged commit bbb8132 into NixOS:master May 7, 2020
@timokau
Copy link
Member

timokau commented May 7, 2020

Thanks for fixing this @Thra11!

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

5 participants