Skip to content

Remove --copy-subdirs from recursive-lipo. #62492

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 5 commits into from
Dec 10, 2022

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Dec 9, 2022

Recursive lipo handles a mix of directories where some subdirectories build only a single slice for the host and other subdirectories build universal binaries (e.g., for a target). The former are lipo'd together, while the latter were copied verbatim.

The --copy-subdirs option indicated that an entire subtree should be copied verbatim, and this was applied to lib/swift to cover all of the target libraries, with single-file exceptions provided by --explicit-src-files. However, this doesn't account for host content under lib/swift that needs to be lipo'd, i.e., the newly-introduced shared libraries in lib/swift/host that are part of host tools.

Remove both --copy-subdirs and --explicit-src-files. Instead, perform the normal recursion into all subdirectories. When there are executable files that aren't identical, check whether they have overlapping architectures: if they don't, lipo them. If they do, take one of
the files because they're considered equivalent. This gives consistent lip behavior for all
executables/shared libraries and also properly assemblies Swift modules from multiple host compiler directories.

Recursive lipo handles a mix of directories where some subdirectories
build only a single slice for the host and other subdirectories build
universal binaries (e.g., for a target). The former are lipo'd
together, while the latter were copied verbatim.

The `--copy-subdirs` option indicated that an entire subtree should be
copied verbatim, and this was applied to `lib/swift` to cover all of
the target libraries, with single-file exceptions provided by
`--explicit-src-files`. However, this doesn't account for host content
under `lib/swift` that needs to be lipo'd, i.e., the newly-introduced
shared libraries in `lib/swift/host` that are part of host tools.

Revise the semantics of `--copy-subdirs`. Instead of copying the entire
directory verbatim, perform the normal recursion into these
subdirectories. When there are executable files that aren't identical,
check whether they have overlapping architectures: if they don't, lipo
them. If they do, and we're in a "copied" subdirectory, take one of
the files because they're considered equivalent. This gives a more
fine-grained semantics to `--copy-subdirs` that allows us to both lipo
executables/shared libraries and also construct Swift modules.
This option has been subsumed by the improved semantics of
`--copy-subdirs`.
We want the `--copy-subdirs` behavior all the time, so remove it as an
option and use the new semantics everywhere.
@DougGregor
Copy link
Member Author

@swift-ci please build toolchain

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please build toolchain

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please build toolchain

@DougGregor DougGregor merged commit 1f3397a into swiftlang:main Dec 10, 2022
@DougGregor DougGregor deleted the recursive-lipo-better branch December 10, 2022 17:34
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.

1 participant