Skip to content

Conversation

@compnerd
Copy link
Member

During the review for the changes to support Windows, we realized that the location that is being used for the autosave information is only available within the user domain mask. The Windows implementation was corrected as part of the implementation, but this corrects the XDG compliant path to reflect this reality.

@compnerd compnerd requested a review from jmschonfeld May 28, 2024 12:02
@compnerd
Copy link
Member Author

@swift-ci please test

@jmschonfeld
Copy link
Contributor

I think we'll need to update the unit test here as well:

Test Case 'FileManagerTests.testSearchPaths_XDGEnvironmentVariables' started at 2024-05-28 12:06:24.064
/build/swift-foundation/Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:800: error: FileManagerTests.testSearchPaths_XDGEnvironmentVariables : XCTAssertTrue failed - Results [] did not contain known directory /tmp/FileManagerPlayground_E5CBFB28-886D-4572-9A62-6D6CE0FC22FB/TestPath/Autosave Information for autosavedInformationDirectory/SearchPathDomainMask(rawValue: 2) while setting the XDG_DATA_HOME environment variable
/build/swift-foundation/Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift:802: error: FileManagerTests.testSearchPaths_XDGEnvironmentVariables : XCTAssertTrue failed - Results [] did not contain known directory /tmp/FileManagerPlayground_E5CBFB28-886D-4572-9A62-6D6CE0FC22FB/TestPath/.local/share/Autosave Information for autosavedInformationDirectory/SearchPathDomainMask(rawValue: 2) while setting the HOME environment variable
Test Case 'FileManagerTests.testSearchPaths_XDGEnvironmentVariables' failed (0.003 seconds)

I think to fix it, we can just remove the two validate calls from FileManagerTests.testSearchPaths_XDGEnvironmentVariables that provide .userDomainMask leaving the two that provide .localDomainMask

During the review for the changes to support Windows, we realized that
the location that is being used for the autosave information is only
available within the user domain mask. The Windows implementation was
corrected as part of the implementation, but this corrects the XDG
compliant path to reflect this reality.
@compnerd
Copy link
Member Author

@swift-ci please test

1 similar comment
@jmschonfeld
Copy link
Contributor

@swift-ci please test

@jmschonfeld jmschonfeld merged commit 6061198 into swiftlang:main May 28, 2024
@compnerd compnerd deleted the xdg-mask branch May 29, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants