Skip to content

Fix ptrauth C++ module include issue between extern #5212

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
May 13, 2025

Conversation

Kyle-Ye
Copy link
Contributor

@Kyle-Ye Kyle-Ye commented May 11, 2025

Fix “error: import of C++ module 'ptrauth' appears within extern "C" language linkage specification”

LLVM upstream makes ptrauth a module on this commit swiftlang/llvm-project@0481f04.

Swift 6.1 release introduced such change into the toolchain.

Close #5211

Fix “error: import of C++ module 'ptrauth' appears within extern "C" language linkage specification”

LLVM upstream makes  ptrauth  a module on this commit swiftlang/llvm-project@0481f04.

Swift 6.1 release introduced such change into the toolchain.
@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented May 11, 2025

@swift-ci please test

@Kyle-Ye Kyle-Ye requested a review from parkera May 11, 2025 08:58
@parkera
Copy link
Contributor

parkera commented May 12, 2025

Change looks ok, but why did the Linux build fail?

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented May 13, 2025

Failed Tests (1):
swift-package-tests :: test-foundation-package/test-foundation-networking-static-stdlib.test
...
[2025-05-11T11:57:03.604Z] FAIL: swift-package-tests :: test-foundation-package/test-foundation-networking-static-stdlib.test (27 of 39)
[2025-05-11T11:57:03.604Z] ******************** TEST 'swift-package-tests :: test-foundation-package/test-foundation-networking-static-stdlib.test' FAILED ********************
[2025-05-11T11:57:03.604Z] Exit Code: 2
[2025-05-11T11:57:03.604Z] 
[2025-05-11T11:57:03.604Z] Command Output (stdout):
[2025-05-11T11:57:03.604Z] --
[2025-05-11T11:57:03.604Z] # RUN: at line 2
[2025-05-11T11:57:03.604Z] rm -rf /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp
[2025-05-11T11:57:03.604Z] # executed command: rm -rf /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp
[2025-05-11T11:57:03.604Z] # note: command had no output on stdout or stderr
[2025-05-11T11:57:03.604Z] # RUN: at line 3
[2025-05-11T11:57:03.604Z] mkdir -p /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp
[2025-05-11T11:57:03.604Z] # executed command: mkdir -p /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp
[2025-05-11T11:57:03.604Z] # note: command had no output on stdout or stderr
[2025-05-11T11:57:03.604Z] # RUN: at line 4
[2025-05-11T11:57:03.604Z] /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/usr/bin/swiftc -static-stdlib /home/build-user/swift-integration-tests/test-foundation-package/test-foundation-networking.swift -o /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp/test-foundation-networking
[2025-05-11T11:57:03.604Z] # executed command: /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/usr/bin/swiftc -static-stdlib /home/build-user/swift-integration-tests/test-foundation-package/test-foundation-networking.swift -o /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp/test-foundation-networking
[2025-05-11T11:57:03.604Z] # .---command stderr------------
[2025-05-11T11:57:03.604Z] # | /home/build-user/swift-foundation/Sources/FoundationEssentials/Data/Data+Writing.swift:178: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
[2025-05-11T11:57:03.604Z] # `-----------------------------
[2025-05-11T11:57:03.604Z] # RUN: at line 5
[2025-05-11T11:57:03.604Z] /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp/test-foundation-networking | /home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck /home/build-user/swift-integration-tests/test-foundation-package/test-foundation-networking-static-stdlib.test
[2025-05-11T11:57:03.604Z] # executed command: /home/build-user/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/tests/test-foundation-package/Output/test-foundation-networking-static-stdlib.test.tmp/test-foundation-networking
[2025-05-11T11:57:03.604Z] # .---command stderr------------
[2025-05-11T11:57:03.604Z] # | generic witness table at 0x55b011c7d058 contains out-of-bounds requirement descriptor 0x11
[2025-05-11T11:57:03.604Z] # `-----------------------------
[2025-05-11T11:57:03.604Z] # error: command failed with exit status: -6
[2025-05-11T11:57:03.604Z] # executed command: /home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck /home/build-user/swift-integration-tests/test-foundation-package/test-foundation-networking-static-stdlib.test
[2025-05-11T11:57:03.604Z] # .---command stderr------------
[2025-05-11T11:57:03.604Z] # | FileCheck error: '<stdin>' is empty.
[2025-05-11T11:57:03.604Z] # | FileCheck command line:  /home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck /home/build-user/swift-integration-tests/test-foundation-package/test-foundation-networking-static-stdlib.test
[2025-05-11T11:57:03.604Z] # `-----------------------------
[2025-05-11T11:57:03.604Z] # error: command failed with exit status: 2

It looks the CI is emitting an error of generic witness table at 0x55b011c7d058 contains out-of-bounds requirement descriptor 0x11 when running this test case with test-foundation-networking-static-stdlib.test

https://github.com/swiftlang/swift-integration-tests/blob/main/test-foundation-package/test-foundation-networking.swift

https://github.com/swiftlang/swift-integration-tests/blob/main/test-foundation-package/test-foundation-networking-static-stdlib.test

Let's rerun the CI again. And if the error still occur, I'll try to reproduce it locally or ask help from the test case author @kateinoigakukun.

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented May 13, 2025

@swift-ci please test linux

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented May 13, 2025

#5207 's Linux test also fail for the same failure reason.

I highly suspect this is a upstream issue. And it is not related with this PR or #5207.

Do you know who is responsible for fixing this CI issue? @parkera

@parkera parkera merged commit 873a14c into swiftlang:main May 13, 2025
1 of 2 checks passed
@Kyle-Ye Kyle-Ye deleted the fix/ptrauth branch May 14, 2025 07:33
Kyle-Ye added a commit to Kyle-Ye/swift-corelibs-foundation that referenced this pull request May 14, 2025
Fix “error: import of C++ module 'ptrauth' appears within extern "C" language linkage specification”

LLVM upstream makes  ptrauth  a module on this commit swiftlang/llvm-project@0481f04.

Swift 6.1 release introduced such change into the toolchain.
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.

ptrauth module include issue for Swift 6.1 release
2 participants