-
Notifications
You must be signed in to change notification settings - Fork 86
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
Base is not read-only #865
Comments
i can reproduce in windows, 1.9.1 |
I suppose that installing Julia as read-only would make sense. Should we change this in the build process or the install process? |
Seems like this should be a packaging/installer thing? |
julia 1.9.3
an ordinary (non-root) user opening math.jl
update LogExpFunctions v0.3.26
|
I think that is more based on how you installed Julia. A standard installation will not have that property. |
It's a juliaup issue then? |
No, the same applies to the official installation method. |
I presume @3f6a was running julia as an ordinary user. julia-1.9.3-linux-x86_64.tar.gz I suppose unless modified math.jl will have read/write perms for the ordinary or root user who extracted the precompiled .tar.gz.
I've the following currently on SuSE Linux (version 15.4) which runs KDE as the graphical desktop.
update As a test I uninstalled the above and ran juliaup's The math.jl file has the identical read/write perms as in the direct .tar.gz download as extracted.
Perms are the responsibility of the admin for a system installed program, or the user for a locally installed program. |
In the Un*x filesystem hierarchy standard It's rather generic with Slackware Community submitted build scripts for source downloads to check perms.
So one could add a shell script to precompiled julia downloads for non-root users to optionally run after local installs. Of further note it's also rather generic to compress man pages.
|
Yes, I am. By the way, also the stdlibs are not read-only: julia> using Random: bitrand
julia> @edit bitrand(4) # file is not opened as read-only. Same for all stdlib source files |
Perhaps a command changing perms for locally installed pre-compiled binaries could be added in the above section. Julia developers might determine if any
The juliaup code could be modified to determine whether local or system installs are being performed and change perms on the former. |
The directory Marking PR a Draft. This is the current command submitted on the premise that none of the affected files need be writeable.
This would be more comprehensive, again under the premise that none of the affected files need be writeable.
|
As a juliaup Collaborator any opinion on this ticket and pull request? |
I think PowerShell accepts either forward or back slashes in the PATH.
The above PowerShell command can be adapted as per julia version and the location of the math.jl file. FWIW, Notepad.exe does not indicate to the user when a file is readonly. Download Would you and/or the PowerShell Team be amenable to recommending a command to recursively change the The extracted *.zip file's etc directory tree contains the startup.jl file which can be left unchanged. On Windows one would replace The Windows download unlike the Generic Linux download includes a julia-config.jl file that is not executable. FWIW, this will list the
|
The below is authorised for use and/or modification by the julia and juliaup developers. Windows (portable) [version neutral]
Windows (installer) [version specific]
Which file types to convert isn't my call; omitting the .jl in the commands should convert all file types to read-only. I note in the share\julia subdirectory tree there are some .ci and .github directories and .gitignore and .*.yml files. from @mklement0 [PowerShell repo Contributor] Final thought: to make
https://julialang.org/downloads/platform/#windows A checkbox could be added to the Windows installers, checked for ordinary user, unchecked for administrator. Other: ☑ Add Julia to PATH |
I added PowerShell content to the pull; rebased and marked it ready for review. Were the devs inclined to add the .sh and .ps1 scripts to the contrib directory this would be the README.md patch. --- README.md.orig 2023-09-19 13:14:36.714260595 -0500
+++ README.md 2023-09-19 13:01:02.232205915 -0500
@@ -71,6 +71,8 @@
[different tiers of support](https://julialang.org/downloads/#supported_platforms)
for OS and platform combinations.
+It's recommended to correct the perms ([perms.sh](https://github.com/JuliaLang/julia/blob/master/contrib/perms.sh), [perms.ps1](https://github.com/JuliaLang/julia/blob/master/contrib/perms.ps1)) for locally extracted pre-compiled binaries.
+
If everything works correctly, you will see a Julia banner and an
interactive prompt into which you can enter expressions for
evaluation. You can read about [getting
@@ -111,6 +113,8 @@
lists a series of running tests; if they complete without error, you
should be in good shape to start using Julia.
+See the content from the previous section regarding perms.
+
You can read about [getting
started](https://docs.julialang.org/en/v1/manual/getting-started/)
in the manual. perms.sh
perms.ps1
|
Presuming root doesn't run the program, this ticket seems of concern for local and not system installs. IMHO, the cleanest solution would be as follows. A. overwrite the PR based on my previous comment #865 I guess macOS downloads are installed under |
No, MacOS downloads are owned by the user (with admin privileges) who installed the app (under % 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 |
julia-1.9.3-macaarch64.dmg
I guess it's open to interpretation whether macOS users would find the comment from perms.sh sufficiently clear. Using the .dmg might not be construed as the equivalent of using a locally extracted pre-compiled binary.
D. release .dmg downloads with corrected perms #865 |
I'd solicit an opinion on whether it's feasible to generate .dmg and .exe downloads as specified in this ticket. B. an added checkbox for Windows installers #865 Installer checks if Admin or Non-Admin is running the .exe, and whether added checkbox is checked or unchecked. D. release .dmg downloads with corrected perms #865 |
rewrote pull and rebased please review pull in January |
I'm sorry, is there a pull request somewhere? This is an issue. |
The pull solely addresses locally extracted pre-compiled binaries. |
I'm a bit unsure of the premise that Julia should be installed read-only. I've been poking around my system and neither standard UNIX tools (like |
One argument for installing the |
@StefanKarpinski I think you usually need admin rights to modify I agree with @stevengj's comment. This is the main reason why I opened the issue. We only want that source files So it would suffice to make the |
In both places, programs are writeable by the owner of the program. In 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. |
It might be good to reland most of JuliaLang/julia#45441 then, with an update to make sure the files are read-only. That will finally fix the problem where out-of-tree builds install incorrectly and the build tree cannot be compatible with the install tree. But we potentially need an update to Revise.jl, to pick whether it wants to track the real (immutable) installed sources or the corresponding (writable) development files |
I assume files in tarballs can have a read-only flag? Juliaup just extracts the tar.gz downloads, so the way to implement this is presumably to just make sure the tar.gz release archives have the right read-only flags set. |
Files in tarballs can have any UNIX permissions (it was originally for tape archival purposes, after all). Our |
An end-user generally it is presumed likes things to work out-of-the-box. I acknowledge non-root users running a post-install script or sourcing a post-install file may be a bit cumbersome. Personally, I wouldn't want to have to add to The Unix Filesystem Hierarchy Standard (FHS) layout has
Currently on Unix-like are files under FWIW, the Julia is attributed in my fork as the owner of the |
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. |
Personally, I tend to check perms irrespective of the Linux distribution in use.
The last comment of @davidanthoff has been upvoted, |
@davidanthoff It would be nice if |
I think Revise should track whatever was running. That is, if you want to edit the development source files, then you should be running a Julia built from those files. In that case I don't think Revise will need any modification. Just chiming in here that I've been bit by this repeatedly (since juliaup's code is not a git repository, me and Ctrl-Z are getting to be quite good friends), so I'd be enthusiastic to see them made read-only. |
My understanding is that nothing needs to be done on the Juliaup side, but that the tar balls that Juliaup downloads just need to have the read-only flags set. |
I'm not clear what the hold up here is. Who needs do something? Do we need to change the way our tarballs are generated at build time? Does @staticfloat need to change how they're uploaded? |
I think we need to change how the tarballs are generated at build time, I believe the files that should be read-only should get that attribute inside the tarball, and then everything should/might work. |
This sets all `.jl` files in `$(prefix)/base` and `$(prefix)/test` to have `0444` permissions, to better match how `Pkg` installs packages (and sets them to be read-only). Fixes JuliaLang/juliaup#865
this ticket is closed cf: #865 (comment) my original command was as follows
and with the commit's interpolated variables, I presume would have been written as
|
This sets all `.jl` files in `$(prefix)/base` and `$(prefix)/test` to have `0444` permissions, to better match how `Pkg` installs packages (and sets them to be read-only). Fixes JuliaLang/juliaup#865 --------- Co-authored-by: Mosè Giordano <[email protected]> (cherry picked from commit 62e7705)
This sets all `.jl` files in `$(prefix)/base` and `$(prefix)/test` to have `0444` permissions, to better match how `Pkg` installs packages (and sets them to be read-only). Fixes JuliaLang/juliaup#865 --------- Co-authored-by: Mosè Giordano <[email protected]>
This sets all `.jl` files in `$(prefix)/base` and `$(prefix)/test` to have `0444` permissions, to better match how `Pkg` installs packages (and sets them to be read-only). Fixes JuliaLang/juliaup#865 --------- Co-authored-by: Mosè Giordano <[email protected]> (cherry picked from commit 62e7705)
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 scriptcurl -fsSL https://install.julialang.org | sh
).The text was updated successfully, but these errors were encountered: