Skip to content
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

[5.1] Module filename and location changes #23021

Merged
merged 8 commits into from Mar 2, 2019

Conversation

Projects
None yet
3 participants
@brentdax
Copy link
Collaborator

brentdax commented Mar 1, 2019

This PR cherry-picks changes from three PRs to swift-5.1-branch:

  • #21797 On Apple platforms, use swiftmodule directories for the stdlib
  • #22907 [test] Fix loaded_module_trace.swift for arch's that sort before "M"
  • #22842 Name platform-specific module files using a normalized target triple

Collectively, they rearrange the standard library and overlay modules to be laid out more like ordinary modules and add support for new target-specific module filenames.

@brentdax

This comment has been minimized.

Copy link
Collaborator Author

brentdax commented Mar 1, 2019

@swift-ci please test

jrose-apple and others added some commits Feb 19, 2019

On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
[NFC] Clean up module name pairs
Create a helper type to represent the .swiftmodule/.swiftdoc filename pair and use it in SerializedModuleLoaderBase::findModule().
[NFC] Generalize target-specific module loading…
…from 1-2 target-specific names to 0-N target-specific names.
Use target triple for “universal” modules
When loading a module supporting multiple targets, the module loader now looks for a file named with a normalized version of the target triple first, and only falls back to the architecture name if the normalized triple is not found.
[NFC] Restyle getTargetSpecificModuleTriple()
* Adds documentation comments.
* Turns redundant cases into comments.
* Removes the else branch in a couple “if (…) return …; else return …;” patterns.
[test] Fix loaded_module_trace.swift for arch's that sort before "M" (#…
…22907)

This field is reverse-path-sorted, so the order depends on what
architecture we're compiling for. That's not what's being tested,
so just use a CHECK-DAG.

rdar://problem/48377454
@brentdax

This comment has been minimized.

Copy link
Collaborator Author

brentdax commented Mar 1, 2019

Looks like I resolved a merge conflict in one of the tests incorrectly. Force-pushing a corrected version.

@brentdax brentdax force-pushed the brentdax:target-practice-5.1 branch from 44974c2 to 353179a Mar 1, 2019

@brentdax

This comment has been minimized.

Copy link
Collaborator Author

brentdax commented Mar 1, 2019

@swift-ci please test

@swift-ci

This comment was marked as off-topic.

Copy link
Contributor

swift-ci commented Mar 1, 2019

Build failed
Swift Test Linux Platform
Git Sha - 44974c2

@swift-ci

This comment has been minimized.

Copy link
Contributor

swift-ci commented Mar 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - 44974c2

@brentdax

This comment has been minimized.

Copy link
Collaborator Author

brentdax commented Mar 1, 2019

@swift-ci please test OS X platform

@swift-ci

This comment was marked as off-topic.

Copy link
Contributor

swift-ci commented Mar 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - 44974c2

@brentdax brentdax merged commit b89b723 into apple:swift-5.1-branch Mar 2, 2019

4 checks passed

Swift Test Linux Platform No test results found.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform No test results found.
Details
Swift Test OS X Platform (smoke test)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.