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

Improve ergonomics of clwrapper #65342

Merged
merged 2 commits into from Jul 25, 2019
Merged

Improve ergonomics of clwrapper #65342

merged 2 commits into from Jul 25, 2019

Conversation

SquircleSpace
Copy link
Contributor

Motivation for this change

lispPackages.clwrapper is a useful package for creating nix derivations that support a variety of lisp compilers. Instead of running the compiler directly (and thus depending on a specific one), you use the common-lisp.sh script to actually invoke the compiler. Neat! Unfortunately, not all functionality is exposed conveniently. For example, if you want to get your compiler to load a file, you need to jump through some hoops. Right now, the easiest way to do that is to source cl-wrapper.sh and use the variables it sets.

Over in https://github.com/bradleyjensen/ql2nix, I to source cl-wrapper.sh during a buildPhase. Unfortunately, cl-wrapper.sh always returns a non-zero exit code when NIX_LISP_SKIP_CODE is the empty string. So, I had to hack around it by tossing a || true into my buildPhase. This PR corrects that.

This PR also makes clwrapper work with CCL. The common-lisp.sh script passes in the path to the ccl symlink rather than the path to the actual executable binary. That causes cl-wrapper.sh to fail to recognize the implementation.

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 nix-review --run "nix-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.

Brad Jensen added 2 commits July 24, 2019 09:35
The CCL package installs a symlink named "ccl" that points at the
actual implementation executable: lx86cl64 (or lx86cl for 32 bit).
When clwrapper is used with CCL as the backing implementation, this
script fails to recognize the implementation.  By resolving the
symlink, we are able to recognize which implementation we're actually
working with.
The only difference between these forms is the return value when
"$NIX_LISP_SKIP_CODE" is the empty string.  In the original
formulation, the script would return a false exit status.  In the new
formulation, it will return a true exit status.

Its useful to be able to source cl-wrapper.sh (to get the variables it
establishes), and its a bit annoying that sourcing it with
NIX_LISP_SKIP_CODE=1 results in a false exit status.
@7c6f434c 7c6f434c self-requested a review July 24, 2019 17:06
@7c6f434c
Copy link
Member

@GrahamcOfBorg build lispPackages.iolib

@7c6f434c 7c6f434c merged commit e1e5c87 into NixOS:master Jul 25, 2019
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

2 participants