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

ghostscript: fix installCheck on aarch64-darwin #355853

Merged

Conversation

tobim
Copy link
Contributor

@tobim tobim commented Nov 14, 2024

Fixes #355377.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@tarc
Copy link
Contributor

tarc commented Nov 16, 2024

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

3 packages built:
  • ghostscript
  • ghostscript.doc (ghostscript.doc.doc ,ghostscript.doc.man)
  • ghostscript.man (ghostscript.man.doc ,ghostscript.man.man)

@tarc
Copy link
Contributor

tarc commented Nov 16, 2024

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

2 packages failed to build:
  • python311Packages.matplotlib
  • python311Packages.matplotlib.dist (python311Packages.matplotlib.dist.dist)
3 packages built:
  • ghostscript
  • ghostscript.doc (ghostscript.doc.doc ,ghostscript.doc.man)
  • ghostscript.man (ghostscript.man.doc ,ghostscript.man.man)

@emilazy
Copy link
Member

emilazy commented Nov 16, 2024

I take it this is only needed on 24.05?

@tobim
Copy link
Contributor Author

tobim commented Nov 16, 2024

Yes.
I should adjust the change to avoid linux rebuilds.

@tobim tobim force-pushed the pkgs/ghostscript-darwin-installcheck branch from 94cc01c to 229a8f7 Compare November 16, 2024 07:09
Comment on lines +152 to +155
preInstallCheck = if stdenv.hostPlatform.isDarwin then ''
DYLD_LIBRARY_PATH=$out/lib
export DYLD_LIBRARY_PATH
'' else null;
Copy link
Member

Choose a reason for hiding this comment

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

I believe this will still cause rebuilds (unless it defaults to null?). You generally need ${if stdenv.hostPlatform.isDarwin then "preInstallCheck" else null} = ….

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ofborg thinks it's fine.

@ofborg ofborg bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ labels Nov 16, 2024
@emilazy emilazy merged commit 47e2bdc into NixOS:staging-24.05 Nov 17, 2024
29 of 30 checks passed
@tobim tobim deleted the pkgs/ghostscript-darwin-installcheck branch November 17, 2024 07:14
@nolith
Copy link

nolith commented Nov 19, 2024

Hello, I have the same problem building ghostscript but the provided fix allows building, but the resulting binary still fails.

 nix run "github:nixos/nixpkgs?ref=pull/355853/head#ghostscript" -- gs --help
dyld[46794]: Library not loaded: libgs.10.dylib
  Referenced from: <497CFDBA-A6D1-332C-B983-C3CFF6293055> /nix/store/i7wwb7hdnxhng7v356skk8qrzx2w4ds2-ghostscript-10.04.0/bin/gs
  Reason: tried: 'libgs.10.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibgs.10.dylib' (no such file), 'libgs.10.dylib' (no such file), '/usr/local/lib/libgs.10.dylib' (no such file), '/usr/lib/libgs.10.dylib' (no such file, not in dyld cache), '/Users/nolith/.config/nolith-nix/libgs.10.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/nolith/.config/nolith-nix/libgs.10.dylib' (no such file), '/Users/nolith/.config/nolith-nix/libgs.10.dylib' (no such file), '/usr/local/lib/libgs.10.dylib' (no such file), '/usr/lib/libgs.10.dylib' (no such file, not in dyld cache)
[1]    46794 abort      nix run "github:nixos/nixpkgs?ref=pull/355853/head#ghostscript" -- gs --help

Am I doing something wrong?

carlocab added a commit to carlocab/nixpkgs that referenced this pull request Nov 22, 2024
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
@carlocab
Copy link

This should fix it: #358079

emilazy pushed a commit that referenced this pull request Nov 25, 2024
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
osnyx pushed a commit to flyingcircusio/nixpkgs that referenced this pull request Nov 25, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants