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

[BUG] Build error on M1 when running pnpm prep #53

Closed
TheUltDev opened this issue Apr 28, 2022 · 1 comment · Fixed by #54
Closed

[BUG] Build error on M1 when running pnpm prep #53

TheUltDev opened this issue Apr 28, 2022 · 1 comment · Fixed by #54
Labels
kind/bug Something isn't working

Comments

@TheUltDev
Copy link
Contributor

TheUltDev commented Apr 28, 2022

Describe the bug

pnpm prep is producing a build error on M1 MBP

It's entirely possible this is an environmental issue and not related to M1 directly, I'm not a Rust developer, this was a clean install of Rust.

To Reproduce

  1. Have an M1 MBP
  2. Follow contributing guide
  3. At the pnpm prep step, see error

Output

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "arm64" "/repo/spacedrive/target/debug/deps/sdcore-057366575273bd28.11l54r2yneiizk98.rcgu.o" ... 
  = note: ld: in /Users/JohnDoe/Documents/GitHub/spacedrive/target/debug/deps/libring-51854f980945fc0e.rlib(chacha-armv8-ios64.o), building for macOS, but linking in object file built for iOS, for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)      

warning: `sdcore` (lib test) generated 4 warnings (4 duplicates)
error: could not compile `sdcore` due to previous error; 4 warnings emitted
warning: build failed, waiting for other jobs to finish...
warning: `sdcore` (lib) generated 4 warnings
error: build failed
/Users/JohnDoe/Documents/GitHub/spacedrive/core:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @sd/core@0.0.0 codegen: `cargo test && ts-node ./scripts/bindingsIndex.ts`
Exit status 101
@TheUltDev TheUltDev added the kind/bug Something isn't working label Apr 28, 2022
@TheUltDev TheUltDev changed the title Build error on M1 when running pnpm prep [BUG] Build error on M1 when running pnpm prep Apr 28, 2022
@TheUltDev
Copy link
Contributor Author

I fixed it, it was due to M1.

I had to specify x86_64-apple-darwin during rustup-init and add the following to .cargo/config.toml incase anyone else runs into issues.

[target.x86_64-apple-darwin]
rustflags = [
  "-C", "link-arg=-undefined",
  "-C", "link-arg=dynamic_lookup",
]

Rustup init steps:

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>2

I'm going to ask you the value of each of these installation options.
You may simply press the Enter key to leave unchanged.

Default host triple? [aarch64-apple-darwin]
x86_64-apple-darwin

...

Current installation options:
   default host triple: x86_64-apple-darwin
     default toolchain: stable
               profile: default
  modify PATH variable: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant