Skip to content

Move API notes out of the arch-specific subdirectories in lib/swift/ #21690

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
Jan 9, 2019

Conversation

jrose-apple
Copy link
Contributor

They're all the same anyway, and no longer even need to be compiled, just copied in as text.

And drastically simplify how we "generate" them. Instead of attaching their build jobs to the appropriate overlays, if present, "just" have one job to copy them all and attach it to the Darwin overlay. That's what we do for the overlay shim headers, and it's good enough. (Eventually we want to get out of the business of shipping them altogether.)

This does have the same flaw as the shim headers: if you just change API notes, the corresponding overlay does not get rebuilt. You have to touch that too. But in practice that'll happen most of the time anyway.

Part of rdar://problem/43545560

@jrose-apple
Copy link
Contributor Author

@swift-ci Please clean test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This is so much simpler, thank you!

"${CMAKE_CURRENT_SOURCE_DIR}/${input}"
"${output_dir}/${input}"
COMMAND
"${CMAKE_COMMAND}" "-E" "touch" "${output_dir}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, this copy/touch dance is me trying and failing to overcome the limitation I talked about in the description. I'll put it back to copy_if_different when the full tests pass.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please Build Toolchain macOS Platform

@swift-ci
Copy link
Contributor

swift-ci commented Jan 8, 2019

macOS Toolchain
Download Toolchain
Git Sha - 4fa2e364b20a8d8f65ee04a21dc690e0e9543564

Install command
tar -zxf swift-PR-21690-154-osx.tar.gz --directory ~/

@jrose-apple
Copy link
Contributor Author

Hm, turns out it's a good thing I built the Linux toolchain by accident too: this new logic copies the apinotes/ directory into Linux toolchains too, which is unnecessary.

"${CMAKE_CURRENT_SOURCE_DIR}/${input}"
"${output_dir}/${input}"
COMMENT "Copying ${input} to ${output_dir}")
list(APPEND outputs "${output_dir}/${input}")
endforeach()
Copy link
Member

Choose a reason for hiding this comment

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

I believe that we have a new enough CMake to avoid this. Please use a single command (${CMAKE_COMMAND_} -E copy_if_different ${sources} ${output_dir}/)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way allows CMake/Ninja to only copy the files that changed, but I guess copy_if_different will already do that, and N is very small.

They're all the same anyway, and no longer even need to be compiled,
just copied in as text.

And drastically simplify how we "generate" them. Instead of attaching
their build jobs to the appropriate overlays, if present, "just" have
one job to copy them all and attach it to the Darwin overlay. That's
what we do for the overlay shim headers, and it's good enough.
(Eventually we want to get out of the business of shipping them
altogether.)

This does have the same flaw as the shim headers: if you /just/ change
API notes, the corresponding overlay does not get rebuilt. You have to
touch that too. But in practice that'll happen most of the time
anyway.

Part of rdar://problem/43545560
@jrose-apple
Copy link
Contributor Author

@swift-ci Please build toolchain

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple merged commit aea1ef8 into swiftlang:master Jan 9, 2019
@jrose-apple jrose-apple deleted the hemidemisemiquavers branch January 9, 2019 22:06
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