Skip to content
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

Preview command doesn't work on Linux #102

Open
2 tasks done
RandomHashTags opened this issue Dec 2, 2024 · 2 comments
Open
2 tasks done

Preview command doesn't work on Linux #102

RandomHashTags opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@RandomHashTags
Copy link

RandomHashTags commented Dec 2, 2024

I tried this command: swift package --disable-sandbox preview-documentation --target APIDocumentation

And got this output:

Build of target: 'APIDocumentation' complete! (4.04s)
Template: /usr/lib/swift/share/docc/render
Error: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission."
error: 'docc preview' invocation failed with a nonzero exit code: '1'.

Note: The Swift-DocC Preview plugin requires passing the '--disable-sandbox' flag
to the Swift Package Manager because it requires local network access to
run a local web server. See 'swift package plugin preview-documentation --help' for details.

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected behavior

Start web server to preview docc documentation.

Actual behavior

It says I don't have permission.

Steps to Reproduce

OS: Arch Linux 6.12.1-arch1-1
IDE: VS Code (1.95.2)

Project is a Swift Package with 1 module named "APIDocumentation" with two files:

  • Test.md with a single line of # Test
  • APIDocumentation.swift with 3 lines:
/// Test dude
struct APIDocumentation {
}

Execute the command listed above, which is described on the README to preview docc documentation.

Swift-DocC Plugin Version Information

Swift-DocC plugin version:
1.4.3

Swift Compiler version:
Swift version 6.0.2 (swift-6.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu

@RandomHashTags RandomHashTags added the bug Something isn't working label Dec 2, 2024
@tayloraswift
Copy link
Member

this is also happening to me in an Ubuntu 24.04 devcontainer

@RandomHashTags RandomHashTags changed the title Preview command doesn't work on Arch Linux DocC convert & preview commands don't work on Linux Dec 22, 2024
@RandomHashTags
Copy link
Author

RandomHashTags commented Dec 22, 2024

I think this issue should be transferred to swiftlang/swift-docc as the docc subcommands are the source of the problem, not this repo.

Edit: All unit tests pass on my Linux machine for swiftlang/swift-docc. The problem is this repo.

@RandomHashTags RandomHashTags changed the title DocC convert & preview commands don't work on Linux Preview command doesn't work on Linux Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants