juliaup: Base is not read-only

julia> @edit LogExpFunctions.logaddexp(4, 5) # opened file is read-only (same happens for any other packages)

julia> @edit sin(4) # opened file is NOT read-only. Seems to occur for all base Julia installation files

Expected behavior: Base files should also be read-only. Seems permissions are not set correctly during installation?

I tested this on Mac (Apple silicon) and Linux (x86). In both cases I installed Julia via juliaup (just ran the script curl -fsSL https://install.julialang.org | sh).

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_EDITOR = mvim
  JULIA_PKG_USE_CLI_GIT = true
  JULIA_PKG_SERVER_REGISTRY_PREFERENCE = eager

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 34 (11 by maintainers)

Most upvoted comments

One argument for installing the .jl files as read-only is that @edit Base.foo() will open up one of these files in an editor—this is a pretty common way to inspect the Julia source code, but it’s generally not a good idea to modify the installed source. (I’ve done this by accident a few times myself, and I can easily imagine users thinking that this is a good way to patch Julia.)

Yeah, I believe the tar extraction crate that is used by Juliaup does handle metadata, including readonly flags. So my best guess is that all we would need to do to make this work is set the readonly flag in the tarballs that Juliaup uses and we might just be done.

@spaette we’re not proposing that end-users manually set any flags. The recommended way to install Julia these days is Juliaup, and it would take care of all of this for end-users.

Seems like this should be a packaging/installer thing?

I think you usually need admin rights to modify /usr/bin/* or /Applications/*, right? Whereas Julia is typically installed somewhere under ~/.julia/..., that a user can modify without being admin.

In both places, programs are writeable by the owner of the program. In /usr/bin/ that’s generally root so it’s true that my user cannot modify them. In /Applications/ any app that I’ve installed is writeable by me.

I do, however, buy the argument that because we make it easy to open the installation’s source files in an editor, we should prevent accidentally editing them. But in that case, I think we should not recommend a script, which approximately no one will run. Instead, we should arrange for the source files to be installed read-only.

I guess macOS downloads are installed under /Applications and of consequence owned by root.

No, MacOS downloads are owned by the user (with admin privileges) who installed the app (under /Applications or wherever):

% ls -l /Applications/Julia-1.9.app/Contents/Resources/julia/share/julia/base/math.jl
-rw-r--r--@ 1 stevenj  admin  39979 Jun  7 16:37 /Applications/Julia-1.9.app//Contents/Resources/julia/share/julia/base/math.jl