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

ninja_1_11: init at 1.11.1 #354367

Merged
merged 1 commit into from
Nov 8, 2024
Merged

ninja_1_11: init at 1.11.1 #354367

merged 1 commit into from
Nov 8, 2024

Conversation

emilazy
Copy link
Member

@emilazy emilazy commented Nov 8, 2024

Swift 5.8 doesn’t reliably build with Ninja 1.12, and apparently neither do old versions of ROCm, due to a build scheduling change breaking builds with undeclared dependencies. Upstream Swift have pinned 1.11 for now.

Reintroducing it isn’t a good long‐term solution, but seems like the easiest way to avoid shipping 24.11 with a broken Swift on Darwin. The patch for 32‐bit systems has not been restored, as Swift doesn’t support them anyway.

cc @azuwis @JohnRTitor. I think this is a better approach than overrideAttrs. I confirmed that nix-update can still update the package in this form.

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.

hash = "sha256-LvV/Fi2ARXBkfyA1paCRmLUwCh/rTyz+tGMg2/qEepI=";
};

"1.12" = fetchFromGitHub {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"1.12" = fetchFromGitHub {
"latest" = fetchFromGitHub {

this one should be the latest version, we're not trying to pin it to any specific version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough; pushed. Hopefully this is gone by the time 1.13 comes around either way.

@emilazy
Copy link
Member Author

emilazy commented Nov 8, 2024

De jure Ninja maintainers don’t seem to be actively involved; cc @JohnRTitor @vcunat @NickCao @AndersonTorres who worked on this derivation since 2023.

@@ -11,18 +11,35 @@
, buildPackages
, buildDocs ? true
, nix-update-script
, ninjaRelease ? "latest"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
, ninjaRelease ? "latest"
, use_1_11 ? false

nit. a bool rather than a string would eliminate the error case of an invalid string and make the below assert unnecessary

Copy link
Contributor

@azuwis azuwis left a comment

Choose a reason for hiding this comment

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

How about this?

rev = "v1.12.1";
hash = "sha256-RT5u+TDvWxG5EVQEYj931EZyrHUSAqK73OKDAascAwA=";
};
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
};
} or (throw "Unsupported Ninja release.");

Comment on lines 35 to 37

assert lib.assertMsg (releases ? ${ninjaRelease}) "Unsupported Ninja release: ${ninjaRelease}";

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert lib.assertMsg (releases ? ${ninjaRelease}) "Unsupported Ninja release: ${ninjaRelease}";

Swift 5.8 doesn’t reliably build with Ninja 1.12, and apparently
neither do old versions of ROCm, due to a build scheduling change
breaking builds with undeclared dependencies. Upstream Swift have
pinned 1.11 for now.

Reintroducing it isn’t a good long‐term solution, but seems
like the easiest way to avoid shipping 24.11 with a broken Swift
on Darwin. The patch for 32‐bit systems has not been restored,
as Swift doesn’t support them anyway.
@emilazy
Copy link
Member Author

emilazy commented Nov 8, 2024

Implemented a variant of @azuwis’s suggestion. I prefer not using a boolean here and it seems pretty compact now.

@emilazy
Copy link
Member Author

emilazy commented Nov 8, 2024

Going to take the thumbs up as the closest thing we’ll get to Ninja maintainer approval here :)

@emilazy
Copy link
Member Author

emilazy commented Nov 8, 2024

Result of nixpkgs-review pr 354367 run on aarch64-linux 1

1 package built:
  • ninja_1_11

@emilazy emilazy merged commit ff5eb0c into NixOS:master Nov 8, 2024
10 of 11 checks passed
@emilazy emilazy deleted the push-ppkxzlxnprsm branch November 8, 2024 04:25
@AndersonTorres
Copy link
Member

I want to study that patch from in memoriam @amjoseph that enables multiple versions. IIRC it populates passthru.versions with the various derivations.

@ncfavier ncfavier mentioned this pull request Nov 11, 2024
13 tasks
@ncfavier
Copy link
Member

This change unfortunately breaks nix-prefetch ninja, and as a consequence also nix-prefetch invidious and probably lots of other packages. I don't know why. See #355086 (comment)

$ nix-prefetch -I nixpkgs=. ninja
error:
       … while evaluating attribute 'log'

       … while calling the 'head' builtin
         at /home/n/git/nixpkgs/lib/attrsets.nix:1574:11:
         1573|         || pred here (elemAt values 1) (head values) then
         1574|           head values
             |           ^
         1575|         else

       … while evaluating the attribute 'name'
         at /home/n/git/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:336:7:
          335|     // (optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          336|       name =
             |       ^
          337|         let

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'rev' missing
       at /home/n/git/nixpkgs/pkgs/by-name/ni/ninja/package.nix:19:34:
           18|   pname = "ninja";
           19|   version = lib.removePrefix "v" finalAttrs.src.rev;
             |                                  ^
           20|

@emilazy
Copy link
Member Author

emilazy commented Nov 11, 2024

I suspect nix-prefetch overrides fetchFromGitHub in a way that doesn't expose rev on the result, breaking the interface. That’s a nix-prefetch bug that should probably be fixed, although it would be possible to work around it in this package with a little contortion (to keep supporting nix-update, which is fussy in its own way).

@JohnRTitor
Copy link
Contributor

JohnRTitor commented Nov 12, 2024

I think the issue here is that the version depends on the rev, unlike most of the nixpkgs where it does not.

And the tools were written in assumption to that.

@emilazy
Copy link
Member Author

emilazy commented Nov 12, 2024

It would be easy to passthru the rev in the overridden fetchFromGitHub, I think. The current derivation is perfectly correct as‐is. It’d be fine if someone were to change it to be more compatible, of course, but I do think this should just be fixed in nix-prefetch.

rorosen added a commit to rorosen/nixpkgs that referenced this pull request Nov 17, 2024
The changes introduced with NixOS#354367
lead currently to an evaluation error when prefetching vendored go
dependencies with `nix-prefetch`. Although this is probably a bug in
`nix-prefetch`, I prefer to use `nurl` instead as it does the same
thing, seems better maintained and doesn't block k3s updates even longer.
rorosen added a commit to rorosen/nixpkgs that referenced this pull request Nov 18, 2024
The changes introduced with NixOS#354367
lead currently to an evaluation error when prefetching vendored go
dependencies with `nix-prefetch`. Although this is probably a bug in
`nix-prefetch`, I prefer to use `nurl` instead as it does the same
thing, seems better maintained and doesn't block k3s updates even longer.
paschoal pushed a commit to paschoal/nixpkgs that referenced this pull request Nov 22, 2024
The changes introduced with NixOS#354367
lead currently to an evaluation error when prefetching vendored go
dependencies with `nix-prefetch`. Although this is probably a bug in
`nix-prefetch`, I prefer to use `nurl` instead as it does the same
thing, seems better maintained and doesn't block k3s updates even longer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants