wanted: get rid of SBCL_HOME and run-sbcl.sh -- too much hassle

Bug #666086 reported by Attila Lendvai
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Wishlist
Nikodemus Siivola

Bug Description

issue:
-------
 - SBCL_HOME is cumbersome, misconfiguration results in seemingly unrelated errors leading to long headaches

 - run-sbcl.sh interferes with argv parsing

notation:
-----------
 - in this document 'ROOT' means the checked out directory of the SBCL git repository

suggested solution:
------------------------
 - make.sh should put all the install-ready files into ROOT/build (or somesuch, but don't conflate it with the current temporary directory called 'output').

the files needed for running sbcl are:
   - all the built contribs (currently ROOT/obj/sbcl-home/contrib/)
   - sbcl.core (currently ROOT/output/sbcl.core)
   - sbcl executable (currently ROOT/src/runtime/sbcl)

- get rid of run-sbcl.sh, people should run ROOT/build/sbcl directly

 - if SBCL_HOME is not set, then initialize the internal variables to the pwd of the sbcl executable (resolve symlinks or not?)

 - never set SBCL_HOME (maybe even get rid of it?)

consequences:
-------------
 - with this setup the traditional unix way of installing (the binary and the core in a separate directory) will not work without either setting SBCL_HOME, or trying the standard unix path's.

 - the windows installer could install sbcl into any directory and it would just work.

 - checked out and built repos would just work, making it easy to keep a few different sbcl's around

summary: - SBCL_HOME, run-sbcl.sh -- too complicated
+ wanted: get rid of SBCL_HOME and run-sbcl.sh -- too much hassle
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

I basically agree.

This couples nicely with my plan for new installation where /usr/local/bin/sbcl -> /usr/local/lib/sbcl/<version>/sbcl-runtime or equivalent.

Changed in sbcl:
importance: Undecided → Wishlist
status: New → Confirmed
Mike Seth (mikeseth)
tags: added: build pathnames
tags: added: install
Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

FYI, the sad reality out in the wild, people struggling due to SBCL_HOME:

http://permalink.gmane.org/gmane.lisp.slime.devel/10464

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 666086] Re: wanted: get rid of SBCL_HOME and run-sbcl.sh -- too much hassle

Attila Lendvai <email address hidden> writes:

> FYI, the sad reality out in the wild, people struggling due to
> SBCL_HOME:
>
> http://permalink.gmane.org/gmane.lisp.slime.devel/10464

For the record, the issue described in this thread was completely
unrelated to SBCL_HOME.

Christophe

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
description: updated
description: updated
Changed in sbcl:
status: Confirmed → Fix Released
Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

sorry for just wishes and no patches, but it would be nice if the build was also restructured. run-sbcl.sh is still present and is necessary when sbcl is built from source and is not installed:

$ ./src/runtime/sbcl
fatal error encountered in SBCL pid 5901(tid 0x7fb772baa280):
Can't find core file relative to ./src/runtime/

ideally, it should just run as is when started from a build/ directory.

Revision history for this message
Pouar (pouar) wrote :

This fix seems to be causing ASDF to output fasl files in the current directory when the image is dumped as an executable
https://gitlab.common-lisp.net/asdf/asdf/issues/28

Revision history for this message
Pouar (pouar) wrote :

Is this intended behavior?

Revision history for this message
Stas Boukarev (stassats) wrote :

No idea how ASDF misuses SBCL internals for finding output locations.

Revision history for this message
Robert P. Goldman (rpgoldman) wrote :

Follow up: Here's what goes wrong with ASDF:

We have to NOT move output fasls from the lisp implementation home directory. This is necessary so that people don't recompile hunks of lisp code distributed with SBCL and end up with the fasls put somewhere inappropriate.

This means that the first rule of any output translations ruleset says (effectively) DON'T redirect fasls from the lisp implementation directory.

Unfortunately, if the lisp implementation directory is the directory that an executable is started in, AND if a developer starts up an executable in the source directory where it was built, placement of fasl files for that source directory will get messed up.

I'm not sure why pretending an executable's directory is the lisp installation directory is helpful. Wouldn't it be less misleading to set the lisp installation directory for dumped executables to NIL, because there is no valid installation directory, in general, for a dumped executable, which won't have the expected suite of installed files in the usual place?

Revision history for this message
Stas Boukarev (stassats) wrote :

One of the possible locations for finding contribs/ and sbcl.core is beside the executable.

Revision history for this message
Stas Boukarev (stassats) wrote :

I appended contrib/ to sbcl-homedir-pathname. Hope nothing, besides ASDF, uses it...

Revision history for this message
Pouar (pouar) wrote :

appending contrib/ to sbcl-homedir-pathname seems to have fixed it

Revision history for this message
Pouar (pouar) wrote :

ok, apparently https://github.com/sbcl/sbcl/commit/71f7507fc119b4c88b428d71e7aaf0ded918558e causes it to places fasls in projects that have a contrib directory. I guess putting ./ before contrib/ makes a difference.

Revision history for this message
Stas Boukarev (stassats) wrote :

But there is ./ before contrib/. And it even returns NIL if there's no contrib/ directory.

Revision history for this message
Stas Boukarev (stassats) wrote :

I guess it gets foiled by *default-pathname-defaults* being changed.

Revision history for this message
Pouar (pouar) wrote :
Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

this change has broken our setup.

my ultimate goal with this issue was to be able to run a compiled sbcl straight from its directory, without installing it, and without the use of run-sbcl.sh.

IIUC, now even run-sbcl.sh cannot communicate SBCL_HOME to the executable anymore (the breakage).

what's needed is a reorganization of the build process so that the resulting files are in an appropriate directory structure for the sbcl executable to find what it needs.

ideally, into an encompassing build/ directory.

Changed in sbcl:
status: Fix Released → New
Revision history for this message
Stas Boukarev (stassats) wrote :

run-sbcl.sh is working fine, what do you mean?

Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

i got confused. whatever causes the breakage is deeper (it's in the process of capturing sbcl's home directory at build-time into a dumped executable image).

sorry for the noise! i'll get back after more investigation -- if needed.

Changed in sbcl:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.