Skip to content

Don't build and install libcxx when generating a macOS toolchain #64687

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

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Mar 28, 2023

Libcxx is already part of the macOS SDKs shipped since Xcode 12.5, so there is no need for us to rebuild it.
This will also prevent compilation issues in the presets that builds the standard library using a prebuilt toolchain, so the clang compiler that ships in that toolchain does not pickup libcxx headers that do not match the tbd shipped in the underlying macOS SDK.

This change would be desirable for all macOS presets, focusing for now on the toolchain presets.

Addresses rdar://106817494

Libcxx is already part of the macOS SDKs shipped since Xcode 12.5, so
there is no need for us to rebuild it.
This will also prevent compilation issues in the presets that builds the
standard library using a prebuilt toolchain, so the clang compiler that
ships in that toolchain does not pickup libcxx headers that do not
match the tbd shipped in the underlying macOS SDK.

This change would be desirable for all macOS presets, focusing for now
on the toolchain presets.

Addresses rdar://106817494
@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2023

@swift-ci please test

@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2023

@swift-ci please build toolchain

@compnerd
Copy link
Member

I don't have any objections to the removal, but I am concerned that this might break the build. The LLDB builds and tests require that libc++ is built in order to test. Does this not impact that?

edymtt added a commit to edymtt/swift that referenced this pull request Mar 28, 2023
Libcxx is already part of the macOS SDKs shipped since Xcode 12.5, so
there is no need for us to rebuild it.
This will also prevent compilation issues in the presets that builds the
standard library using a prebuilt toolchain, so the clang compiler that
ships in that toolchain does not pickup libcxx headers that do not
match the tbd shipped in the underlying macOS SDK.

This change would be desirable for all macOS presets, focusing for now
on the toolchain presets.

Addresses rdar://106817494

(cherry picked from commit 310082b, swiftlang#64687)
@edymtt
Copy link
Contributor Author

edymtt commented Mar 28, 2023

From what I can tell, it should not:

.../build-script --lldb --release --test -- --skip-build-benchmarks --no-swift-stdlib-assertions --lldb-use-system-debugserver --lldb-build-with-cmake --skip-test-swift --skip-test-cmark --cmake-c-launcher /usr/local/bin/sccache --cmake-cxx-launcher /usr/local/bin/sccache

That suggests to me that they already pulling libcxx content from the underlying macOS SDK

  • the change is only limited to the toolchain presets, whose products are used in a couple jobs in CI that build the stdlib with a prebuilt compiler

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@etcwilde
Copy link
Member

macOS failure:

macos-node-i-047f115b1a70a615a was marked offline: Connection was broken: java.io.EOFException

@edymtt
Copy link
Contributor Author

edymtt commented Mar 29, 2023

@swift-ci please test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Mar 29, 2023

Hit unrelated issue when running swiftpm tests

/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/lib/swift/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface:4:8: error: no such module 'Combine'
import Combine
       ^

@edymtt
Copy link
Contributor Author

edymtt commented Mar 29, 2023

@swift-ci please test macOS

@edymtt
Copy link
Contributor Author

edymtt commented Mar 30, 2023

Hitting another unrelated issue in https://ci.swift.org/job/swift-PR-macos/7344

/Users/ec2-user/jenkins/workspace/swift-PR-macos/branch-main/swift/SwiftCompilerSources/Sources/SIL/Function.swift:83:41: error: value of type 'BridgedFunction' has no member 'getSILResultType'
  public var resultType: Type { bridged.getSILResultType().type }
                                ~~~~~~~ ^~~~~~~~~~~~~~~~
/Users/ec2-user/jenkins/workspace/swift-PR-macos/branch-main/swift/include/swift/SIL/SILBridging.h:218:18: note: function uses foreign reference type 'SILType' as a value in the return types which breaks 'import_reference' contract (outlined in C++ Interop User Manual).
  swift::SILType getSILResultType() const {
                 ^
Assertion failed: (methodSemantics == CxxRecordSemanticsKind::UnsafePointerMember), function diagnoseUnsafeCxxMethod, file CSDiagnostics.cpp, line 3958.

@edymtt
Copy link
Contributor Author

edymtt commented Mar 30, 2023

@swift-ci please test macOS

@shahmishal shahmishal merged commit 25bceb1 into swiftlang:main Mar 31, 2023
@edymtt edymtt deleted the no-libcxx-in-macos-toolchains branch March 31, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants