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

postgresql_jit.pkgs.postgis: fix build on darwin #342369

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

wolfgangwalther
Copy link
Contributor

Description of changes

We introduced LTO in #294504. At that time, we still needed to use LLVM / lld to make this work on darwin. For this to work for extensions, they would need to set CFLAGS=-fuse-ld=lld, too. However, since #307880 landed, we don't need to do this anymore in the first place, LTO just works out of the box on darwin.

Resolves #342362

@Ma27

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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Sep 16, 2024
@ofborg ofborg bot requested review from danbst, globin, Ma27 and ivan September 16, 2024 21:56
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 101-500 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Sep 16, 2024
@Ma27
Copy link
Member

Ma27 commented Sep 19, 2024

Breaks on the community builder with

error: build of '/nix/store/aa89767hvi12x4sapxpdm9fq761690af-postgresql-jit-16.4.drv' on 'ssh-ng://darwin-nixos?&' failed: derivation contains an illegal reference specifier 'doc'
error: builder for '/nix/store/aa89767hvi12x4sapxpdm9fq761690af-postgresql-jit-16.4.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/wiad4s44swxi9bxz74wzkm8xs56a2r61-postgis-3.4.2.drv' failed to build

@wolfgangwalther
Copy link
Contributor Author

Breaks on the community builder with

Odd. I tested it there as well. But I get a different hash, too:

% nix-build --argstr system aarch64-darwin -A postgresql_16_jit.pkgs.postgis
/nix/store/xv0sh44p7mi73wgplz6p81lalkififbg-postgis-3.4.2

Are you testing aarch64 or x86-64 for darwin?

failed: derivation contains an illegal reference specifier 'doc'

Never seen that before. Hmm...

We introduced LTO in NixOS#294504. At that time, we still needed to use LLVM
/ lld to make this work on darwin. For this to work for extensions, they
would need to set CFLAGS=-fuse-ld=lld, too. However, since NixOS#307880
landed, we don't need to do this anymore in the first place, LTO just
works out of the box on darwin.

Resolves NixOS#342362
@wolfgangwalther
Copy link
Contributor Author

Still works for me on the community builder. Even after a rebase on latest master (pushed that rebase) it still works.

@Ma27
Copy link
Member

Ma27 commented Sep 19, 2024

Odd. I tested it there as well. But I get a different hash, too:

That's the out hash though, not the .drv hash.

Are you testing aarch64 or x86-64 for darwin?

aarch64-darwin.

Never seen that before. Hmm...

Lix on my work Mac works, so either some weird impurity or a Nix 2.24 problem.

But let me rebuild on the community builder.

@wolfgangwalther
Copy link
Contributor Author

That's the out hash though, not the .drv hash.

Ah, right. I have the same drv hash.

or a Nix 2.24 problem.

I have:

% nix --version
nix (Nix) 2.23.3

So that could be.

@wolfgangwalther
Copy link
Contributor Author

But let me rebuild on the community builder.

Were you able to build this time or are you still getting that error?

@Ma27
Copy link
Member

Ma27 commented Sep 21, 2024

Were you able to build this time or are you still getting that error?

Given that we've built it successfully on at least one machine each, I think it's OK to merge. I'd argue it's a Nix bug then. My money is on some kind of problem with the daemon protocol, wouldn't be the first time in my experience.

@Ma27 Ma27 merged commit 2795949 into NixOS:master Sep 21, 2024
22 checks passed
@wolfgangwalther wolfgangwalther deleted the postgresql-jit-postgis-darwin branch September 23, 2024 18:08
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: 101-500 10.rebuild-linux: 0 This PR does not cause any packages to rebuild 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build failure: postgresql16JitPackages.postgis
2 participants