Skip to content

[armv7] Fix static-vtable-stubs test for 32-bit platforms #70929

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 2 commits into from
Jan 19, 2024

Conversation

finagolfin
Copy link
Member

@aschwaighofer, what do you think of the test fix? It fixed the last remaining broken test on the community CI for Android armv7, when I tried it locally. Maybe @cachemeifyoucan can check if it fixes the other internal 32-bit CI that he disabled too, that I re-enabled here.

Also, fix an issue with building a standalone stdlib on linux, as that's how I ran this test. @bnbarham, building a standalone stdlib has been broken on linux since late last year, as this CMake portion sets the bootstrap mode to HOSTTOOLS, which then triggers this stdlib CMake block that fails because the compiler isn't being built for a standalone stdlib.

Instead, the SWIFT_INCLUDE_TOOLS check I added here makes sure BOOTSTRAPPING_MODE is kept at its default of OFF, getting the standalone stdlib build working again. The standalone stdlib CI preset didn't catch this linux issue because it only runs on macOS.

@aschwaighofer
Copy link
Contributor

The 32 bit looks fine to me. We can disable again if it turns out our internal bots dislike it.

I don't feel qualified to judge the CMake change. Maybe the CMake change should be a separate PR?

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

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

The test fix LGTM. I don't have much to say about the test (it was a regression from my test infrastructure fix).

@finagolfin
Copy link
Member Author

Thanks for reviewing the test fix, guys, once @bnbarham or some other CMake adept reviews that change, we can get this in.

Can someone run the CI in the meantime?

@rintaro
Copy link
Member

rintaro commented Jan 17, 2024

this CMake portion sets the bootstrap mode to HOSTTOOLS, which then triggers this stdlib CMake block that fails because the compiler isn't being built for a standalone stdlib.

Sorry I don't really understand how it fails. This block only sets LD_LIBRARY_PATH to ${CMAKE_Swift_COMPILER}'s resource directory which I think is not harmful. How does it fail exactly?

@rintaro
Copy link
Member

rintaro commented Jan 17, 2024

preset=stdlib_RA_standalone,build
@swift-ci Please test with preset Linux

@finagolfin
Copy link
Member Author

How does it fail exactly?

Here is the exact error:

-- Using clang Resource Directory: /home/finagolfin/swift-DEVELOPMENT-SNAPSHOT-2024-01-07-a-ubuntu20.04/usr/lib/clang/17
CMake Error at cmake/modules/SwiftUtils.cmake:116 (get_filename_component):
  get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
  stdlib/cmake/modules/SwiftSource.cmake:861 (get_bootstrapping_swift_lib_dir)
  stdlib/cmake/modules/SwiftSource.cmake:137 (_compile_swift_files)
  stdlib/cmake/modules/AddSwiftStdlib.cmake:976 (handle_swift_sources)
  stdlib/cmake/modules/AddSwiftStdlib.cmake:2272 (add_swift_target_library_single)
  stdlib/public/Cxx/CMakeLists.txt:9 (add_swift_target_library)


-- Configuring incomplete, errors occurred!
ERROR: command terminated with a non-zero exit status 1, aborting

Obviously, once this CMake fix checks if the host tools are not being built, the bootstrapping mode is kept to its default of "off" and the stdlib CMake block is avoided altogether.

preset=stdlib_RA_standalone,build

The linux CI preset attempted appears to be broken, as it doesn't pass in a prebuilt toolchain.

@finagolfin
Copy link
Member Author

@kateinoigakukun, would you run the CI here?

@kateinoigakukun
Copy link
Member

@swift-ci Please smoke test

@finagolfin
Copy link
Member Author

@rintaro, passed CI and test was reviewed, just needs approval on the CMake fix and this can go in.

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

I see, CMAKE_Swift_COMPILER is apparently not set in this scenario. I'm still not sure this is the correct fix, but I understand this resolves the current issue.

@rintaro rintaro merged commit 0842787 into swiftlang:main Jan 19, 2024
@finagolfin finagolfin deleted the arm branch January 19, 2024 05:40
@finagolfin
Copy link
Member Author

@rintaro, couple different ways to fix this, this was the easiest. I thought about fixing it in build-script, but build-swift-tools configured by the standalone preset is only set in the bash script build-script-impl while build_early_swiftsyntax is a Python build-script variable, so the two would have to be compared in the bash script. Since we are trying to get rid of the bash script, not add to it, I added this check here instead. If you would like to handle it some other way, would be glad to test and review your subsequent pull.

@cachemeifyoucan, let us know if this causes any problems on the other 32-bit CI.

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.

5 participants