SE-0271: Package Manager Resources

  • What is your evaluation of the proposal?
    • +1
  • Is the problem being addressed significant enough to warrant a change to the Swift Package Manager?
    • definitely
  • Does this proposal fit well with the feel and direction of Swift?
    • yes
  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
    • I followed the pitch and gave the proposal a quick reading
1 Like

The review of SE-0271: Package Manager Resources ran from November 12th through November 19th, 2019. The proposal is accepted with modifications.

Thanks to everyone who participated!

Boris Buegling
Review Manager

11 Likes

:crossed_fingers: this gets fully implemented and integrated very quickly.

8 Likes

Any update here? I've been rearchitecting some modules into swift packages but I really need support for asset catalogs and font files to complete the migration. I'm more than willing to assist with the implementation if there are some clear specs or guidance available for what we're looking for here.

Thanks!

1 Like

This proposal has been implemented and will be available in the next major Swift release after 5.2.

25 Likes

Does it mean that it will be available only in September? I mean it is very unlikely that Swift 6.0 (the next major release?) will make it to Xcode 11.x, or is there still a chance to see the feature before this summer?

Based only on the history of Swift and Xcode releases over at least the last three years, I would imagine the next release of Swift after 5.2 will be alongside a new version of Xcode in September.

2 Likes

That's likely going to be Swift 5.3 with Xcode 12. We're too far away from Swift 6 I think.

2 Likes

It’s just a tool update, so theoretically, it wouldn’t need to coincide with any OS update.

It’s up to Apple if they feel it’s worth releasing another interim XCode update. Perhaps if the community demand is strong, they might be persuaded to do it :man_shrugging:

Sure, but we're literally run out of time for that to happen before WWDC. And as history showed us, there was no new Xcode with a different Swift version released in between WWDC and the fall.

2 Likes

Then again, there might not be a WWDC this year...

I doubt that Apple won‘t even make everything virtual and prepare video sessions.

That release will be Swift 5.3. A release process blog post with branching schedule will be going up shortly.

32 Likes

Awesome news. This is the only thing preventing my company from moving to SPM.

1 Like

Is this usable now via Xcode importing a 5.3 Developer Snapshot? My mild experimentation says, "No" but greater minds than mine are abundant here!

As far as I can tell it is not. In my past experience, Xcode has never used the installed toolchain in the "Resolve Swift Packages" step, which is a little annoying. I filed FB7691693 suggesting that it would be good to have Xcode use the chosen toolchain to resolve swift packages.

To get resources working, I used Docker and the latest nightly Swift 5.3 image. If you have Docker installed and running, you can run swift test using the following script in your package directory:

docker run \
    --rm \
    --volume "$PWD:/package" \
    --workdir "/package" \
    swiftlang/swift:nightly-5.3 \
    /bin/bash \
    -c "swift test --build-path ./.build/linux"

(Hat tip to @samdeane for the original script.)

2 Likes

This is correct, the toolchain is only used to find the used compiler, linker, etc -- but we are not loading libSwiftPM from there. Only the built-in one is being used.

I'm trying it with Xcode 12 on mac and with swift 5.3 dev snapshot on linux. I'm using proposal itself as a documentation.

it works, tho i was very much confused on the usage. root directory for lookup is Sources/ProductName (if configured with default sources location). and from what I see in my tests you can not place any resource outside that directory - switpm just ignores that configuration

1 Like

That's correct, resources work very much like sources in that regard.

Is the Bundle.module implemented as of Xcode 12 beta 1 ?