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

clpm: init at 0.3.5 #108849

Merged
merged 3 commits into from Jan 11, 2021
Merged

clpm: init at 0.3.5 #108849

merged 3 commits into from Jan 11, 2021

Conversation

storvik
Copy link
Member

@storvik storvik commented Jan 9, 2021

Motivation for this change

Add common lisp package manager to nix, used it for a while now and everything seems to be working.

My first contribution here so feedback is much appreciated.

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.

@SuperSandro2000
Copy link
Member

@ofborg eval

Comment on lines 13 to 16
rev = "v${version}";
url = "https://gitlab.common-lisp.net/clpm/clpm";
sha256 = "0jivnnp3z148yf4c2nzzr5whz76w5kjhsb97z2vs5maiwf79y2if";
fetchSubmodules = true;
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
rev = "v${version}";
url = "https://gitlab.common-lisp.net/clpm/clpm";
sha256 = "0jivnnp3z148yf4c2nzzr5whz76w5kjhsb97z2vs5maiwf79y2if";
fetchSubmodules = true;
url = "https://gitlab.common-lisp.net/clpm/clpm";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "0jivnnp3z148yf4c2nzzr5whz76w5kjhsb97z2vs5maiwf79y2if";

Also I would prefer if we used fetchFromGitLab and not venodr 20 submodules.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the feedback @SuperSandro2000 ! How would you suggest avoid vendoring submodules? Is it possible to run git submodules init and git submodules update in the configurePhase? It seems that theres no fetchSubmodules in fetchFromGitlab.

Copy link
Member

Choose a reason for hiding this comment

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

There isn't? That should be added.

You don't have network access in the all the phases so that wont work.

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 can use fetchFromGitHub and then set githubBase = "gitlab.common-lisp.net", but don't know if that's any better than fethgit? It seems like fetchFromGitLab could be rewritten to be pretty similar to it's GitHub equivalent. I can look into rewriting fetchFromGitLab, need some projects to make me more comfortable with nix. Should we just use fetchgit for now?

Comment on lines 24 to 29
libssl = openssl.out;

buildPhase = ''
# Libs are copied working directory to avoid error when build script tries to deploy them
cp $libssl/lib/libcrypto.so.* .
cp $libssl/lib/libssl.so.* .
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
libssl = openssl.out;
buildPhase = ''
# Libs are copied working directory to avoid error when build script tries to deploy them
cp $libssl/lib/libcrypto.so.* .
cp $libssl/lib/libssl.so.* .
buildPhase = ''
# Libs are copied working directory to avoid error when build script tries to deploy them
ln -s $openssl/lib/libcrypto.so.* .
ln -s $openssl/lib/libssl.so.* .

I think that should work.

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 can confirm that it's working with symlink too. However I still have to set libssl = openssl.out as $openssl points to openssl-1.1.1i-bin/ and libraries are present in openssl-1.1.1i/. Openssl is a "multi output package" it seems. Is it ok to replace cp with ln but keep libssl?

Copy link
Member

Choose a reason for hiding this comment

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

ln -s ${openssl.out}/lib/libssl.so.* .

Does that work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh, of course. Thanks for this!

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108849 run on x86_64-darwin 1

1 package failed to build and are new build failure:

Avoid copying libraries to build dir, use symlink instead.
@storvik
Copy link
Member Author

storvik commented Jan 10, 2021

@SuperSandro2000 I have added a new commit which implements some of the improvements you mentioned above. Everything seems to be working now.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108849 run on x86_64-linux 1

1 package built:
  • clpm

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

3 participants