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
lua: allow static build #75901
lua: allow static build #75901
Conversation
Can someone help me avoid mass rebuild? |
@malbarbo I don't think you can avoid it, you should just target |
The problem is that with
It is not necessary to add Try this diff as solution, putting it into diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index 72c2a794ef0..f7967a156ca 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -42,7 +42,7 @@ in rec {
sourceVersion = { major = "5"; minor = "2"; patch = "4"; };
hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr";
}).overrideAttrs (oldAttrs: rec {
- patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else if oldAttrs.enableShared then [ dsoPatch52 ] else [ ];
+ patches = if stdenv.isDarwin then [ ./5.2.darwin.patch ] else if oldAttrs.passthru.enableShared then [ dsoPatch52 ] else [ ];
});
lua5_2_compat = lua5_2.override({
diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix
index f378c3d5eac..f9dd818f8cc 100644
--- a/pkgs/development/interpreters/lua-5/interpreter.nix
+++ b/pkgs/development/interpreters/lua-5/interpreter.nix
@@ -28,7 +28,6 @@ self = stdenv.mkDerivation rec {
buildInputs = [ readline ];
- inherit enableShared;
inherit patches;
# see configurePhase for additional flags (with space)
@@ -103,6 +102,7 @@ self = stdenv.mkDerivation rec {
withPackages = import ./with-packages.nix { inherit buildEnv luaPackages;};
pkgs = luaPackages;
interpreter = "${self}/bin/lua";
+ sharedEnabled = enableShared;
};
meta = { Even better would be to have a form of |
@malbarbo FYI static-haskell-nix can already build
If your plan is to build Haskell executables statically using nixpkgs only, then the most efficient path to that might be to help me with merging Your lua improvements are still appreciated though, and there's also this related issue you may want to subscribe to: |
@malbarbo That looks much better, a lot less mass-rebuilds. There are still a few things rebuilding though (these), I don't understand why. For example
The difference is the absence of What am I missing? |
@nh2 Thank you for your help.
I'm starting with nix and didn't know about
I'm interested in some static executables, but I think the only one write is haskell is pandoc. Anyway, I was able to get a static pandoc executable from
It seems that diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index 60742e45a9f..10b82988797 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -42,12 +42,7 @@ in rec {
sourceVersion = { major = "5"; minor = "2"; patch = "4"; };
hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr";
}).overrideAttrs (oldAttrs: rec {
- patches =
- if stdenv.isDarwin then
- [ ./5.2.darwin.patch ]
- else if oldAttrs.passthru.sharedEnabled then
- [ dsoPatch52 ]
- else [ ];
+ patches = [ dsoPatch52 ];
});
lua5_2_compat = lua5_2.override({ but it fails to build with
On the other hand, the package build fine (it is downloaded from the cache, so no hash changes) with diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index 60742e45a9f..837bc08292c 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -41,6 +41,7 @@ in rec {
lua5_2 = (callPackage ./interpreter.nix {
sourceVersion = { major = "5"; minor = "2"; patch = "4"; };
hash = "0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr";
+ patches = [ dsoPatch52 ];
}).overrideAttrs (oldAttrs: rec {
patches =
if stdenv.isDarwin then In |
Hello, I'm a bot and I thank you in the name of the community for your contributions. Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do: If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list. If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past. If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments. Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel. |
I need some help here. It seems that recurseIntoAttrs (#75901 (comment)) does not work as I expect. |
Done in #127425. |
Motivation for this change
This is a step forward to allow static building pandoc.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @nh2