Skip to content

Comments

kikit: 1.7.1 -> 1.7.2, python3.pkgs.pcbnewtransition: 0.5.0 -> 0.5.2: Fix kikit build#395213

Merged
vcunat merged 3 commits intoNixOS:masterfrom
jfly:fix-kikit-build
Apr 7, 2025
Merged

kikit: 1.7.1 -> 1.7.2, python3.pkgs.pcbnewtransition: 0.5.0 -> 0.5.2: Fix kikit build#395213
vcunat merged 3 commits intoNixOS:masterfrom
jfly:fix-kikit-build

Conversation

@jfly
Copy link
Contributor

@jfly jfly commented Apr 1, 2025

Our kikit build is broken. Upgrading to 1.7.2 brings in support for KiCAD v9:
https://github.com/yaqwsx/KiKit/releases/tag/v1.7.2, as we upgraded to
KiCAD v9 recently
.

I've included the pcbnewtransition upgrade in this PR as the new version of kikit depends on "pcbnewTransition >= 0.5.2, <=0.6": https://github.com/yaqwsx/KiKit/blob/v1.7.2/setup.py#L61.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@jfly jfly requested review from matusf and vcunat April 1, 2025 15:45
@github-actions github-actions bot added 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 1, 2025
@gshipunov
Copy link
Member

I've applied the changes on top of the current nixos-unstable, and got a hash mismatch

error: hash mismatch in fixed-output derivation '/nix/store/wbf14mbbl9c5l4wqsjn526jbwbm9iv7n-source.drv':
        likely URL: https://github.com/yaqwsx/KiKit/archive/refs/tags/v1.7.2.tar.gz
         specified: sha256-dM4koOoWuwo8vjq6AM+U3PpYFEcg9Xbk1xhAnTiKRpA=
            got:    sha256-mwe/CajmQD5nDNYtQXRQm4vIJJiY7P5uFrvn8Ngjqc4=
error: 1 dependencies of derivation '/nix/store/xxw0pc2a433kmxgmxlhsm1v1ac72nc95-kikit-1.7.2.drv' failed to build

After updating the hash it builds. Didn't get the opportunity to test it yet.

@jfly jfly force-pushed the fix-kikit-build branch from b877e2f to 0bf05f9 Compare April 4, 2025 13:25
@jfly
Copy link
Contributor Author

jfly commented Apr 4, 2025

Yikes, I don't know how I screwed that up. I don't think upstream has force pushed. Thank you! Fixed.

I've confirmed that this still builds and runs.

@vcunat
Copy link
Member

vcunat commented Apr 4, 2025

The previous version did build successfully in CI, so something fishy is going on.

EDIT: see e.g. https://github.com/NixOS/nixpkgs/runs/39785855079

@jfly
Copy link
Contributor Author

jfly commented Apr 4, 2025

Perhaps fetchFromGitHub behaved non-deterministically?

@vcunat
Copy link
Member

vcunat commented Apr 4, 2025

The set of files served for the tag changed. It's hard to be sure what caused it, but all cases I've heard about have been a force-pushed tag. If you didn't GC, you should still have the old src, so you could compare.

jfly added 2 commits April 6, 2025 10:41
It looks like they've started publishing sdists with lowercase filenames
(`pcbnewtransition-X.Y.Z.tar.gz` rather than
`pcbnewTransition-X.Y.Z.tar.gz`).
@jfly jfly force-pushed the fix-kikit-build branch from 0bf05f9 to a1f8ad3 Compare April 6, 2025 18:00
@jfly
Copy link
Contributor Author

jfly commented Apr 6, 2025

Good thought, @vcunat! Here's the diff:

diff.nix
{
  pkgs ? import <nixpkgs> { },
}:

let
  version = "1.7.2";
  src1 = pkgs.fetchFromGitHub {
    owner = "yaqwsx";
    repo = "KiKit";
    tag = "v${version}";
    hash = "sha256-dM4koOoWuwo8vjq6AM+U3PpYFEcg9Xbk1xhAnTiKRpA=";
  };
  src2 = pkgs.fetchFromGitHub {
    owner = "yaqwsx";
    repo = "KiKit";
    tag = "v${version}";
    hash = "sha256-mwe/CajmQD5nDNYtQXRQm4vIJJiY7P5uFrvn8Ngjqc4=";
  };
in

pkgs.runCommandNoCC "kikit-diff"
  {
    buildInputs = [ pkgs.difftastic ];
  }
  ''
    difft --skip-unchanged --color=always --display=inline ${src1} ${src2} > $out
  ''
$ cat $(nix-build diff.nix)
this derivation will be built:
  /nix/store/qhmf09hlavssjr9vq73rfi0s68g56s54-kikit-diff.drv
building '/nix/store/qhmf09hlavssjr9vq73rfi0s68g56s54-kikit-diff.drv'...
diff -ru /nix/store/lrm67fnkrp3zm7kbzn8xgbf4vkl077ld-source/kikit/_version.py /nix/store/m38r7x0ka8mcng1ig5rdy2b1x19vc78f-source/kikit/_version.py
--- /nix/store/lrm67fnkrp3zm7kbzn8xgbf4vkl077ld-source/kikit/_version.py        1970-01-01 00:00:01.000000000 +0000
+++ /nix/store/m38r7x0ka8mcng1ig5rdy2b1x19vc78f-source/kikit/_version.py        1970-01-01 00:00:01.000000000 +0000
@@ -26,7 +26,7 @@
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (HEAD -> master, tag: v1.7.2)"
+    git_refnames = " (tag: v1.7.2)"
     git_full = "410ea3c6b346695fed893dc1c5082cd3756faf26"
     git_date = "2025-04-01 08:31:21 +0200"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}

It looks like kikit uses export-subst, which causes fetchFromGitHub to behave non-deterministically. Yikes.

I've added another commit to this PR which hacks around the non-determinism.

@vcunat
Copy link
Member

vcunat commented Apr 6, 2025

HEAD -> master in archive export is ugly as hell.

@vcunat
Copy link
Member

vcunat commented Apr 6, 2025

Cross-ref the original culprit: python-versioneer/python-versioneer#217

@jfly jfly force-pushed the fix-kikit-build branch from a1f8ad3 to 24d4c53 Compare April 6, 2025 20:37
@jfly jfly requested a review from vcunat April 6, 2025 20:40
@vcunat vcunat merged commit 5c4321c into NixOS:master Apr 7, 2025
25 of 27 checks passed
@jfly jfly deleted the fix-kikit-build branch April 7, 2025 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants