FIX: swift-doc creates file and directory with unexpected permission#146
Conversation
**Problem** swift-doc creates file with execution bit, also creates directory without execution bit. **Solution** Remove unexpected permission attributes given to the `FileManager` and let them to use file system defaults.
|
Thanks for the patch, @niw! That was some code left over from the initial proof-of-concept. For whatever reason, I thought I needed to override permissions to get it working on CI. Could you please add a corresponding entry into |
So, while working on this patch, I was investigating corelibs Foundation and found the next behavior (possibly a bug.) https://bugs.swift.org/browse/SR-13307 |
|
Looks like swift-doc is still creating files with unexpected permissions, which means an extra Without this extra step, I get "Permission Denied" when trying to copy the documentation files: JamesIves/github-pages-deploy-action#388 |
|
@mluisbrown Hi, do you know if it’s because the files generated by swift-doc has no read permissions for the others? Because that is slightly separated issue but actually Swift corelibs Foundation bug (I would say, it’s bug,) as I describe before on this thread caused by swiftlang/swift-corelibs-foundation#1876. Also if that’s the case, when you can run the CI on macOS instead of other POSIX system such as Linux, then probably the result would be different, which is using Apple's Foundation not corelibs one. |
|
@niw I don't actually know. It's likely that the problem is the Foundation bug that you mentioned, and not anything specifically related to swift-doc itself 👍 |
|
FYI here, I just posted a potential fix on swiftlang/swift-corelibs-foundation#2851 for the permission issue. |
Problem
swift-doc creates file with execution bit, also creates directory
without execution bit.
Solution
Remove unexpected permission attributes given to the
FileManagerand let them to use default permission respects file system and process umask.