I want a package at installation scope but also to keep my install clean

33 views
Skip to first unread message

Nathaniel W Griswold

unread,
May 17, 2021, 12:43:57 AM5/17/21
to Racket Users
Hello,

I was setting up Racket on my linux box and i realized that there are a lot of options for path configuration and i forgot a lot of what i discovered last time i dug into this. I was trying to set up installation scope but maybe a little cleanly and figured someone might have some input.

I want a package at roughly installation scope, but i kinda wanted to know what was added by me and what was part of the default installation. Is this reasonable or should i just deal with it and dump stuff in $RACKET/share/pkgs? If it is reasonable then what is the best way to set this up?

Just FYI I did an in-place install of Racket in "/opt/Racket/Racket\ 8.1" symlinked to /opt/Racket...

I think maybe what i want is to set to something like

(in /opt/Racket/etc/config.rktd)

#hash(... (pkgs-search-dirs . "/opt/Racket 8.1/share/pkgs-system" #f) (links-search-files . ("/opt/Racket/share/pkgs-system/links.rktd" #f)) ...)

Then i just did a `sudo /opt/Racket/bin/raco pkg install --scope-dir /opt/Racket/share/pkgs-system rash`

... and the new package seems to be working fine for my users.

Is that what i wanted or is there something better? Is there a way to configure config.rktd additions that will persist across upgrades or will i have to update my config.rktd for every racket release? Do other people do this kind of thing or just dump stuff in the installation scope? Maybe there are more options with a unix-style install, i haven't really tried one yet.

Thanks!

Nate

Matthew Flatt

unread,
May 18, 2021, 12:20:07 PM5/18/21
to Nathaniel W Griswold, Racket Users
Yes, this approach can work. I don't think the existing Racket tools
will help much with persisting a configuration across versions, though,
so you'd probably have to script that.

One potential drawback of your approach is that executables,
documentation, etc., associated with the extra package will get
rendered into the main installation area instead of the "/opt/Racket"
are. That may be fine for your purposes, but a more strictly layered
installation is meant to be possible. It turns out that some pieces
have been missing for layering, and fixing that is an area of current
work (https://github.com/racket/racket/commit/dfbb7040a).

Sam Tobin-Hochstadt

unread,
May 18, 2021, 1:07:09 PM5/18/21
to Matthew Flatt, Nathaniel W Griswold, Racket Users
You might also be interested in the new `raco-pkg-env` tool:
https://github.com/samdphillips/raco-pkg-env/

Sam
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20210518102000.1b1%40sirmail.smtps.cs.utah.edu.

Nathaniel W Griswold

unread,
May 20, 2021, 4:48:09 AM5/20/21
to Sam Tobin-Hochstadt, Matthew Flatt, Racket Users
Sam,

Yes, the tool and PLTCONFIGDIR help me better control things. I think the tool is helpful. I ran into a problem with racket trying to delete files and posted it on github at https://github.com/samdphillips/raco-pkg-env/issues/3

I don't think it's really a raco-pkg-env issue, though, i guess it wouldbe more of a racket issue if it is a problem and not a mistake on my part.

Nate
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2Ba2G41L5C3v1wPjackfsn0VwtRZEWO7XiW9POS7mWa85Q%40mail.gmail.com.

Nathaniel W Griswold

unread,
May 20, 2021, 4:55:52 AM5/20/21
to Sam Tobin-Hochstadt, Matthew Flatt, Racket Users
Oh, and i'll just duplicate the issue here for Matthew / the Racket side since it could just be racket related:

The errors i ran into are when using a custom PLTCONFIGDIR with this config.rktd:

---
#hash((build-stamp . "")
(catalogs
.
("https://download.racket-lang.org/releases/8.1/catalog/" #f))
(default-scope . "installation")
(doc-dir . "/opt/Racket/Packages/8.1/doc")
(doc-search-dirs . (#f "/opt/Racket/Racket 8.1/doc"))
(doc-search-url
.
"https://download.racket-lang.org/releases/8.1/doc/local-redirect/index.html")
(links-file . "/opt/Racket/Packages/8.1/links.rktd")
(links-search-files . (#f "/opt/Racket/Racket 8.1/share/links.rktd"))
(pkgs-dir . "/opt/Racket/Packages/8.1/pkgs")
(pkgs-search-dirs . (#f "/opt/Racket/Racket 8.1/share/pkgs")))
---

The files that `raco pkg install` as an unprivileged user ends up trying to delete are:

open-output-file: error deleting file
path: /opt/Racket/Racket 8.1/share/shares.rktd
system error: Permission denied; errno=13

open-output-file: error deleting file
path: /opt/Racket/Racket 8.1/lib/launchers.rktd
system error: Permission denied; errno=13


Is this expected behavior?

Nate
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/743645C7-A08D-4F73-B974-74416C975E75%40manicmind.earth.

Nathaniel W Griswold

unread,
May 20, 2021, 5:00:13 AM5/20/21
to Sam Tobin-Hochstadt, Matthew Flatt, Racket Users
To be clear:

"/opt/Racket/Racket 8.1" is the system racket which the unprivileged user cannot write.
"/opt/Racket/Packages/8.1" is a unprivileged-writable directory intended for use as a package destination.

Nate
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/189D0501-41E6-45CC-9473-49EED71B8B1D%40manicmind.earth.

Nathaniel W Griswold

unread,
May 20, 2021, 5:21:15 AM5/20/21
to Sam Tobin-Hochstadt, Matthew Flatt, Racket Users
Hm, I think maybe i will just abort this effort on my system since it seems like Matthew is already kinda working on making this exact thing better (as he said earlier) at https://github.com/racket/racket/commit/dfbb7040a

I'll just use user scope now and wait until this kind of thing is explicitly supported, unless you guys think it's possible to do correctly now?

Nate
> To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/537558AF-26F4-4657-B1B7-1C1FC63BE4C5%40manicmind.earth.

Reply all
Reply to author
Forward
0 new messages