Skip to content

Add _getMetadataSection{,Count,Name} to API digester allow list #33138

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
Jul 28, 2020

Conversation

vedantk
Copy link
Contributor

@vedantk vedantk commented Jul 27, 2020

These APIs facilitate building SwiftReflectionTest.swift when testing Release builds.

rdar://66103895

@vedantk
Copy link
Contributor Author

vedantk commented Jul 27, 2020

@swift-ci smoke test

@vedantk
Copy link
Contributor Author

vedantk commented Jul 27, 2020

@vedantk
Copy link
Contributor Author

vedantk commented Jul 27, 2020

See non-asserts build failure here: https://ci.swift.org/job/oss-swift-package-osx/5007/consoleText

@augusto2112
Copy link
Contributor

augusto2112 commented Jul 27, 2020

@vedantk I think this will fail to build in Linux release builds, because of the SwiftReflectionTest.swift, which refers to those symbols, is built even on release (which was the reason I had to leave the symbols in release builds in the first place). Possible solutions would be:

  • Change the stability-stdlib-abi-without-asserts.test like we did stability-stdlib-abi-with-asserts.test
  • In SwiftReflectionTest.swiftcheck for INTERNAL_CHECKS_ENABLED, and if not, have dummy implementations of getReflectionInfoForImage and getImageCount
  • Change the CMakeLists so SwiftReflectionTest.swift isn't built on release in Linux after all.

@vedantk vedantk changed the title Hide _getMetadataSection{,Count,Name} reflection APIs in non-asserts … Add _getMetadataSection{,Count,Name} to API digester allow list Jul 27, 2020
@vedantk
Copy link
Contributor Author

vedantk commented Jul 27, 2020

@swift-ci smoke test

@vedantk
Copy link
Contributor Author

vedantk commented Jul 27, 2020

git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!

@vedantk
Copy link
Contributor Author

vedantk commented Jul 28, 2020

@swift-ci smoke test OS X platform

@augusto2112
Copy link
Contributor

augusto2112 commented Jul 28, 2020

@vedantk it seems like someone added that #if INTERNAL_CHECKS_ENABLED check, but that indeed broke it when stdlib assertions are off (see here). Maybe you could remove that in your PR since you're solving the same issue?

@augusto2112
Copy link
Contributor

Also, I'm not sure why it's failing to build on OS X now. It looks like stability-stdlib-abi-with-asserts.test is complaining that we added the 3 functions for some reason?

There are these two lines in stability-stdlib-abi-with-asserts.test:

// RUN: %clang -E -P -x c %S/stability-stdlib-abi-without-asserts.test -o - > %t.tmp/stability-stdlib-abi.swift.expected
// RUN: %clang -E -P -x c %S/stability-stdlib-abi-with-asserts.test -o - >> %t.tmp/stability-stdlib-abi.swift.expected

My guess is that we're adding our functions twice to the list, and that's why it's failing (I'm not 100% sure on this though)

@vedantk
Copy link
Contributor Author

vedantk commented Jul 28, 2020

It looks @natecook1000 and I both tried to address the issue by removing these APIs in non-asserts builds (Nate's change is 014918c).

@vedantk
Copy link
Contributor Author

vedantk commented Jul 28, 2020

@swift-ci smoke test

These APIs are needed to build SwiftReflectionTest.swift when testing
Release builds.

This rolls back 014918c, which hid these APIs in non-asserts builds
causing a failure:

  https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/5708/consoleText

rdar://66103895
@vedantk
Copy link
Contributor Author

vedantk commented Jul 28, 2020

@swift-ci smoke test

@vedantk vedantk merged commit 2308bb1 into swiftlang:master Jul 28, 2020
@vedantk vedantk deleted the hide-refl-apis branch July 28, 2020 22:19
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.

2 participants