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

SortedCollections is missing is when using fixed versions #425

Closed
2 tasks done
ArtemBurmistrov opened this issue Oct 17, 2024 · 5 comments
Closed
2 tasks done

SortedCollections is missing is when using fixed versions #425

ArtemBurmistrov opened this issue Oct 17, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ArtemBurmistrov
Copy link

When using this package as a dependency with a fixed version, the SortedCollection target (and the actual directory in the Sources directory) is missing. If the main branch is used instead – everything works as expected.

Information

  • Package version: 1.1.x tags and the main branch
  • Platform version: macOS 14.6.1
  • Swift version: swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4) Target: arm64-apple-macosx14.0

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • I've searched for existing GitHub issues.

Steps to Reproduce

Test case 1:

  1. Create an empty Swift package (I used the executable type as a parameter)
  2. Update the Package.swift to include the Collections package with any exact version starting from 1.1.0
  3. Update the main.swift to import the SortedCollections and the print(SortedDictionary<String, String>())

Test case 2:

  1. Open any 1.1.x tag in the Github interface.
  2. Download the archive with the package source code.

Expected behavior

Test case 1:
After calling the swift run command package compiles without any errors and produces [:] as an output.
When inspecting the .build/checkouts/swift-collections/Sources directory the SortedCollections directory is present.

Test case 2:
When inspecting the Sources directory the SortedCollections directory is present.

Actual behavior

Test case 1:
Compilation error no such module 'SortedCollections'.
When inspecting the .build/checkouts/swift-collections/Sources directory the SortedCollections directory is not present.

Test case 2:
When inspecting the Sources directory the SortedCollections directory is not present.

@ArtemBurmistrov ArtemBurmistrov added the bug Something isn't working label Oct 17, 2024
@lorentey
Copy link
Member

The implementation for sorted collections is not yet ready for production use, and it isn't part of any Swift Collections release. This is very intentional -- the SortedSet and SortedDictionary API surface and implementation is experimental and unstable. These types have some known correctness issues. I do not recommend using them in their current state.

@lorentey
Copy link
Member

Issue #1 tracks the task of productizing and shipping these types. This will require considerable effort.

The project's current focus is on prototyping noncopyable/nonescapable container variants for Swift's Roadmap for Performance Predictability. Sorted collections isn't part of that, so it is currently on the backburner.

@ArtemBurmistrov
Copy link
Author

Oh, sorry, I initially missed that it was an experimental API. That said, it might be helpful if the README and changelog elaborated a bit more on its availability in the release. In any case, thank you so much for the clarifications and for sharing the future plans ❤️

@LePips
Copy link

LePips commented Oct 29, 2024

I also ran into this issue when just desiring to do some experiments. Could it be exposed via _SortedCollections that Collections does not depend on? (Checking out locally isn't the end of the world, but ya know, lazy).

@xlc
Copy link

xlc commented Nov 6, 2024

I don't mind to use unstable API. It is better than nothing. Besides, if people can't opt-in to use experimental API then we won't be able to provide feedbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants