Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Cannot generate project files on Apple Silicon Macs #71

Closed
3 tasks done
tieleman opened this issue Aug 31, 2021 · 5 comments
Closed
3 tasks done

Cannot generate project files on Apple Silicon Macs #71

tieleman opened this issue Aug 31, 2021 · 5 comments
Labels
mirrored-to-azure Indicates that the github issue has a corresponding ticket in our internal bug-tracking tool.

Comments

@tieleman
Copy link

Describe the bug, issue or concern

On Apple Silicon Macs you cannot generate the project files out-of-the-box. It fails while linking XcodeGen due to an architecture mismatch. This can be worked around by adding the correct architecture in Makefile:

build_xcodegen:
	cd vendor/XcodeGen && swift build -c release -Xswiftc "-target" -Xswiftc "arm64-apple-macosx10.13"

Maybe something like uname -m (will return x86_64 on Intel and arm64 on AS) can be used in the Makefile to insert the correct architecture at run time.

To Reproduce

Steps to reproduce the behavior:

  1. Clone the repo on your M1 Mac (I'm using a Mac mini)
  2. make dev
  3. Wait for XcodeGen to build
  4. See error:
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/CYaml.build/src/api.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/CYaml.build/src/emitter.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/CYaml.build/src/parser.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/CYaml.build/src/reader.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/CYaml.build/src/scanner.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/CYaml.build/src/writer.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/XcodeProjCExt.build/XCPStringEscape.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
ld: warning: ignoring file /Users/tieleman/Documents/Code/nl-covid19-notification-app-ios/vendor/XcodeGen/.build/arm64-apple-macosx/release/XcodeProjCExt.build/XCPHashing.c.o, building for macOS-x86_64 but attempting to link with file built for unknown-arm64
Undefined symbols for architecture x86_64:
  "_XCPComputeMD5", referenced from:
      _$sSS9XcodeProjE3md5SSvgSSSWXEfU_ in String+md5.swift.o
  "_XCPEscapedString", referenced from:

[snip missing symbols]

  "_yaml_stream_start_event_initialize", referenced from:
      _$s4Yams7EmitterC4openyyKF in Emitter.swift.o
ld: symbol(s) not found for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
[17/18] Linking xcodegen
make: *** [build_xcodegen] Error 1

Expected behavior

I'd expect the build to complete so I can run make project.

Governance

@roelspruit
Copy link
Contributor

Hi,

Thanks for the nice catch. As you might have guessed none of the iOS developers in the core team have an M1 Mac yet so we didn't notice.

I see that Xcodegen has been updated with support for building for M1 in their own makefile. I'm going to mirror this ticket on our internal issue board and we can try to upgrade Xcodegen while we're at it. I'll keep this ticket here open as a reference and we'll close it when we're done.

Once again, thanks for the catch and the report!

Roel

@roelspruit roelspruit added the mirrored-to-azure Indicates that the github issue has a corresponding ticket in our internal bug-tracking tool. label Sep 1, 2021
@tieleman
Copy link
Author

tieleman commented Sep 1, 2021

Glad to help! I did update XcodeGen at first to see if that would fix it, but it didn't. However, after fixing the Makefile and updating XcodeGen it does work correctly, so I guess you could update that as well in one go. 👍

@roelspruit
Copy link
Contributor

I updated Xcodegen (and our makefile) in the master branch. Could you try to build this on your AS mac to verify that it works correctly?

@tieleman
Copy link
Author

tieleman commented Sep 3, 2021

Just checked it quickly: XcodeGen will build and the project files can be generated and opened in Xcode.

@roelspruit
Copy link
Contributor

great to hear. Thanks for checking. I'll close this ticket now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
mirrored-to-azure Indicates that the github issue has a corresponding ticket in our internal bug-tracking tool.
Projects
None yet
Development

No branches or pull requests

2 participants