scheme / scsh

A Unix shell embedded in scheme
Other
382 stars 36 forks source link

make install error #35

Closed spelufo closed 8 years ago

spelufo commented 8 years ago

I was getting an error running make install that it couldn't find an .so file. I had to make this change for scsh to install, at least inside the fakeroot that arch's makepkg utility uses to build packages. Don't know if it is something specific to arch or if the makefile is wrong. I'll just leave the patch here in case you want it.

--- Makefile.in.old 2015-10-23 14:27:40.249916693 -0300
+++ Makefile.in 2015-10-23 14:28:00.549916100 -0300
@@ -172,7 +172,7 @@

 install-scsh-image: install-scsh
    $(srcdir)/build/build-image.sh $(srcdir) \
-       "$(LIB)/" '$(DESTDIR)$(LIB)/scsh.image' '$(SCHEME48) -h 0' '$(LOADS)'
+       "$(DESTDIR)$(LIB)/" '$(DESTDIR)$(LIB)/scsh.image' '$(SCHEME48) -h 0' '$(LOADS)'

 clean:
    rm -rf c/*.o c/*.so c/*.dSYM *.sexpr scsh.image scsh go *.dSYM
roderyc commented 8 years ago

Thanks for the report and fix!

codemac commented 8 years ago

This breaks builds in the opposite way, where now the install stage references DESTDIR which may not be the final build location. This is important for packaging scsh for linux distributions.

Currently the archlinux package in the AUR does something like the following:

git submodule update --init
autoreconf
./configure --prefix=/usr --with-scheme48=/usr
make
make DESTDIR="$pkgdir/" install 

Where $pkgdir is a subdirectory in /tmp for where the build is occurring. Now when I run scsh compiled this way, I get the following:

$ scsh
VM exception `external-error' with no handler in place
opcode is: call-external-value-2
stack template id's:  <- 293 <-  <-  <- 1258 <- 1258 <- 6650 <- 6625 <- 3309 <- 
$

So then I run it in strace:

open("/tmp/yaourt-tmp-jmickey/aur-scsh-git/pkg/scsh-git//usr/lib/scsh-0.7/time-ticks-sec.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)

I see it's looking in the old build location for the library. I tried to read the makefile and figure out best ways around it, but it seems the best way around it is to back out this patch.. which then breaks make install. Any ideas?

codemac commented 8 years ago

Ok, hilariously this issue was opened by the person who made the archlinux package. So, I don't know what's really going on.

codemac commented 8 years ago

Yeah, double checked, this package with this patch reverted builds a working package. I think this may have been merged in error (or the packager was using DESTDIR incorrectly)

spelufo commented 8 years ago

Yes, the patch is wrong, sorry, we should change it back.

roderyc commented 8 years ago

Ok, give me a bit to consider fully what's going on here. I think our build is overly fragile in other similar ways and I'd like to see if I can fix that.

roderyc commented 8 years ago

Alright, reverted. I see where the confusion was; when built to a destination other than where it'll be ultimately installed, scsh won't run. It looks like it's broken when you try to run it in the build location, but will work fine after a full installation.