Skip to content

Frontend: add an additional search path for swift modules #42419

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
Apr 18, 2022

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Apr 17, 2022

This setups the frontend to search both an architecture suffixed and
unsuffixed path. This improves the multi-architecture setup for
Windows, enabling it use the directory form of the swift modules with
the architectures overlaying in the swift module and leaving the arch
suffixed directory for the import libraries.

This can be fully generalized as this also enables Linux to use the
multi-architecture search path for the swift modules enabling it to
eventually adopt a SDK model as well.

This setups the frontend to search both an architecture suffixed and
unsuffixed path.  This improves the multi-architecture setup for
Windows, enabling it use the directory form of the swift modules with
the architectures overlaying in the swift module and leaving the arch
suffixed directory for the import libraries.

This can be fully generalized as this also enables Linux to use the
multi-architecture search path for the swift modules enabling it to
eventually adopt a SDK model as well.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please build toolchain windows platform

compnerd added a commit to compnerd/swift-installer-scripts that referenced this pull request Apr 18, 2022
Adjust the location of the swift modules to overlap across SDKs.  The
directory form of the swift module can easily overlap and co-exist.  Now
that the driver has learnt to scan the non-architecture dependent location
in addition to the architecture location dependent path, we can unify
the swiftmodule content in the SDK to a simpler layout.  The layout now
is:

~~~
SDKROOT
  `- usr
      `- lib
          `- swift
              `- [platform]
                  +- [module].swiftmodule
                  |   `- [triple].{swiftdoc,swiftmodule,swiftinterface}
                  `- [arch]
                      `- [import library]
~~~

On Windows, it would be preferable to further remove the intermediate
platform as we have that information earlier in the path.

Subsequent work remains to now ensure that the package manager will
similarly allow the XCTest swift modules to collapse.

While in theory it is possible to create a multi-architecture import
library, it is valuable to support user-selectable SDK installation
which requires that the we create the import libraries on the fly for
the selected architectures.  It is more convenient from a distribution
perspective to simply make the content static and as such continue to
use the architect dependent directory for the import library unlike the
swift module.

This is dependent on swiftlang/swift#42419.
compnerd added a commit to compnerd/swift-driver that referenced this pull request Apr 18, 2022
Now that the frontend properly consults the architecture independent
path for the Swift modules, we can address the TODO that was left to
be addressed.  This requires swiftlang/swift#42419 and
swiftlang/swift-installer-scripts#119
@compnerd compnerd merged commit c3529ef into swiftlang:main Apr 18, 2022
@compnerd compnerd deleted the unarch-search branch April 18, 2022 23:25
compnerd added a commit to swiftlang/swift-installer-scripts that referenced this pull request Apr 18, 2022
Adjust the location of the swift modules to overlap across SDKs.  The
directory form of the swift module can easily overlap and co-exist.  Now
that the driver has learnt to scan the non-architecture dependent location
in addition to the architecture location dependent path, we can unify
the swiftmodule content in the SDK to a simpler layout.  The layout now
is:

~~~
SDKROOT
  `- usr
      `- lib
          `- swift
              `- [platform]
                  +- [module].swiftmodule
                  |   `- [triple].{swiftdoc,swiftmodule,swiftinterface}
                  `- [arch]
                      `- [import library]
~~~

On Windows, it would be preferable to further remove the intermediate
platform as we have that information earlier in the path.

Subsequent work remains to now ensure that the package manager will
similarly allow the XCTest swift modules to collapse.

While in theory it is possible to create a multi-architecture import
library, it is valuable to support user-selectable SDK installation
which requires that the we create the import libraries on the fly for
the selected architectures.  It is more convenient from a distribution
perspective to simply make the content static and as such continue to
use the architect dependent directory for the import library unlike the
swift module.

This is dependent on swiftlang/swift#42419.
compnerd added a commit to swiftlang/swift-installer-scripts that referenced this pull request Jun 4, 2022
Adjust the location of the swift modules to overlap across SDKs.  The
directory form of the swift module can easily overlap and co-exist.  Now
that the driver has learnt to scan the non-architecture dependent location
in addition to the architecture location dependent path, we can unify
the swiftmodule content in the SDK to a simpler layout.  The layout now
is:

~~~
SDKROOT
  `- usr
      `- lib
          `- swift
              `- [platform]
                  +- [module].swiftmodule
                  |   `- [triple].{swiftdoc,swiftmodule,swiftinterface}
                  `- [arch]
                      `- [import library]
~~~

On Windows, it would be preferable to further remove the intermediate
platform as we have that information earlier in the path.

Subsequent work remains to now ensure that the package manager will
similarly allow the XCTest swift modules to collapse.

While in theory it is possible to create a multi-architecture import
library, it is valuable to support user-selectable SDK installation
which requires that the we create the import libraries on the fly for
the selected architectures.  It is more convenient from a distribution
perspective to simply make the content static and as such continue to
use the architect dependent directory for the import library unlike the
swift module.

This is dependent on swiftlang/swift#42419.
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