NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

Build failure: openscad-unstable #341043

Closed LordMZTE closed 1 month ago

LordMZTE commented 2 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build pkgs.openscad-unstable

Build log

https://gist.github.com/LordMZTE/6688b9006c564b9634ff94013bc2746b

Additional context

Nixpkgs rev: 28e9b6d60ffd048dbbfbce525f8ab5bd726a22c3

Notify maintainers

@pca006132 @7c6f434c

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.49, NixOS, 24.11 (Vicuna), 24.11.20240906.5a24308`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.5`
 - nixpkgs: `/nix/store/flmsip7hr1bb8q3d59z0k17j7gqjnsni-source`

(above nixpkgs version is NOT the one with the failing openscad-unstable package!)


Add a :+1: reaction to issues you find important.

pca006132 commented 2 months ago

@hzeller do you have any idea about this? it is weird that version.h is missing in the nix store in the log.

hzeller commented 2 months ago

There seem to be some thrust cmake issues (this is what I got on my machine right now:)

CMake Error at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config-version.cmake:4 (file):
  file failed to open for reading (No such file or directory):

    /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/../../thrust/version.h
Call Stack (most recent call first):
  submodules/manifold/src/utilities/CMakeLists.txt:27 (find_package)

CMake Error at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config-version.cmake:11 (math):
  math cannot parse the expression: " / 100000": syntax error, unexpected
  exp_DIVIDE (2).
Call Stack (most recent call first):
  submodules/manifold/src/utilities/CMakeLists.txt:27 (find_package)

CMake Error at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config-version.cmake:12 (math):
  math cannot parse the expression: "( / 100) % 1000": syntax error,
  unexpected exp_DIVIDE (3).
Call Stack (most recent call first):
  submodules/manifold/src/utilities/CMakeLists.txt:27 (find_package)

CMake Error at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config-version.cmake:13 (math):
  math cannot parse the expression: " % 100": syntax error, unexpected
  exp_MOD (2).
Call Stack (most recent call first):
  submodules/manifold/src/utilities/CMakeLists.txt:27 (find_package)

CMake Error at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config.cmake:698 (find_package):
  find_package called with invalid argument "ERROR.ERROR.ERROR."
Call Stack (most recent call first):
  submodules/manifold/src/utilities/CMakeLists.txt:27 (find_package)

CMake Error at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config.cmake:708 (find_package):
  find_package called with invalid argument "ERROR.ERROR.ERROR."
Call Stack (most recent call first):
  submodules/manifold/src/utilities/CMakeLists.txt:27 (find_package)

Will have to look later today. (Luckily, we soon won't need that for much longer once https://github.com/openscad/openscad/pull/5282 is in and we can update openscad with that)

pca006132 commented 2 months ago

The weird thing is that when I build without pinning to this specific commit hash, the registry points to

Revision:      5775c2583f1801df7b790bf7f7d710a19bac66f4
Last modified: 2024-09-10 03:32:08

Which is also having the 2024.08.17 update. This one rebuilds fine, but pinning the version to https://github.com/NixOS/nixpkgs/commit/28e9b6d60ffd048dbbfbce525f8ab5bd726a22c3 makes things fail. And I cannot think of why cccl is causing a problem here, considering we already pinned the source version of cccl and will not be affected by other changes to the cccl package in nixpkgs...

hzeller commented 2 months ago

The version.h that cmake attempts to read does exist (/nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/include/thrust/version.h) and is referred in the thrust-config-version.cmake (at /nix/store/hg8miphrnqwp8j8p2czl1dns3157cy5b-nvidia-cccl-2.2.0/lib/cmake/thrust/thrust-config-version.cmake) with

file(READ "${_THRUST_VERSION_INCLUDE_DIR}/thrust/version.h" THRUST_VERSION_HEADER)

(the line with the reported error)

Maybe cmake changed and now the ${_THRUST_VERSION_INCLUDE_DIR} variable is evaluated differently ?

LordMZTE commented 2 months ago

Have I understood correctly that this does not occur on master? The specific commit hash I referenced is where nixos-unstable-small is at at the time of writing, hence why I used it. Perhaps this is caused by a since fixed issue with another package and we can consider this resolved. I will try rebuilding once nixos-unstable-small catches up a bit and close this if openscad builds then, unless we find the cause first and can say for sure that this is fixed, of course.

hzeller commented 2 months ago

I am pretty sure it also happens at nixpkgs master at head (IIRC, this is what I checked earlier).

LordMZTE commented 2 months ago

Oh my bad! I misunderstood pca006132's earlier comment as stating that it build on a newer nixpkgs revision.

hzeller commented 2 months ago

With a bit of manual bi-secting it looks like commit c4f9868fa12e739f7ab3a5a40c705e3f58e318bc might the culprit. The one before (in the sense of git log) 17aec19b9a03a646da4341fcf2e0a3672970f663 works.

However, it does not really look super-related.

hzeller commented 1 month ago

^ the above was a red herring (as somewhat expected). Unapplying that commit locally will not fix the issue.

pca006132 commented 1 month ago

Maybe we should mark it as broken for now, until the upstream PR is merged? Not sure if it is worth the effort to find the cause of the breakage.

hzeller commented 1 month ago

Sounds good PR #341212

etu commented 1 month ago

Will have to look later today. (Luckily, we soon won't need that for much longer once openscad/openscad#5282 is in and we can update openscad with that)

This upstream PR is now merged :slightly_smiling_face:

hzeller commented 1 month ago

Also, nixpkgs have been updated https://github.com/NixOS/nixpkgs/pull/343154

hzeller commented 1 month ago

Looks like this can be closed.