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

xrootd: provide fuse support (xrootdfs) for Darwin and fix the tests #206969

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Dec 20, 2022

Description of changes

Pass fuse into buildInputs by defaults and use fuse = osxfuse on Darwin.

This should bring no change to the Linux package. However, the Linux package also rebuilds due to the change of the buildInputs order.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Dec 20, 2022
@ShamrockLee ShamrockLee force-pushed the xrootd-fuse branch 2 times, most recently from 7fd221b to 0388532 Compare December 20, 2022 09:39
@ShamrockLee ShamrockLee changed the title xrootd: provide fuse support (xrootdfs) for Darwin xrootd: provide fuse support (xrootdfs) for Darwin and fix the tests Dec 20, 2022
@ShamrockLee
Copy link
Contributor Author

@veprbl Could you help take a look?

@SuperSandro2000 SuperSandro2000 added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 23, 2023
@wegank
Copy link
Member

wegank commented Feb 2, 2023

@ofborg build xrootd xrootd.passthru.tests

@wegank wegank merged commit d34529b into NixOS:master Feb 2, 2023
@gador
Copy link
Member

gador commented Feb 3, 2023

This seems to break nixpkgs-review (from an unrelated PR):

$ nix-env --option system x86_64-linux -f /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs -qaP --xml --out-path --show-trace --no-allow-import-from-derivation
error:
       … while querying the derivation named 'hepmc3-3.2.5'

       … while evaluating the attribute 'out.outPath'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/customisation.nix:215:13:

          214|             drvPath = assert condition; drv.${outputName}.drvPath;
          215|             outPath = assert condition; drv.${outputName}.outPath;
             |             ^
          216|           };

       … while evaluating the attribute 'buildInputs' of the derivation 'hepmc3-3.2.5'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while evaluating the attribute 'buildInputs' of the derivation 'root-6.26.10'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while evaluating the attribute 'buildInputs' of the derivation 'xrootd-5.5.1'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'getOutput'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/attrsets.nix:832:23:

          831|   */
          832|   getOutput = output: pkg:
             |                       ^
          833|     if ! pkg ? outputSpecified || ! pkg.outputSpecified

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:233:13:

          232|       (map (drv: drv.__spliced.hostHost or drv) (checkDependencyList "depsHostHost" depsHostHost))
          233|       (map (drv: drv.__spliced.hostTarget or drv) (checkDependencyList "buildInputs" buildInputs'))
             |             ^
          234|     ]

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/lists.nix:117:29:

          116|   */
          117|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                             ^
          118|

       … while evaluating call site

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/lists.nix:117:32:

          116|   */
          117|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                ^
          118|

       … while calling anonymous lambda

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:200:81:

          199|   checkDependencyList = checkDependencyList' [];
          200|   checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep:
             |                                                                                 ^
          201|     if lib.isDerivation dep || isNull dep || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep

       … while evaluating call site

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:8:

          200|   checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep:
          201|     if lib.isDerivation dep || isNull dep || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep
             |        ^
          202|     else if lib.isList dep then checkDependencyList' ([index] ++ positions) name dep

       … while calling 'isDerivation'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/attrsets.nix:576:5:

          575|     # Value to check.
          576|     value: value.type or null == "derivation";
             |     ^
          577|

       error: undefined variable 'hostPlatform'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/top-level/all-packages.nix:1606:10:

         1605|     fuse =
         1606|       if hostPlatform.isDarwin then osxfuse
             |          ^
         1607|       else if hostPlatform.isLinux then fuse

and here:

nixpkgs-review pr 206969
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/206969/head:refs/nixpkgs-review/1
Von https://github.com/NixOS/nixpkgs
 + 885bf6b3a46...4f424907226 refs/pull/206969/head -> refs/nixpkgs-review/1  (Aktualisierung erzwungen)
$ git worktree add /home/wogan/.cache/nixpkgs-review/pr-206969/nixpkgs 89fae351e4a69b429182e6ffdd348202dd28522e
Bereite Arbeitsverzeichnis vor (losgelöster HEAD 89fae351e4a)
Aktualisiere Dateien: 100% (33563/33563), fertig.
HEAD ist jetzt bei 89fae351e4a Merge pull request #210875 from oluceps/update-maple
$ git merge --no-commit --no-ff 4f424907226c783b9203c5cddcd0a5276980dc79
Bereits aktuell.
error: undefined variable 'hostPlatform'

       at /home/wogan/.cache/nixpkgs-review/pr-206969/nixpkgs/pkgs/top-level/all-packages.nix:1606:10:

         1605|     fuse =
         1606|       if hostPlatform.isDarwin then osxfuse
             |          ^
         1607|       else if hostPlatform.isLinux then fuse
(use '--show-trace' to show detailed location information)
nix --experimental-features nix-command --system x86_64-linux eval --json --impure --no-allow-import-from-derivation --expr (import /nix/store/gn0vlbi471779yizjkvlz87xk71haq0h-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/nix/evalAttrs.nix { allowAliases = false; attr-json = /tmp/tmpvjqi88bh; }) failed to run, /tmp/tmpvjqi88bh was stored inspection
https://github.com/NixOS/nixpkgs/pull/206969 failed to build

@wegank
Copy link
Member

wegank commented Feb 3, 2023

This seems to break nixpkgs-review (from an unrelated PR):

$ nix-env --option system x86_64-linux -f /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs -qaP --xml --out-path --show-trace --no-allow-import-from-derivation
error:
       … while querying the derivation named 'hepmc3-3.2.5'

       … while evaluating the attribute 'out.outPath'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/customisation.nix:215:13:

          214|             drvPath = assert condition; drv.${outputName}.drvPath;
          215|             outPath = assert condition; drv.${outputName}.outPath;
             |             ^
          216|           };

       … while evaluating the attribute 'buildInputs' of the derivation 'hepmc3-3.2.5'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while evaluating the attribute 'buildInputs' of the derivation 'root-6.26.10'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while evaluating the attribute 'buildInputs' of the derivation 'xrootd-5.5.1'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:286:7:

          285|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          286|       name =
             |       ^
          287|         let

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'getOutput'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/attrsets.nix:832:23:

          831|   */
          832|   getOutput = output: pkg:
             |                       ^
          833|     if ! pkg ? outputSpecified || ! pkg.outputSpecified

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:233:13:

          232|       (map (drv: drv.__spliced.hostHost or drv) (checkDependencyList "depsHostHost" depsHostHost))
          233|       (map (drv: drv.__spliced.hostTarget or drv) (checkDependencyList "buildInputs" buildInputs'))
             |             ^
          234|     ]

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/lists.nix:117:29:

          116|   */
          117|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                             ^
          118|

       … while evaluating call site

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/lists.nix:117:32:

          116|   */
          117|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                ^
          118|

       … while calling anonymous lambda

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:200:81:

          199|   checkDependencyList = checkDependencyList' [];
          200|   checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep:
             |                                                                                 ^
          201|     if lib.isDerivation dep || isNull dep || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep

       … while evaluating call site

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:8:

          200|   checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep:
          201|     if lib.isDerivation dep || isNull dep || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep
             |        ^
          202|     else if lib.isList dep then checkDependencyList' ([index] ++ positions) name dep

       … while calling 'isDerivation'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/lib/attrsets.nix:576:5:

          575|     # Value to check.
          576|     value: value.type or null == "derivation";
             |     ^
          577|

       error: undefined variable 'hostPlatform'

       at /home/wogan/.cache/nixpkgs-review/pr-214311/nixpkgs/pkgs/top-level/all-packages.nix:1606:10:

         1605|     fuse =
         1606|       if hostPlatform.isDarwin then osxfuse
             |          ^
         1607|       else if hostPlatform.isLinux then fuse

and here:

nixpkgs-review pr 206969
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0 pull/206969/head:refs/nixpkgs-review/1
Von https://github.com/NixOS/nixpkgs
 + 885bf6b3a46...4f424907226 refs/pull/206969/head -> refs/nixpkgs-review/1  (Aktualisierung erzwungen)
$ git worktree add /home/wogan/.cache/nixpkgs-review/pr-206969/nixpkgs 89fae351e4a69b429182e6ffdd348202dd28522e
Bereite Arbeitsverzeichnis vor (losgelöster HEAD 89fae351e4a)
Aktualisiere Dateien: 100% (33563/33563), fertig.
HEAD ist jetzt bei 89fae351e4a Merge pull request #210875 from oluceps/update-maple
$ git merge --no-commit --no-ff 4f424907226c783b9203c5cddcd0a5276980dc79
Bereits aktuell.
error: undefined variable 'hostPlatform'

       at /home/wogan/.cache/nixpkgs-review/pr-206969/nixpkgs/pkgs/top-level/all-packages.nix:1606:10:

         1605|     fuse =
         1606|       if hostPlatform.isDarwin then osxfuse
             |          ^
         1607|       else if hostPlatform.isLinux then fuse
(use '--show-trace' to show detailed location information)
nix --experimental-features nix-command --system x86_64-linux eval --json --impure --no-allow-import-from-derivation --expr (import /nix/store/gn0vlbi471779yizjkvlz87xk71haq0h-nixpkgs-review-2.8.0/lib/python3.10/site-packages/nixpkgs_review/nix/evalAttrs.nix { allowAliases = false; attr-json = /tmp/tmpvjqi88bh; }) failed to run, /tmp/tmpvjqi88bh was stored inspection
https://github.com/NixOS/nixpkgs/pull/206969 failed to build

Oh, sorry! I've reverted this, and I'll redo the PR afterwards.

@ShamrockLee ShamrockLee deleted the xrootd-fuse branch February 3, 2023 08:41
@ShamrockLee
Copy link
Contributor Author

@gador Sorry for the trouble.

I guess it would be better to test it on a real Darwing setup (either bare-metal or virtual) instead of relying on OfBorg.

@ShamrockLee
Copy link
Contributor Author

ShamrockLee commented Feb 3, 2023

@wegank Just curious, how does revert and redo solves the problem? The code seems the same.

@wegank
Copy link
Member

wegank commented Feb 3, 2023

@wegank Just curious, how does revert and redo solves the problem? The code seems the same.

I think hostPlatform should be replaced by stdenv.hostPlatform.

My PR was just a minimal one, with zero rebuilds on Linux. Feel free to add the tests again.

@ShamrockLee
Copy link
Contributor Author

My PR was just a minimal one, with zero rebuilds on Linux. Feel free to add the tests again.

That's because the position of fuse in the buildInputs aren't changed.

I try to place them in alphabetical order, which changes its position when moving it up and causes the rebuild.

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: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants