Error running build-script: "No architectures to compile for"

Hi all,

I'm having problems building the compiler from the master branch. I started running ./swift/utils/update-checkout --clone-with-ssh, which worked fine. Then tried building using

./utils/build-script  --xcode --release-debuginfo  --force-optimized-typechecker --swift-assertions --skip-build-benchmark

which is the command I normally use, except this time it failed with an error:

=== BUILD TARGET llvm-PerfectShuffle OF PROJECT LLVM WITH CONFIGURATION RelWithDebInfo ===

Check dependencies

=== BUILD TARGET count OF PROJECT LLVM WITH CONFIGURATION RelWithDebInfo ===

Check dependencies

=== BUILD AGGREGATE TARGET compiler-rt-headers OF PROJECT LLVM WITH CONFIGURATION RelWithDebInfo ===

Check dependencies

=== BUILD TARGET clang_rt.cc_kext_x86_64_osx OF PROJECT LLVM WITH CONFIGURATION RelWithDebInfo ===

Check dependencies

=== BUILD TARGET clang_rt.builtins_x86_64h_osx OF PROJECT LLVM WITH CONFIGURATION RelWithDebInfo ===

Check dependencies
No architectures to compile for (ARCHS=x86_64h, VALID_ARCHS=i386 x86_64).

** BUILD FAILED **


The following build commands failed:
	Check dependencies
(1 failure)
./utils/build-script: fatal error: command terminated with a non-zero exit status 65, aborting

I also tried running a clean build (with --clean) but got the same results. Does anyone have a clue as to what's going on?

(I'm on macOS 10.15.1, 15 inch MBP mid 2015)

2 Likes

I'm running into the same exact problem. I've also tried re-building from step one (deleting everything and starting over). I'm also on a 15inch MBP mid 2015, but MacOS 10.14.5.

I suspect this may be an issue with LLVM. I also tried building with xcodebuild and overriding the architecture but, that just deferred a similar linking error.

1 Like

This is a terrible hack and only partially works but if you only need to generate the xcode project you can:

  • Run build-script -x to start building. It will fail.
  • Go into llvm-macosx-x86_64 and run xcodebuild build -arch "x86_64" VALID_ARCHS="i368 x86_64 x86_64h". This will also fail with the message libtool: no library created (no object files in input files matching -arch_only x86_64). Above the error is the command it ran (something like /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64...libclang_rt.builtins_x86_64h_osx.a).
  • Run that command again but change -arch_only x86_64 to -arch_only x86_64h.
  • Run build-script -x --skip-build-llvm
  • You will run into linker errors but you can at least use xcode to edit/debug the project.
1 Like

I having the same issue with Xcode at this week.

git log --pretty=format: --name-only --since="5 days ago" | sort | uniq

It turned out that new changes to https://github.com/apple/swift/commits/master/utils/build-script-impl affected build.
To fix build you can simply revert it to this commit https://github.com/apple/swift/commit/2978884fc0e375d3252f4dd1cb5df70a4b1c9618#diff-65b44eb6cb88af2161d8e1176231aad0. I am not very familiar with build system so to fix it properly it will require further investigation. Hope that helps.

1 Like

Thanks for the help, building without --xcode worked fine. I hope this gets fixed soon, I'm kinda lost without it...

This is unfortunate. I just cloned master at

d2e1f0916976583e6bba20cf550b9d9cfdb62612 (tag: swift-DEVELOPMENT-SNAPSHOT-2019-11-22-a)

and ran into a different issue

=== BUILD TARGET clang_rt.builtins_i386_osx OF PROJECT LLVM WITH CONFIGURATION RelWithDebInfo ===

Check dependencies
error: The i386 architecture is deprecated. You should update your ARCHS build setting to remove the i386 architecture.
** BUILD FAILED **


The following build commands failed:
        Check dependencies

Instead, if I try build checkout out the tag swift-DEVELOPMENT-SNAPSHOT-2019-11-20-a, that seems to work. You can do that using

utils/update-checkout --tag swift-DEVELOPMENT-SNAPSHOT-2019-11-20-a
git checkout swift-DEVELOPMENT-SNAPSHOT-2019-11-20-a

(Note that there is no "5.1" in the tag name.)

That seems to work ok. Hope that helps!

1 Like

I'm also seeing these issues on swift-DEVELOPMENT-SNAPSHOT-2019-11-24-a when using --xcode on 10.15.1 with Xcode 11.2.1 (11B500, from the App Store).

Yep. That's pretty close to what master is at (which is giving trouble); that's why I recommended switching to a slightly older "known good" tag so you can get your tasks done without getting blocked.

Yes, that was master as of writing (thought it'd be more helpful for future references, as the posts were for me).

The tag you proposed did indeed not show the issue! Thanks. :slight_smile:

1 Like

It would be great to get this resolved on master. I spent a bit of time trying to fix it, but I don't know enough about the build system. @xiaodai any ideas?

Edit: forgot master was locked this week.

I have the same issue and I've filed a bug report https://bugs.swift.org/browse/SR-11880

1 Like

The fix is merged into the master branch.

3 Likes

Fantastic! Thank you so much.

Terms of Service

Privacy Policy

Cookie Policy