Skip to content

Conversation

@lordzsolt
Copy link
Contributor

Motivation:

As discussed in #6204, users would like to have a clean home directory.
And in the discussions following the merge of #3430, it seems there is a willingness to adhere to the XDG spec, and support ~/.config/swiftpm.

Modifications:

If the XDG_CONFIG_HOME environmental variable is defined, use $XDG_CONFIG_HOME/swiftpm as the root dotSwiftPM directory.

Result:

The symlinks that were previously stored in ~/.swiftpm are now stored in $XDG_CONFIG_HOME/swiftpm when this variable is defined, therefore not cluttering the home directory of users.

Closes #6204

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

We either need to use EnvironmentVariables.process() instead of ProcessInfo.processInfo.environment for improved Windows handling in the future, or exclude this logic on Windows altogether.

Co-authored-by: Max Desiatov <m_desiatov@apple.com>
@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov self-assigned this Mar 3, 2024
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Thanks!

@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) March 3, 2024 20:11
@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@MaxDesiatov MaxDesiatov added the needs tests This change needs test coverage label Mar 3, 2024
@MaxDesiatov MaxDesiatov merged commit 99a65c0 into swiftlang:main Mar 3, 2024
@alichtman
Copy link

Thank you!!

@bartekpacia
Copy link

Thank you for working on this!

Will this be released in Swift 6.0, or maybe earlier?

@MaxDesiatov
Copy link
Contributor

5.10 has been released already. Swift 6.0 is branching off main tomorrow.

furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
### Motivation:

As discussed in swiftlang#6204, users would like to have a clean home directory.
And in the discussions following the merge of swiftlang#3430, it seems there is a
willingness to adhere to the XDG spec, and support `~/.config/swiftpm`.

### Modifications:

If the `XDG_CONFIG_HOME` environmental variable is defined, use
`$XDG_CONFIG_HOME/swiftpm` as the root `dotSwiftPM` directory.

### Result:

The symlinks that were previously stored in `~/.swiftpm` are now stored
in `$XDG_CONFIG_HOME/swiftpm` when this variable is defined, therefore
not cluttering the home directory of users.

Closes swiftlang#6204

---------

Co-authored-by: Max Desiatov <m_desiatov@apple.com>
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
### Motivation:

As discussed in swiftlang#6204, users would like to have a clean home directory.
And in the discussions following the merge of swiftlang#3430, it seems there is a
willingness to adhere to the XDG spec, and support `~/.config/swiftpm`.

### Modifications:

If the `XDG_CONFIG_HOME` environmental variable is defined, use
`$XDG_CONFIG_HOME/swiftpm` as the root `dotSwiftPM` directory.

### Result:

The symlinks that were previously stored in `~/.swiftpm` are now stored
in `$XDG_CONFIG_HOME/swiftpm` when this variable is defined, therefore
not cluttering the home directory of users.

Closes swiftlang#6204

---------

Co-authored-by: Max Desiatov <m_desiatov@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

~/.swiftpm config, cache to follow the XDG base dir spec

4 participants