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

Build failure: rclone 1.63.0 on aarch64-darwin #241706

Closed
montchr opened this issue Jul 5, 2023 · 2 comments · Fixed by #241863
Closed

Build failure: rclone 1.63.0 on aarch64-darwin #241706

montchr opened this issue Jul 5, 2023 · 2 comments · Fixed by #241863
Labels
0.kind: build failure A package fails to build

Comments

@montchr
Copy link
Member

montchr commented Jul 5, 2023

Steps To Reproduce

Steps to reproduce the behavior:

  1. build rclone 1.63.0 on aarch64-darwin

Build log

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/5xqqv8l0b4iq0cl22q7nhvbylcd9z0rh-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Building subPackage ./.
# github.com/shoenig/go-m1cpu
vendor/github.com/shoenig/go-m1cpu/cpu.go:65:33: error: use of undeclared identifier 'kIOMainPortDefault'; did you mean 'kIOMasterPortDefault'?
   IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iter);
                                ^~~~~~~~~~~~~~~~~~
                                kIOMasterPortDefault
/nix/store/kpkqip48d0k2capsw9xq4ilr5ph6j5yp-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:103:19: note: 'kIOMasterPortDef>
const mach_port_t kIOMasterPortDefault;
                  ^
1 error generated.

Additional context

  • rclone 1.63.0 is available in nixos-unstable

Notify maintainers

@danielfullmer @marsam @SuperSandro2000

Metadata

Using flakes, tracking nixos-unstable

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

nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.5.0, macOS 13.4.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.11.1`
 - channels(cdom): `"home-manager"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/store/d8myz5q96bls7a8yvrq94sdmn41xhfqw-2p1jsxsxv0d0gkybanb5acbpi7sr6rjw-source`
@montchr montchr added the 0.kind: build failure A package fails to build label Jul 5, 2023
@marsam
Copy link
Contributor

marsam commented Jul 5, 2023

It happens because go-m1cpu<0.1.6, doesn't handle when building with macOS SDK >= 12.0
It was already fixed in upstream rclone/rclone#7099. I think we can add a patch with it.

@CorbanR
Copy link
Contributor

CorbanR commented Jul 6, 2023

I opened an issue under nix(which was the wrong place), but I have the same issue. This is what my ticket said. I think the issue maybe with more than just the rclone package.

Describe the bug
There appears to be an issue with packages that use the later versions of github.com/shoenig/go-m1cpu. I don't think the issue is with github.com/shoenig/go-m1cpu directly. See shoenig/go-m1cpu#5

So far the error can be seen in both nomad and rclone. See the example error below.(Ran nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }' from inside nomad folder on master branch.

 nix-build -E 'with import <nixpkgs> { }; callPackage ./default.nix { }'
this derivation will be built:
  /nix/store/psdaf1j3fk5z7z7pqxi53rzpkdd3aj0y-nomad-1.5.6.drv
these 2 paths will be fetched (57.67 MiB download, 158.16 MiB unpacked):
  /nix/store/w617m8r5pcp96g50k4lwzai4ddjpj5b3-nomad-1.2.16
  /nix/store/rv50wv3wbfafbdvllzkj7bd51s3i39fv-nomad-1.3.9
copying path '/nix/store/rv50wv3wbfafbdvllzkj7bd51s3i39fv-nomad-1.3.9' from 'https://cache.nixos.org'...
copying path '/nix/store/w617m8r5pcp96g50k4lwzai4ddjpj5b3-nomad-1.2.16' from 'https://cache.nixos.org'...
building '/nix/store/psdaf1j3fk5z7z7pqxi53rzpkdd3aj0y-nomad-1.5.6.drv'...
unpacking sources
unpacking source archive /nix/store/p0c06jzmy24wkhg5q2ydpipdkck9gyvp-source
source root is source
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
building
Building subPackage ./.
# github.com/shoenig/go-m1cpu
vendor/github.com/shoenig/go-m1cpu/cpu.go:65:33: error: use of undeclared identifier 'kIOMainPortDefault'; did you mean 'kIOMasterPortDefault'?
   IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iter);
                                ^~~~~~~~~~~~~~~~~~
                                kIOMasterPortDefault
/nix/store/fqlxrzgpr6hrkbrb060g6njfn5yr7b1y-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:103:19: note: 'kIOMasterPortDefault' declared here
const mach_port_t kIOMasterPortDefault;
                  ^
1 error generated.
error: builder for '/nix/store/psdaf1j3fk5z7z7pqxi53rzpkdd3aj0y-nomad-1.5.6.drv' failed with exit code 1;
       last 10 log lines:
       > Building subPackage ./.
       > # github.com/shoenig/go-m1cpu
       > vendor/github.com/shoenig/go-m1cpu/cpu.go:65:33: error: use of undeclared identifier 'kIOMainPortDefault'; did you mean 'kIOMasterPortDefault'?
       >    IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iter);
       >                                 ^~~~~~~~~~~~~~~~~~
       >                                 kIOMasterPortDefault
       > /nix/store/fqlxrzgpr6hrkbrb060g6njfn5yr7b1y-apple-framework-IOKit-11.0.0/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:103:19: note: 'kIOMasterPortDefault' declared here
       > const mach_port_t kIOMasterPortDefault;
       >                   ^
       > 1 error generated.
       For full logs, run 'nix log /nix/store/psdaf1j3fk5z7z7pqxi53rzpkdd3aj0y-nomad-1.5.6.drv'.

So far I get the same issue on both Rclone and Nomad packages. This seems like a relatively new issue as both Rclone and Nomad have recently updated the github.com/shoenig/go-m1cpu package

I believe this issue is related to nixpkgs and NOT the go-m1cpu as i'm able to checkout both rclone and nomad source repositories and run go build successfully.

Steps To Reproduce

Try building latest version of nomad or rclone on an m2 mac using the latest nix derivation located at pkgs/applications/networking/sync/rclone/ and pkgs/applications/networking/cluster/nomad/
Example command nix-build -E 'with import { }; callPackage ./default.nix { }'
Expected behavior

Packages build correctly

nix-env --version output
nix-env (Nix) 2.15.1

Additional context
OSX 13.4.1, M2

jwiegley pushed a commit to jwiegley/nixpkgs that referenced this issue Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants