-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Build failure: ghostscript-10.04.0 #355377
Comments
The way MacPorts handles this might help: https://github.com/macports/macports-ports/blob/d8a05520fa6a81fa5b0365068590aff184976b69/print/ghostscript/Portfile#L114 So adding DARWIN_LDFLAGS_SO_PREFIX=$out/lib/ to the build environment should fix it. |
Hey, thanks for reporting this. I'll try to find some time to take a look in a couple of hours. |
Hello :) Just wanted to mention that this also happens on |
The linked PR should fix that too. |
The linked PR doesn't work for me, it gets me past the compiles stage, but the binary keeps failing in the same way. |
The linked PR is not working for me either. |
Adding the flag to the build env does not resolve this.
|
@ironicbadger what package does this fail for? |
It looks like ghostscript. But for what that is a dependency for I am not sure. Do you know how to help me pinpoint? |
For me, it fails for ansible-lint. Which requires ghostscript as a deps. |
For me, ghostscript-10-04-0 fails for:
|
The fix I suggested in #355377 (comment) should resolve these failures, and remove the need to set |
So setting this an env var on the Mac in question before doing the build? If so, that didn't work. |
No, it needs to be set in the package definition during build. Builds are isolated from your env. |
@elsbrock @carlocab I'm sorry, but I'm failing to understand how we should approach this. Below is a snippet of the problematic nix code. If I'm not supposed to pass the env to the command, what am I supposed to do? Do I create an overlay instead? Example: {
lib,
pkgs,
config,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.local.packages;
in
{
options.local.packages = {
enableDevTools = mkEnableOption "Enable dev tools";
};
config = mkIf cfg.enableDevTools {
environment.systemPackages = with pkgs; [...];
users.users.${config.crossSystem.username}.packages = with pkgs; [
terraform
(python312.withPackages (ps: [
ps.pip
ps.ansible-core
]))
ansible-lint # Fails because of this
];
};
} |
How? |
If my understanding is correct, it is not a build time problem. At runtime, ghostscripts expects to find In #355853 we are fixing the check but not the binary. There is a post install check that runs I'm a newbie of nix, but I think the derivation should add something like |
This solution doesn't scale, because every binary that links with The right thing to do is to build the ghostscript libraries with the correct install names. This can be done using the approach suggested at #355377 (comment). Or you can use |
There was an error in the #357951 fixes that for me, my |
Fixes NixOS#355377. This should avoid the need to mess around with `install_name_tool` entirely. This mirrors what is done by Homebrew[^1] and MacPorts[^2]. This should also make the changes in NixOS#355853 and NixOS#357951 unnecessary. [^1]: https://github.com/Homebrew/homebrew-core/blob/5ca4f8ce766c69d49321fb7da1d297b8232f40cf/Formula/g/ghostscript.rb#L76 [^2]: https://github.com/macports/macports-ports/blob/d8a05520fa6a81fa5b0365068590aff184976b69/print/ghostscript/Portfile#L114
how can I apply this fix from #358079 in my current config which uses nixos-unstable for all ghostscript dependencies till this PR is merged? |
If you are using flakes you will need to use an overlay. Roughly: inputs = {
...
ghostscript-fix = {
url = "github:carlocab/nixpkgs/fix-ghostscript";
};
...
};
outputs = {
...
ghostscript-fix,
}:
...
nixpkgs.overlays = [
(final: prev: {
ghostscript = ghostscript-fix.legacyPackages.${prev.system}.ghostscript;
})
];
... This is working on my system: HPRIOR/nix-config@e517dd1 |
Issue appears linked to any application that requires python e.g. ansible (as mentioned by @ironicbadger), borgmatic, kitty etc. My build work fine when I remove any of those apps. I have tried applying the overlay and the build no longer fails on ghostscript-10.04.0 but then fails on bulding some apps based on python e.g.
I excluded borgbackup and tried again, ansible installed ok but it took a while. It appeared to build the package from source. |
After switching to 24.11 all errors disappeared |
Fixes #355377. This should avoid the need to mess around with `install_name_tool` entirely. This mirrors what is done by Homebrew[^1] and MacPorts[^2]. This should also make the changes in #355853 and #357951 unnecessary. [^1]: https://github.com/Homebrew/homebrew-core/blob/5ca4f8ce766c69d49321fb7da1d297b8232f40cf/Formula/g/ghostscript.rb#L76 [^2]: https://github.com/macports/macports-ports/blob/d8a05520fa6a81fa5b0365068590aff184976b69/print/ghostscript/Portfile#L114
Fixes NixOS#355377. This should avoid the need to mess around with `install_name_tool` entirely. This mirrors what is done by Homebrew[^1] and MacPorts[^2]. This should also make the changes in NixOS#355853 and NixOS#357951 unnecessary. [^1]: https://github.com/Homebrew/homebrew-core/blob/5ca4f8ce766c69d49321fb7da1d297b8232f40cf/Formula/g/ghostscript.rb#L76 [^2]: https://github.com/macports/macports-ports/blob/d8a05520fa6a81fa5b0365068590aff184976b69/print/ghostscript/Portfile#L114 (cherry picked from commit 8b3d3d5)
as @HPRIOR said, adding the overlay fixed it for me. I also had to apply another one to fix # darwin.nix
nixpkgs.overlays = [
(final: prev: {
ghostscript = ghostscript-fix.legacyPackages.${prev.system}.ghostscript;
p11-kit = prev.p11-kit.overrideAttrs (oldAttrs: {
mesonCheckFlags = oldAttrs.mesonCheckFlags or [ ] ++ [
"--timeout-multiplier"
"0"
];
});
})
]; |
Steps To Reproduce
Steps to reproduce the behavior:
Build log
Notify maintainers
@tobim
Metadata
"aarch64-darwin"
Darwin 24.1.0, macOS 15.1
yes
no
nix-env (Nix) 2.18.8
/nix/store/dxdcvjnvz3b91gvsrhpb7gp156nnj8bf-source
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: