Skip to content

Conversation

@nalimilan
Copy link
Member

@nalimilan nalimilan commented May 4, 2024

The FHS specifies that only architecture-independent files should be put under /usr/share (DATAROOTDIR). Originally we only stored .ji files in the "compiled" directory, but now we also put .so files.

Keep /usr/share and /usr/local/share in the default DEPOT_PATH for backward compatibility and because they can still be used for architecture-independent files such as environments or registries.

Also fix a few uses of "data" which should have been DATAROOTDIR and wouldn't work if using a different DATAROOTDIR when building.

The FHS specifies that only architecture-independent files should be put
under /usr/share (DATAROOTDIR). Originally we only stored .ji files in
the "compiled" directory, but now we also put .so files.

Keep /usr/share and /usr/local/share in the default `DEPOT_PATH` for
backward compatibility and because they can still be used for
architecture-independent files such as environments or registries.

Also fix a few uses of `"data"` which should have been "`DATAROOTDIR`"
and wouldn't work if using a different `DATAROOTDIR` when building.
Comment on lines +53 to +56
2. an architecture-specific shared system directory specific to the local host,
e.g. `/usr/local/lib/julia`;
3. an architecture-independent shared system directory specific to the local host,
e.g. `/usr/local/share/julia`;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure it's a good idea to look in /usr/local by default. I've kept /usr/local/share/ for backward compatibility, and added /usr/local/lib for consistency. But this doesn't make a lot of sense as the next two dirs (4 and 5) are relative to the julia path so they will correspond to /usr/local/ if Julia was installed there. And if there are two Julia copies, one in /usr and the other in /usr/local, the latter is going to interfere with the former.

@tecosaur
Copy link
Member

tecosaur commented May 6, 2024

While I wish otherwise, my current impression is that Julia doesn't care much about Linux norms. If anything, setting the depot to /opt/julia may be the most appropriate suggestion.

The UNIX business of spreading all the files related to a single application across dozens of directories that no one can keep straight is absolute and utter nonsense. — Stefan, JuliaLang/juliaup#844 (comment)

@nalimilan
Copy link
Member Author

While I wish otherwise, my current impression is that Julia doesn't care much about Linux norms.

That's not really the case. I've made lots of PRs to ensure Julia can be built and installed to follow the FHS, and so far it was respected. This is a bit different from XDG_CONFIG_HOME, as it doesn't mean the directory will change its location from one system to the next (and users generally don't touch the built-in depot).

If anything, setting the depot to /opt/julia may be the most appropriate suggestion.

/opt is generally organized with one directory per app, precisely to avoid spreading files. Users can already do that (and probably do) by extracting the binary tarball to /opt/julia.

@tecosaur
Copy link
Member

tecosaur commented May 6, 2024

That's not really the case. I've made lots of PRs to ensure Julia can be built and installed to follow the FHS, and so far it was respected.

I'm glad to hear, my interaction has been mainly around XDG and the concerns I've seen put forward in my interactions (scattering is awful, we want to do the same thing on every OS and that's more important than the OS's conventions, working out what goes where is too complicated, etc.) are comments that apply pretty equivalently to FHS and XDG's Base Directories, particularly given the number of direct equivalents:

  • /etc (system) = XDG_CONFIG_HOME (user)
  • /var/cache (system) = XDG_CACHE_HOME (user)
  • /usr/share (system) = XDG_DATA_HOME (user)
  • /var/run (system) = XDG_RUNTIME_DIR (user)

And when I see Stefan say "The UNIX business of..." I presume he's referring to the FHS.

/opt is generally organized with one directory per app, precisely to avoid spreading files

Right, which is precisely why I suggested it given the "put everything in one place" / "spreading files is awful" comments I've seen in response to suggestions that Julia should respect the XDG Base Directory spec.

Anyway, this PR seems sensible and IMO the more considerate Julia can be of the host system's norms the better 🙂.

@nalimilan
Copy link
Member Author

I think the main difference with XDG is that following the FHS doesn't spread files by default, as you can extract the binary tarball and keep contents in a single place (as opposed to calling make install). Stefan is against following XDG by default but is OK with having it opt-in. This is what we do for the FHS (and in this PR).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants