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

CMake error when running build-script with --xcode #62645

Closed
whiteio opened this issue Dec 16, 2022 · 8 comments · Fixed by #62659
Closed

CMake error when running build-script with --xcode #62645

whiteio opened this issue Dec 16, 2022 · 8 comments · Fixed by #62659
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build error Errors when building the toolchain, not regular Swift code build build-script Area → utils: The build script generated Xcode project utils Area: the build system and other accessory scripts under the "utils" directory

Comments

@whiteio
Copy link
Contributor

whiteio commented Dec 16, 2022

Description

Build script fails on running:

utils/build-script --skip-build-benchmarks --skip-ios \
   --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
   --swift-disable-dead-stripping --release-debuginfo --xcode --clean

This issue appears to be similar to the issue discussed in #62205

Steps to reproduce

  1. Checkout main: utils/update-checkout --scheme main (current revision: 244ca4e)
  2. Run the build script using the following command:
utils/build-script --skip-build-benchmarks --skip-ios \
   --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
   --swift-disable-dead-stripping --release-debuginfo --xcode --clean

There following errors occur, 4 times each:

CMake Error in lib/ASTGen/CMakeLists.txt:
  Imported target "SwiftSyntax::SwiftBasicFormat" includes non-existent path

    "/Users/whiteio/Development/swift-project/build/Xcode-RelWithDebInfoAssert/earlyswiftsyntax-macosx-arm64/lib/swift/host"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.
CMake Error in lib/Parse/CMakeLists.txt:
  Imported target "SwiftSyntax::SwiftBasicFormat" includes non-existent path

    "/Users/whiteio/Development/swift-project/build/Xcode-RelWithDebInfoAssert/earlyswiftsyntax-macosx-arm64/lib/swift/host"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

Expected behavior

It should successfully build and create the Xcode projects.

Environment

swift-driver version: 1.62.15
Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
Target: arm64-apple-macosx12.0

Xcode 14.1
Build version 14B47b

@whiteio whiteio added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Dec 16, 2022
@michaeleisel
Copy link

I see this behavior as well

@LucianoPAlmeida LucianoPAlmeida added compiler The Swift compiler itself build-script Area → utils: The build script build build error Errors when building the toolchain, not regular Swift code and removed triage needed This issue needs more specific labels labels Dec 17, 2022
@LucianoPAlmeida
Copy link
Contributor

Ok I just faced this as well, what happens is that this is a failure is a dependency package that is required when building is missing. Dependencies are fetched when we run ./utils/update-checkout --clone so if new dependency paths are introduced we would need to run it again to force the fetch of recent introduced things.
TL;DR : Run ./utils/update-checkout --clone and re-run build-script ideally with --clean.
This should fix the issue

@AnthonyLatsis AnthonyLatsis added generated Xcode project and removed compiler The Swift compiler itself labels Dec 17, 2022
@AnthonyLatsis
Copy link
Collaborator

@LucianoPAlmeida Did this actually work for you? I don‘t see any new repos in the update-checkout config either.

@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Dec 17, 2022

@DougGregor Could you take a look at this, please? I think it was #62326. I have no idea what exactly broke the build, but we probably should make --xcode imply --skip-early-swiftsyntax in addition to --skip-early-swift-driver, since we can use their respective package files to work in Xcode instead.

@LucianoPAlmeida
Copy link
Contributor

@LucianoPAlmeida Did this actually work for you? I don‘t see any new repos in the update-checkout config either.

Yes, when I saw the error the idea was update dependencies with new changes either existing dependencies or fetch new added if there are any.
Maybe --clone wasn't needed and the fix is just to fetch new changes in existing repos... but I had in my mind that --clone force fetch updates on existing repos so I always go with it when updating checkout.

@whiteio
Copy link
Contributor Author

whiteio commented Dec 17, 2022

Ok I just faced this as well, what happens is that this is a failure is a dependency package that is required when building is missing. Dependencies are fetched when we run ./utils/update-checkout --clone so if new dependency paths are introduced we would need to run it again to force the fetch of recent introduced things. TL;DR : Run ./utils/update-checkout --clone and re-run build-script ideally with --clean. This should fix the issue

This didn't resolve the issue for me.

@MikePendo
Copy link

I have run the build with --clean and still had it

@AnthonyLatsis
Copy link
Collaborator

Workaround: pass --skip-early-swiftsyntax.

@AnthonyLatsis AnthonyLatsis added the utils Area: the build system and other accessory scripts under the "utils" directory label Jul 13, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build error Errors when building the toolchain, not regular Swift code build build-script Area → utils: The build script generated Xcode project utils Area: the build system and other accessory scripts under the "utils" directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants