-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[6.0] Various low-risk cherry-picks #7578
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
shahmishal
merged 13 commits into
swiftlang:release/6.0
from
bnbarham:missing-cherry-picks
May 18, 2024
Merged
[6.0] Various low-risk cherry-picks #7578
shahmishal
merged 13 commits into
swiftlang:release/6.0
from
bnbarham:missing-cherry-picks
May 18, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`standbox` -> `sandbox` (cherry picked from commit 9d48dc7)
…tFound (swiftlang#7419) Fixed a bug in the productDependencyNotFound error message ### Motivation: fix swiftlang#7398 The above issue suggests the following two defects. 1. package dependency resolution changes depending on the order of packages (alphabetical order) 2. the phrase "Did you meen..." in the error message in the error message is not on target. ### Modifications: The first problem is as described in the issue, if users rename the directory containing Package.swift from repro to zzz, the "Did you meen..." will appear. will appear. Essentially, the error minutes should be displayed in full, regardless of the name of the directory. This is due to the fact that the loop used to resolve dependencies depends on the alphabetical order of the directories and the side effect on allTargetName inside the loop. Therefore, the side effect for allTargetName inside the loop has been moved to the outside of the loop. The second problem is that when dependency A of a package is not found, a strange suggestion "Did you meen `A`? ", which is a strange suggestion. This is because when a dependency is not found, the message "Did you meen `<target name>`" is printed if there is a dependency with a similar name (even the exact same name). Thus, if the names are the same, "Did you meen `.product(name: ... , package: "swift-argugument")"`" instead of the found target name. ### Result: Command to execute: `swift build` Result of command:. `error: 'repro': product 'ArgumentParser' required by package 'repro' target 'repro' not found. Did you mean '.product(name: "ArgumentParser", package: "swift-argument-parser")'?` Condition: The following steps were taken to create the environment. 1. mkdir repro 1. cd repro 1. swift package init --type executable 1. Open Package.swift and make sure it has this content: ```swift // swift-tools-version: 5.10 import PackageDescription let package = Package( name: "repro", dependencies: [ .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0") ], targets: [ .executableTarget( name: "repro", dependencies: ["ArgumentParser"] ) ] ) ``` --------- Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com> (cherry picked from commit ea1730b)
Resolve warnings in `Tests/PackageModelTests/MinimumDeploymentTargetTests.swift` . ### Motivation: 3 warnings were displayed indicating that a deprecated function is being used and suggesting the use of an alternative function. ### Modifications: Following the suggestion, the warning was resolved. ### Result: The following warnings have been resolved: > `init(arguments:environment:exitStatus:output:stderrOutput:)` is deprecated: use `init(arguments:environmentBlock:exitStatus:output:stderrOutput:)` (cherry picked from commit a809fb5)
We require Swift 5.9 to build the package, so we can adopt 5.9-specific formatting tweak as well. (cherry picked from commit 8193ed6)
Achieved by converting `DownloadTask` and `DataTask` to value types and adding more `Sendable` annotations where needed. (cherry picked from commit 549d781)
Sticking to `@escaping @Sendable` as a preferred order of attributes. Also fixed `dependecies` -> `dependencies` typo. (cherry picked from commit 72b8498)
#### Motivation: In the process of generating PIF, I identified a missing case for VisionOS in the implementation of the `[PackageConditionProtocol].toPlatformFilters()`, which led to assertionFailure when Package's platforms included VisionOS. #### Modifications: - Added a new case `.visionOS` in the switch statement within the `toPlatformFilters()` extension for `[PackageCondition]`. - Added a new static property `visionOSFilters` within `PIF.PlatformFilter` to define filters specific to VisionOS. #### Result: With these changes, PIFBuilder can now generate PIF without errors for packages that include VisionOS as a target (cherry picked from commit 1c68e6c)
Also refactored `URLSessionHTTPClient` to remove `weak` references, which were incompatible with strict concurrency checks. (cherry picked from commit f249153)
swiftlang#7454) Fix empty token when adding a new package-registry and adding token interactively on release builds ### Motivation: When executing swift package-registry login it asks for a token but fails to retrieve it properly. It sends an empty string to the registry server and login therefore fails. (see swiftlang#7453) ### Modifications: I've debugged the code a bit and found out, that somehow `buffer` and `passwordPtr` don't seem to be holding correct values after the `readpassphrase` call. - An easy quick fix is to make sure that `buffer` doesn't get deallocated by adding smth like `_ = buffer` after the String init. This works but is not nice. - My first try was to use `buffer` instead of `passwordPtr` to create the string. These works, but I remember reading somewhere that `&` can be quite nasty sometimes. - I also tried `buffer.withUnsafeMutablePointer`. However `readpassphrase` seems to not only change the content of `buffer` but move it. This leads to a runtime failure `Fatal error: Array withUnsafeMutableBufferPointer: replacing the buffer is not allowed` ### Result: The buffer is retained, the token is properly parsed and sent to the server. (cherry picked from commit d8c8d0f)
This "Returns true if the state file exists on the filesystem" doc comment was copy-pasted from a function above and is clearly wrong: `reload()` function doesn't return any values. (cherry picked from commit 2093d2c)
These haven't been relevant for a while. (cherry picked from commit ec1bfe8)
I fixed warning appears when building with Swift 6. (cherry picked from commit 32442c6)
@swift-ci please test |
nkcsgexi
approved these changes
May 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: I went through the last few months of PRs to make sure anything relevant is cherry-picked. Most of these are NFC but cherry-picking will help with conflicts. The main are:
--build-system xcode
- Add VisionOS platform support toPIF.PlatformFilter
#7448Scope: Package manifests/graphs with duplicate product/target names.
Risk: Very low
Reviewed By: Various, mostly @MaxDesiatov