Skip to content

enable netrc on non-darwin platforms #3466

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
May 4, 2021
Merged

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented May 4, 2021

motivation:

changes:

  • remove platforms restructions where appropriate
  • add test fixute that actually exercises the netrc parsing logic
  • adjust tests to run on all platforms

motivation:
* netrc functionality is useful on all platforms
* underlying functionality is avaialbe via swiftlang/swift-tools-support-core#210

changes:
* remove platforms restructions where appropriate
* add test fixute that actually exercises the netrc parsing logic
* adjust tests to run on all platforms
@tomerd
Copy link
Contributor Author

tomerd commented May 4, 2021

related to swiftlang/swift-tools-support-core#210

#else
diagnostics.emit(error: "'--netrc-file' option is only supported on macOS >=10.13")
#endif
}
Copy link
Contributor Author

@tomerd tomerd May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not meaningful any longer since SwiftPM is >= 10.15 and its supported on other platforms

#if os(macOS) // Netrc feature currently only supported on macOS
authProvider = try? Netrc.load(fromFileAtPath: netrcFilePath).get()
#endif
// FIXME: should this handle the error more gracefully?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neonichu do you know why the error is ignored here? topic for different PR, but curios

@@ -47,89 +47,50 @@ final class PackageToolTests: XCTestCase {
let stdout = try execute(["--version"]).stdout
XCTAssert(stdout.contains("Swift Package Manager"), "got stdout:\n" + stdout)
}

func testNetrcSupportedOS() throws {
Copy link
Contributor Author

@tomerd tomerd May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not meaningful any longer since SwiftPM is >= 10.15 and its supported on other platforms

try execute(["--netrc-file", netrcPath.pathString, "resolve"], packagePath: packageRoot)
XCTAssert(true)

fixture(name: "DependencyResolution/External/XCFramework") { packageRoot in
Copy link
Contributor Author

@tomerd tomerd May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new fixtures that actually uses netrc :D

@tomerd
Copy link
Contributor Author

tomerd commented May 4, 2021

@swift-ci please smoke test

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label May 4, 2021
@tomerd tomerd self-assigned this May 4, 2021
@tomerd tomerd merged commit 0c9c8d5 into swiftlang:main May 4, 2021
bitjammer pushed a commit to bitjammer/swift-package-manager that referenced this pull request Jul 23, 2021
motivation:
* netrc functionality is useful on all platforms
* underlying functionality is avaialbe via swiftlang/swift-tools-support-core#210

changes:
* remove platforms restructions where appropriate
* add test fixute that actually exercises the netrc parsing logic
* adjust tests to run on all platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants