Skip to content

use idiomatic location for security directory and update location of configuration directory#3942

Merged
tomerd merged 4 commits into
swiftlang:mainfrom
tomerd:security-location
Dec 16, 2021
Merged

use idiomatic location for security directory and update location of configuration directory#3942
tomerd merged 4 commits into
swiftlang:mainfrom
tomerd:security-location

Conversation

@tomerd

@tomerd tomerd commented Dec 14, 2021

Copy link
Copy Markdown
Contributor

motivation: use idiomatic location for security directory on macOS

changes:

  • allow users to customize security directory location with new --security-path CLI option
  • on macOS use /Library/org.swiftpm/security for security files and symlink from ~/.swiftpm/security
  • move configuration directory from /Library/org.swiftpm to /Library/org.swiftpm/configuration
  • add migration code from old configuraiton location to new one
  • add and adjust tests
  • update docker setup for new locations

Comment thread Tests/FunctionalTests/MiscellaneousTests.swift
Comment thread Sources/Commands/SwiftTool.swift Outdated
Comment thread Sources/Basics/FileSystem+Extensions.swift Outdated
@neonichu

Copy link
Copy Markdown
Contributor

We're talking about ~/Library/org.swift.swiftpm, right? Or are we creating a second location?

Comment thread Sources/Basics/FileSystem+Extensions.swift Outdated
Comment thread Sources/Basics/FileSystem+Extensions.swift Outdated
Comment thread Sources/Basics/FileSystem+Extensions.swift Outdated
Comment thread Sources/Basics/FileSystem+Extensions.swift Outdated
…configuration directory

motivation: use idiomatic location for security directory on macOS

changes:
* allow users to customize security directory location with new --security-path CLI option
* on macOS use <user>/Library/org.swiftpm/security for security files and symlink from ~/.swiftpm/security
* move configuration directory from <user>/Library/org.swiftpm to <user>/Library/org.swiftpm/configuration
* add migration code from old configuraiton location to new one
* add and adjust tests
* update docker setup for new locationis

@yim-lee yim-lee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's make sure source compat test passes before merging?

We can use: swiftlang/swift#40524

Comment thread Sources/Basics/FileSystem+Extensions.swift
@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test

@tomerd tomerd changed the title use idiomatic location for security directory and update location of … use idiomatic location for security directory and update location of configuration directory Dec 15, 2021
@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

@yim-lee revised per discussion + addressed other comments

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Dec 15, 2021
@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

We're talking about ~/Library/org.swift.swiftpm, right? Or are we creating a second location?

@neonichu @abertelrud we have been using ~/Library/org.swift.swiftpm for configuration files thus far, in practice only for storing collections.json. With the new TOFU feature now need a location for security related files. As such, this PR transitions the configuration files to ~/Library/org.swift.swiftpm/configuration and uses ~/Library/org.swift.swiftpm/security for the latter.

note the migration code does not delete / move the old files, it copies them from ~/Library/org.swift.swiftpm into ~/Library/org.swift.swiftpm/configuration such that moving back to older toolchain/Xcode does not break (although they would use different copies).

on non-Darwin platform this moves the configuration files from ~/.swiftpm/config to ~/.swiftpm/configuration so that the names are aligned on all platforms, this is done with similar preservation of old files for the same reason.

one nice thing with this is that it also matched the changes we made earlier this year moving the "local" (package root) <package-root>/.swiftpm/config file into <package-root>/.swiftpm/configuration/mirrors.json

wdyt?

@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test

@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

Let's make sure source compat test passes before merging?

that test passed, so we should be good

@neonichu

neonichu commented Dec 15, 2021

Copy link
Copy Markdown
Contributor

We have to make sure that users understand that there are two different config files, right now we're only warning one time on copy, correct? I think we need to warn on load as long as both locations exist.

@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

We have to make sure that users understand that there are two different config files, right now we're only warning one time on copy, correct? I think we need to warn on load as long as both locations exist.

2ba88d3

@tomerd

tomerd commented Dec 15, 2021

Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test

@tomerd tomerd merged commit 739c587 into swiftlang:main Dec 16, 2021
tomerd added a commit to tomerd/swift-package-manager that referenced this pull request Dec 16, 2021
…configuration directory (swiftlang#3942)

motivation: use idiomatic location for security directory on macOS

changes:
* allow users to customize security directory location with new --security-path CLI option
* on macOS use <user>/Library/org.swiftpm/security for security files and symlink from ~/.swiftpm/security
* move configuration directory from <user>/Library/org.swiftpm to <user>/Library/org.swiftpm/configuration
* add migration code from old configuraiton location to new one
* add and adjust tests
* update docker setup for new locationis
tomerd added a commit that referenced this pull request Dec 17, 2021
…configuration directory (#3942)

motivation: use idiomatic location for security directory on macOS

changes:
* allow users to customize security directory location with new --security-path CLI option
* on macOS use <user>/Library/org.swiftpm/security for security files and symlink from ~/.swiftpm/security
* move configuration directory from <user>/Library/org.swiftpm to <user>/Library/org.swiftpm/configuration
* add migration code from old configuraiton location to new one
* add and adjust tests
* update docker setup for new locationis
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.

3 participants