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

Permission denied while setting up build directory #2604

Open
csoto-3 opened this issue Nov 10, 2024 · 1 comment
Open

Permission denied while setting up build directory #2604

csoto-3 opened this issue Nov 10, 2024 · 1 comment

Comments

@csoto-3
Copy link

csoto-3 commented Nov 10, 2024

I get the following error message when executing $julia --project=. make.jl from terminal in the ~\myPackage\docs\ directory.
(Julia 1.11.1 and Documenter 1.7.0 on a Windows 10 machine)

$ julia --project=. make.jl
[ Info: SetupBuildDirectory: setting up build directory.
ERROR: LoadError: IOError: rm("build"): permission denied (EACCES)
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:106 [inlined]
  [2] rm(path::String; force::Bool, recursive::Bool)
    @ Base.Filesystem .\file.jl:307
  [3] rm
    @ .\file.jl:273 [inlined]
  [4] runner(::Type{Documenter.Builder.SetupBuildDirectory}, doc::Documenter.Document)
    @ Documenter $USER\.julia\packages\Documenter\C1XEF\src\builder_pipeline.jl:87
  [5] dispatch(::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Document)
    @ Documenter.Selectors $USER\.julia\packages\Documenter\C1XEF\src\utilities\Selectors.jl:170
  [6] #89
    @ $USER\.julia\packages\Documenter\C1XEF\src\makedocs.jl:272 [inlined]
  [7] withenv(::Documenter.var"#89#91"{Documenter.Document}, ::Pair{String, Nothing}, ::Vararg{Pair{String, Nothing}})
    @ Base .\env.jl:265
  [8] #88
    @ $USER\.julia\packages\Documenter\C1XEF\src\makedocs.jl:271 [inlined]
  [9] cd(f::Documenter.var"#88#90"{Documenter.Document}, dir::String)
    @ Base.Filesystem .\file.jl:101
 [10] makedocs(; debug::Bool, format::Documenter.HTMLWriter.HTML, kwargs::@Kwargs{sitename::String, modules::Vector{Module}})
    @ Documenter $USER\.julia\packages\Documenter\C1XEF\src\makedocs.jl:271
 [11] top-level scope
    @ $PROJ\docs\make.jl:5
in expression starting at ~myPackage\docs\make.jl:5

Below is the make.jl file referenced at the top-level scope.

push!(LOAD_PATH,"../src/")
using Documenter
using myPackage
makedocs(
    sitename = "myPackage",
    format = Documenter.HTML(),
    modules = [myPackage]
)
deploydocs(
    repo =  "https://github.com/$user/myPackage.git"
)

To generate the project, I followed the steps (starting at "Package Structure") from this website:
https://jaantollander.com/post/how-to-create-software-packages-with-julia-language/#package-structure

Below is the resulting file tree.

~\myPackage
│   .gitignore
│   Manifest.toml
│   Project.toml
│   README.md
│   
├───.github
│   └───workflows
│           Documenter.yml
│           Runtests.yml
│           TagBot.yml
│           
├───docs
│   │   .gitignore
│   │   make.jl
│   │   Manifest.toml
│   │   Project.toml
│   │   
│   ├───build
│   │   │   index.html
│   │   │   objects.inv
│   │   │   search_index.js
│   │   │   
│   │   └───assets
│   │       │   themeswap.js
│   │       │   warner.js
│   │       │   
│   │       └───themes
│   └───src
│           index.md
│           
└───src
        myPackage.jl
        

I tried executing make.jl from within the Julia REPL as follows, and still get the same error message.

shell> cd $PROJ/docs
pkg> activate .
julia> include("make.jl")

I've also tried running the commands from admin-enabled terminal and admin-enabled Julia REPL sessions to no avail.

Lastly I opened up $USER\.julia\packages\Documenter\C1XEF\src\builder_pipeline.jl:87 to inspect the rm command that's setting off the error (shown below).

    doc.user.clean && isdir(build) && rm(build; recursive = true)

I think including force=true in the kwargs for rm would do the trick (as shown below), but the file is read-only so I can't edit it.

    doc.user.clean && isdir(build) && rm(build; force = true, recursive = true)

Any advice on where to go from here would be greatly appreciated.

@mortenpi
Copy link
Member

mortenpi commented Nov 10, 2024

I don't think force=true should really do anything here, since it's a permissions issue, but force is there just so that you wouldn't throw for non-existent paths:

If force=true is passed, a non-existing path is not treated as error.

But I don't really have any advice beyond suggesting to try to figure out what's going on with the permissions. Generally, Documenter runs fine on Windows, so it seems to be something specific to your setup. If it's really an issue, it would be good if you could figure out an MWE.

but the file is read-only so I can't edit it.

You could add Documenter as a dev dependency -- then you'd have the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants