Skip to content
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

Needs debianization #221

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 51 comments
Closed

Needs debianization #221

GoogleCodeExporter opened this issue Mar 16, 2015 · 51 comments

Comments

@GoogleCodeExporter
Copy link

Life is nicer if you can use the native package manager.

Happily, there's tools for that!  If you 'apt-get install checkinstall'
and add a target to the end of the Makefile like:

debian:
       sudo checkinstall -D --pkgname chibi-scheme --pkgversion `cat VERSION` --maintainer "http://groups.google.com/group/chibi-scheme" -y make PREFIX=/usr install

It's a little ghetto as debianizations go, but suitable for development use - 
I'm more confident of install/removal, and things end up in the 'right' paths, 
no hackery of LD_LIBRARY_PATH needed.


Original issue reported on code.google.com by pjimen...@gmail.com on 27 May 2014 at 5:58

@GoogleCodeExporter
Copy link
Author

Someone is working on proper debianization.  I may add this if
he doesn't finish soon :)

Original comment by alexsh...@gmail.com on 27 May 2014 at 11:03

  • Changed state: Accepted

@raould
Copy link

raould commented Apr 15, 2015

ubuntu 14.04 doesn't show anything, by the way. Has anybody made a sort of vaguely official package for debian/ubuntu?

@ilammy
Copy link
Contributor

ilammy commented Apr 15, 2015

Well, packaging files into debs is one thing, but maintaining packages requires some amount of bureaucracy. There are PPAs for Ubuntu, but it's much harder to get your package into Debian's repositories.

I use Debian so at least I can try making a source DEB package for Chibi.
(But I make no commitment to it.)

@ashinn
Copy link
Owner

ashinn commented Apr 25, 2015

The funny thing is I used to be a Debian developer (for GNU Smalltalk).
I need to look into what would be required to reinstate my status.

ashinn added a commit that referenced this issue Apr 25, 2015
is bound in only one of the environments.  This is necessary in the
case where a library uses an unbound keyword (e.g. "with" in (chibi
loop)), but you want to use it along with a binding for the
keyword (e.g. "with" in (chibi show)).  The alternative to work with
the current logic is to always require such keywords to be bound, in
this case to add a dummy "with" auxiliary syntax binding to (chibi
loop), however this doesn't seem any safer than the new logic, and the
whole point of the feature is convenience.  Fixes issue #221.
@ashinn
Copy link
Owner

ashinn commented Apr 25, 2015

Ignore that commit, it was meant for issue #246.

@barak
Copy link

barak commented Mar 17, 2019

Looked at packaging this for Debian. You may hate GNU autotools, but they do make it easier to package: getting libraries into the right places like /usr/lib/x86_64-linux-gnu/ and whatnot. Just saying...

@ilammy
Copy link
Contributor

ilammy commented Apr 6, 2019

You can get packacking right without Autotools as well, the Makefile just has to support all the conventional variables like DESTDIR, PREFIX, LIBDIR, etc. Then Debian tooling should pick that up automatically, setup proper values for them, and it all will 'just work'.

@barak
Copy link

barak commented Apr 6, 2019

That would be nice, wouldn't it?

But search the below for /usr/local, and for architecture-specific files (like *.so) in /usr/lib/ instead of /usr/lib/x86_64-linux-gnu/ which is where Debian wants them.

I can try to tweak the Makefile appropriately, but the bottom line is for this to work without a lot of tweaking by the distributions, you need to conform meticulously to the GNU coding standards for installation directories. Emacs M-x info it is File: standards.info, Node: Directory Variables, online here. Note that they are all lower case, except DESTDIR.

$ debian/rules binary

$ more debian/tmp/usr/include/chibi/install.h

#define sexp_so_extension ".so"
#define sexp_default_module_path "/usr/local/share/chibi:/usr/local/lib/chibi"
#define sexp_platform "linux"
#define sexp_version "0.8.0"
#define sexp_release_name "oxygen"

$ find debian/tmp -name '*.so*' -ls
      202088 debian/tmp/usr/lib/chibi/chibi/crypto/crypto.so
      241176 debian/tmp/usr/lib/chibi/chibi/io/io.so
      186904 debian/tmp/usr/lib/chibi/chibi/optimize/rest.so
      183240 debian/tmp/usr/lib/chibi/chibi/optimize/profile.so
      294336 debian/tmp/usr/lib/chibi/chibi/filesystem.so
      184800 debian/tmp/usr/lib/chibi/chibi/weak.so
      195352 debian/tmp/usr/lib/chibi/chibi/heap-stats.so
      206096 debian/tmp/usr/lib/chibi/chibi/disasm.so
      282288 debian/tmp/usr/lib/chibi/chibi/ast.so
      181240 debian/tmp/usr/lib/chibi/chibi/emscripten.so
      254336 debian/tmp/usr/lib/chibi/chibi/process.so
      245440 debian/tmp/usr/lib/chibi/chibi/time.so
      233056 debian/tmp/usr/lib/chibi/chibi/system.so
      244144 debian/tmp/usr/lib/chibi/chibi/stty.so
      274512 debian/tmp/usr/lib/chibi/chibi/net.so
      184320 debian/tmp/usr/lib/chibi/scheme/time.so
      237400 debian/tmp/usr/lib/chibi/srfi/18/threads.so
      185344 debian/tmp/usr/lib/chibi/srfi/27/rand.so
      208968 debian/tmp/usr/lib/chibi/srfi/151/bit.so
      187304 debian/tmp/usr/lib/chibi/srfi/39/param.so
      202840 debian/tmp/usr/lib/chibi/srfi/69/hash.so
      213536 debian/tmp/usr/lib/chibi/srfi/95/qsort.so
      185928 debian/tmp/usr/lib/chibi/srfi/98/env.so
      277832 debian/tmp/usr/lib/chibi/srfi/144/math.so
      280464 debian/tmp/usr/lib/chibi/srfi/160/uvprims.so
     1178216 debian/tmp/usr/lib/libchibi-scheme.so.0.8.0
          24 debian/tmp/usr/lib/libchibi-scheme.so.0 -> libchibi-scheme.so.0.8.0
          24 debian/tmp/usr/lib/libchibi-scheme.so -> libchibi-scheme.so.0.8.0

$ find debian/tmp -name '*.pc*' -print -exec cat '{}' '+'
debian/tmp/usr/lib/pkgconfig/chibi-scheme.pc
# pkg-config
prefix=/usr/local
exec_prefix=${prefix}
libdir=/usr/local/lib
includedir=${prefix}/include
version=0.8.0

Name: chibi-scheme
URL: http://synthcode.com/scheme/chibi/
Description: Minimal Scheme Implementation for use as an Extension Language
Version: ${version}
Libs: -L${libdir} -lchibi-scheme
Libs.private: -dl -lm
Cflags: -I${includedir}

@barak
Copy link

barak commented Apr 6, 2019

A few other packaging-related questions. I hope you don't mind my asking them here. But I hope rather than answering them inline, someone can put the answers in the documentation, like README-PACKAGING.md or whatever.

  • How should the various files be split between packages? Like, libchibi0 (for runtime library), libchibi-dev (for programs that want to link to it), chibi-scheme (for the binary), chibi-scheme-doc, chibi-scheme-common (for common support files, if appropriate), etc. Like, do all the .so files belong in the libchibi0 package or do they go in some support package or what?

  • What's the right directory for the various .so files so the dlopen will find them; how is this passed into the executable? I looked for -D being passed to the compiler with the relevant directory, but didn't notice anything. Is this path in install.h? Probably the right path is /usr/lib/x86_64-linux-gnu/chibi-scheme/*.so, or its analog on other architectures.

  • For generating libchibi-dev, what's the easiest way to tickle creation of a libchibi.a file?

Sorry for the big blat of questions; I could try to figure them out, but you probably know offhand. And I might well get some wrong.

@robertlemmen
Copy link

in case you still need someone with some interest in chibi but also debian upload permissions: please let me know

@barak
Copy link

barak commented Apr 9, 2019

@robertlemmen I'm a DD but happy to leave this to you, or to co-maintain, whatever.

@ashinn
Copy link
Owner

ashinn commented Apr 9, 2019

@barak, I think that packaging breakdown looks good, although probably chibi-scheme instead of just chibi. You probably want to put all scheme libraries together with libchibi-scheme0, but could arguably put any that don't use the FFI in chibi-scheme-common (otherwise no need for a common package).

install.h will be generated with the matching install paths used by the makefile.

libchibi-scheme.a already has a make target.

Did you try just packaging this? DESTDIR, PREFIX, LIBDIR etc. are already supported.

@robertlemmen
Copy link

@barak nah, if you got it covered then that is perfect :) I just wasn't sure from the email thread whether you had the maintainer tick or not

@ilammy
Copy link
Contributor

ilammy commented Apr 9, 2019

@barak If the position is still open I'd like to give it a shot.

@barak
Copy link

barak commented Apr 10, 2019

@ilammy Please, go for it. Let me know if there's anything I can do to help. @ashinn Yes, there is a prelim packaging in github.com/barak/chibi-scheme branch debian, the build does not use the appropriate paths. DESTDIR is correct (upper case) but libdir, prefix, etc should be lower case. Not sure if that would fix things, have not checked, might still need to add some code to pass them through properly.

@ilammy
Copy link
Contributor

ilammy commented Apr 17, 2019

Here's a status update.

The packaging code may be found in my fork: ilammy/chibi-scheme @ debian/sid.

Building instructions
  1. Install prerequisites

    Obviously, this needs to be performed on a Debian box.

    sudo apt install build-essential debhelper fakeroot
    

    This works for my Buster, but I did not check the clean environment. Maybe some more are necessary.

  2. Check out the source code

    Use an additional directory where debhelper will place the results:

    mkdir wherever/you/like && cd wherever/you/like
    git clone https://github.com/ilammy/chibi-scheme.git --branch debian/sid
    cd chibi-scheme
    
  3. Prepare an original tarball

    Debian build system requires this. I've written a helper script that packs the current source tree into a tarball:

    ./debian/make-orig-tarball
    

    This creates chibi-scheme_0.8.0.orig.tar.gz in the parent directory.

    It's a bit different from make dist so that it works with the full source tree. I'm not sure this is the right approach, but whatever...

  4. Build the package

    dpkg-buildpackage -us -uc
    

    This builds the package without trying to sign it. It will be placed in the parent directory and can be installed right away:

    sudo dpkg -i ../chibi-scheme_0.8.0-1_amd64.deb
    
  5. Clean the build directory

    The build is performed in-source and debhelper leaves the room dirty. git clean -fxd . is always a good idea before building again.

I've managed to get the paths right with some really vile trickery (pretending to have a ./configure). It seems to be the easiest way to ask debhelper to do most of the work for us, as it does not pass all these prefix and libdir values to anything other than ./configure.

The debian/patches directory has some other patches that I needed to get the packaging complete without errors, warnings, and ignored failures. Some of them might be merged into the main source tree, some are just hacks for Debian packaging specifically.

This builds a single package with full file set and it works when installed (yay!). Now I'm going to work on the package split and, well, all that metadata that needs to be filled in: licenses, dependencies, descriptions, etc.

P.S. It turned out that if you actually sit down and read the 'Debian New Maintainers' Guide' then all these spells start making sense :)

@barak
Copy link

barak commented Apr 18, 2019

Wow, that is truly vile! I am lost in admiration.

I used the dh --buildsystem=makefile option to get debhelper to ignore configure, which is not nearly so tricky. Plus I need to pass a whole bunch of paths manually, which I have not yet gotten the energy to do.

@ashinn
Copy link
Owner

ashinn commented Apr 22, 2019

Very nice @ilammy ! Most of those patches look good to merge directly to upstream.

@barak
Copy link

barak commented May 10, 2019

Okay, I'm going to try to merge your efforts with mine and upload to Debian.
Will list @ilammy as co-maintainer.
FYI, the ITP is https://bugs.debian.org/928753

@ilammy
Copy link
Contributor

ilammy commented Jan 25, 2020

So... this is not over yet!

After some on-and-off efforts I've updated the packaging:

  • fixed static library support
  • correct copyright information (and other stuff required by Debian)
  • bundling HTML docs built with chibi-doc
  • updated and improved Bash completions
  • updated and reformatted man pages (and a new man page for snow-chibi)
  • fixed a couple of issues with snow-chibi
  • automated smoke tests of the package (autopkgtest)

I'm still learning the ropes, but I guess it's close to not being embarrassing to post this to mentors.debian.net.

I hope I'll get to submit non-Debian-specific fixes as pull requests soon.

In the mean time I've had fun hunting compatibility issues between Ubuntu releases which resulted into this PPA with packages for current Ubuntu series:

sudo add-apt-repository ppa:ilammy/chibi-scheme
sudo apt update
sudo apt install chibi-scheme 

Please test 🙏

@ashinn
Copy link
Owner

ashinn commented Aug 25, 2020

It would be nice to update this to 0.9.1.

@ilammy
Copy link
Contributor

ilammy commented Aug 25, 2020

I've updated the packaging lately to 0.9.1, it seems to be working well, including images! snow-chibi starts up really fast now. I'll update the PPAs soon, after tweaking them for Ubuntu flavors.

@barak
Copy link

barak commented Aug 25, 2020

So, what's the story? Should I have another look with an eye towards pushing it into Debian? Or does somebody else have that under control...

@ashinn
Copy link
Owner

ashinn commented Aug 27, 2020

It sounds like @ilammy has PPAs but is not working on getting this into official Debian?

@barak
Copy link

barak commented Aug 27, 2020

Okay, had a look.

First, I'm very happy to upload chibi-scheme into Debian. But, the debian/* packaging scripts have to be sensible. Right now, as they stand, there seem to be a couple major issues.

  • I get FTBFS. This seems due to the Rube-Goldberg brittle build system, which is using fakechroot in a configuration which doesn't work everywhere.
if type ldconfig >/dev/null 2>/dev/null; then ldconfig; fi
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
make[2]: [Makefile:390: install-base] Error 1 (ignored)
...
fakechroot chroot /home/barak/src/git/chibi-scheme/debian/tmp /usr/bin/chibi-scheme -d /usr/share/chibi/chibi.img
/usr/bin/chibi-scheme: error while loading shared libraries: libchibi-scheme.so.0: cannot open shared object file: No such file or directory
make[2]: [Makefile:399: install] Error 127 (ignored)
fakechroot chroot /home/barak/src/git/chibi-scheme/debian/tmp /usr/bin/chibi-scheme -xscheme.red -d /usr/share/chibi/red.img
/usr/bin/chibi-scheme: error while loading shared libraries: libchibi-scheme.so.0: cannot open shared object file: No such file or directory
make[2]: [Makefile:400: install] Error 127 (ignored)
...
make[1]: Leaving directory '/home/barak/src/git/chibi-scheme'
   dh_install
dh_install: warning: Cannot find (any matches for) "usr/share/chibi/*.img" (tried in ., debian/tmp)
dh_install: warningm: chibi-scheme-images missing files: usr/share/chibi/*.img
dh_install: error: missing files, aborting
make: *** [debian/rules:6: binary] Error 255
  • The debian/patches/0001-configure-override.patch is not a good solution. The "right" thing to do, I'd say, is to have a Makefile which actually works and follows the relevant standards (e.g., it's bindir not BINDIR, etc), and just using dh $@ --buildsystem=makefile to tell debhelper to ignore the configure file and invoke make. Which should be passed the appropriate directories in the appropriate configuration variables, etc.

  • Help me OB1, you're my only hope!

$ egrep local debian/extra-make-variables.mk 
SNOWPREFIX="/usr/local"
SNOWLIBDIR="/usr/local/lib/x86_64-linux-gnu"

In all seriousness, these are the sorts of issues that autotools is absolutely fantastic at getting right, if you just use its approved mechanisms and go with its flow. Of course that whole system is horrible in a zillion ways. But it does allow short configure.ac and Makefile.am files, and then it sweats all the details of getting all the installation paths right in a portable way, of dealing with executables that are generated and also used at build time and need to use shared libraries that have been built but not installed yet, etc. These issues are autotools's bread and butter, and the current system is gradually reinventing a lumpy wheel.

@mnieper
Copy link
Collaborator

mnieper commented Aug 27, 2020 via email

@ilammy
Copy link
Contributor

ilammy commented Aug 27, 2020

To sum it up: the current system is kinda WIP, I'm glad to get feedback, and will work on improving it.

I get FTBFS. This seems due to the Rube-Goldberg brittle build system, which is using fakechroot in a configuration which doesn't work everywhere.

It's quite likely. The fakechroot is recent, experimental addition by me for packaging. It seemed to work on my machine, but evidently it's still got issues.

I wanted to make sure that the images generated by Chibi during the installation process do not include incorrect paths in them. Currently, they remember DESTDIR with Debian temporary directory in the source code information, so whenever Chibi is using images and prints a stack trace, the source lines lead to the temporary DESTDIR, not actual source code installed. I was not able to quickly identify the proper way to resolve this, so using fakechroot was a quick hack.

The debian/patches/0001-configure-override.patch is not a good solution.

Yeah, I'll agree here. I'm leaving it there as initially I was not able to get debhelper to pass proper paths in bindir, etc. to the Makefile, and I did not get back to it even since. I guess I'll give it another try.

SNOWPREFIX="/usr/local"

This is more of an intentional decision to keep libraries managed by snow-chibi – a non-system, local package manager – away from the /usr hierarchy managed by dpkg. This is similar to how npm seems to work for global installation of packages.


As for the whole Autotools debacle, I personally absolute love it as a user when it works. However, I don't have much experience with maintaining software that uses it, so I have no opinion here. The current project that I'm involved with also uses bare Makefiles, without Autotools, and could probably benefit from it as it also has lots of platform detection code...

Though, well, with Chibi I guess the code is portable enough for it to be okay to use plain Makefiles. I think that if debhelper could pass debianized paths via conventional variables, that should be enough for Chibi to build fine, as there is very little code that actually needs to know the platform, like which functions are available, etc. – all that other stuff checked by Autotools besides the installation paths.

@mnieper
Copy link
Collaborator

mnieper commented Aug 27, 2020 via email

@barak
Copy link

barak commented Aug 27, 2020

Wow: rough consensus!

Re SNOWLIB, that's an interesting question. It could be system-local, so /usr/local. Or it could be per-user. Or it could go through a search path: first the individual user, then system-local, then something under plain /usr/lib/ since people might package snow stuff.

@ashinn
Copy link
Owner

ashinn commented Aug 27, 2020

Autotools help nothing here - changing the variable names is a few lines of code. It would also require a full rewrite of the build configuration and bring in a whole host of complexity and all new problems. That's one of the worst solutions I've ever heard of for a bug, even discounting my hatred of autotools.

I've pushed a new version of the Makefile allowing the "standard" GNU names.

Autotools will never be an option, please stop suggesting it.

@ashinn
Copy link
Owner

ashinn commented Aug 27, 2020

(*) The first step would be to remove the existing configure script, which
seems to be oblivious of the fact that Automake Makefile's are still
basically Makefiles. :)

That's like saying that HipHop for PHP is still basically C++.

@mnieper
Copy link
Collaborator

mnieper commented Aug 27, 2020 via email

@okuoku
Copy link
Collaborator

okuoku commented Aug 27, 2020

Hmm, how about CMake. Current CMakeLists.txt is only intended for Visual Studio and MinGW but extending its support to UNIX builds should be possible. (I have a decade of experience on it for my dayjob.)

Nowadays, many packaging systems treat CMake as first-class citizen.

Obvious, major downside of this is: we have to maintain two distinct build system, much more seriously. (un)fortunately, it is not special though. e.g.) libsdl( https://www.libsdl.org/ ) and libuv( https://github.com/libuv/libuv ) have both CMake and autotools. I think we can live with it since now we have CI.

@ilammy
Copy link
Contributor

ilammy commented Aug 27, 2020

Well, the problem is, I never managed to get debhelper to pass the installation step all necessary variables to make Debian's mutiarch system to work properly. The documentation does not seem to mention 'plain' makefiles either, it's all about Autotools, or, well, hardcoding the paths yourself. Even the recent conversion to GNU-style variable names (f343708) does not seem to help. It just doesn't pass all interesting paths, ignoring the variables entirely.

This is how barren the invocation line looks for me with --buildsystem=makefile:

dh_auto_install -- 
	make -j8 install DESTDIR=/home/ilammy/Documents/dev/ilammy/chibi-scheme/debian/tmp AM_UPDATE_INFO_DIR=no "INSTALL=install --strip-program=true"

And here are all the goodies that only Autoconf gets:

   dh_auto_configure
	./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking

Anyhow! The best approach that I came up with so far is to hardcode the paths a little bit differently:

# Manually implement multiarch support here since debhelper seems to pass
# this information in a proper form only to the Autoconf build system.
# When using "--buildsystem=make", no multiarch support is added.
# Chibi does not support Autoconf so we have to fix up the paths here.
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

EXTRA_ARGS += PREFIX="/usr"
EXTRA_ARGS += LIBDIR="/usr/lib/$(DEB_HOST_MULTIARCH)"
EXTRA_ARGS += SNOWPREFIX="/usr/local"
EXTRA_ARGS += SNOWLIBDIR="/usr/local/lib/$(DEB_HOST_MULTIARCH)"

And drop all the trickery with ./configure replacement.

It's not nice since if Debian decides that the correct prefix is no longer /usr then this will need to be fixed up manually (instead of debhelper figuring it out for us), but well... this seems to be The Way™.

@ilammy
Copy link
Contributor

ilammy commented Aug 27, 2020

Regarding snow-chibi paths.

chibi-scheme already looks into multiple paths for installed modules. The packaging makes it look into the following paths:

  • directories passed via -I option on the command line
  • directories passed via CHIBI_MODULE_PATH environment variable
  • lib in the current directory (if no CHIBI_MODULE_PATH)
  • the current directory itself (if no CHIBI_MODULE_PATH)
  • /usr/share/chibi for Scheme-only libraries installed from the package
  • /usr/lib/x86_64-linux-gnu/chibi for binary libraries installed from the package (per architecture)
  • /usr/local/share/snow for Scheme-only libraries installed by snow-chibi
  • /usr/local/lib/x86_64-linux-gnu/snow for binary libraries installed by snow-chibi
  • directories passed via -A option on the command line

It uses the first library found while following this order.

However, it's still an open question of where snow-chibi should install its stuff. I'd like to have an option of user-local installation, but this is definitely out of scope for packaging. It sound more like a new feature for snow-chibi.

I'd guess that later snow-chibi could be taught some --global and --user options to install either under /usr/local, or into $HOME/.snow, with one of them being the default. Then, chibi-scheme will need to be taught to look into $HOME/.snow before /usr/local.

But that should come later, IMO. Right now it can only install stuff locally, system-wide.

@ilammy
Copy link
Contributor

ilammy commented Aug 27, 2020

No comment on the fakechoot issue, other then I have managed to reproduce it with pbuilder. (It's time to learn that tool too.) No idea what causes it yet, though.

@ashinn
Copy link
Owner

ashinn commented Aug 28, 2020

I was building debian packages before dh even existed, and it wasn't that hard back then. Another example of how dangerous all of these extra layers of abstraction are.

Let me take a look.

@ashinn
Copy link
Owner

ashinn commented Aug 28, 2020

The following debian/rules builds the package just fine for me:

#!/usr/bin/make -f
%:
	dh $@

override_dh_auto_build:
	$(MAKE) prefix=/usr

override_dh_auto_install:
	$(MAKE) DESTDIR=$$(pwd)/debian/chibi-scheme prefix=/usr install

This is using the newer lowercase prefix variable.
We could just as easily have preserved the original uppercase names from the Makefile.

We could also fill in the remaining targets listed in https://www.debian.org/doc/manuals/maint-guide/dreq.en.html and not use dh at all.

@barak
Copy link

barak commented Aug 28, 2020

I think it's a debhelper bug that there's no standard way to tell it to pass all the usual variables (bindir, prefix, etc) to invocations of make when using --buildsystem=makefile. There's support for exporting some variables, by putting things like include /usr/share/dpkg/buildflags.mk in debian/rules. But none of the /usr/share/dpkg/*.mk snippets export prefix and bindir and friends.

@ilammy
Copy link
Contributor

ilammy commented Aug 29, 2020

Alrighty... After several more attempts to fix this, I have thrown away fakechroot entirely. One of the other approaches I tried to use was to do some LD_PRELOAD hax to make Chibi believe that was installed into the right place, but it also turned out to be flaky. So I ended up disabling generation of images during the package build time, they will be generated on the user machine at package installation time. I guess it will be more sane that way.

Now if you do this (with images installed):

$ snow-chibi invalid
ERROR: Unknown command: ("/usr/bin/snow-chibi.scm" "invalid")
  called from <anonymous> on line 1293 of file /usr/share/chibi/init-7.scm
  called from <anonymous> on line 280 of file /usr/share/chibi/init-7.scm
  called from <anonymous> on line 821 of file /usr/share/chibi/init-7.scm

then stack traces are actually correct, not leading into some /builder/chibi-scheme-0.9.1-1/debian/tmp/... directory. My perfectionism is sated with this.

Other cleanups include removal of redundant patches, and some copyright metadata update. The package should be at least buildable now.

@lassik
Copy link
Contributor

lassik commented Aug 30, 2020

@barak wrote:

I think it's a debhelper bug that there's no standard way to tell it to pass all the usual variables (bindir, prefix, etc) to invocations of make when using --buildsystem=makefile. There's support for exporting some variables, by putting things like include /usr/share/dpkg/buildflags.mk in debian/rules. But none of the /usr/share/dpkg/*.mk snippets export prefix and bindir and friends.

@weinholt since you're a Debian developer as well, do you happen to know about this?

@weinholt
Copy link
Contributor

@weinholt since you're a Debian developer as well, do you happen to know about this?

Nope. I just do what everyone does when debhelper doesn't help: add an override. It's fine.

@barak
Copy link

barak commented Sep 6, 2020

@weinholt Okay, I made a pass over the @ilammy debian/sid packaging, pushed to https://github.com/barak/chibi-scheme branch debian. Mainly enabling a few options. Partially placate lintian. Tiny spelling patch that should migrate upstream.

Barring objections, I'll change debian/changelog to a one-liner (initial release) and upload to Debian.

@lassik
Copy link
Contributor

lassik commented Sep 6, 2020

That reminds me: How difficult is it to create a custom APT package repository? It would be nice to run stable Debian on a server but add a line to /etc/apt/sources.list in order to install the latest releases of popular Scheme implementations. Mainline Debian could merge package definitions from our repo whenever they want to update their Schemes.

@lassik
Copy link
Contributor

lassik commented Sep 6, 2020

We already have the build scripts at https://github.com/scheme-containers, would just need to add the Debian magic.

@weinholt
Copy link
Contributor

weinholt commented Sep 6, 2020

@lassik The "Debian magic" is hours and hours of manual work. For example, I spent 12 hours yesterday to get the Debian packaging of Chez Scheme 9.5.4 in good order. Chez is an extreme case, but still. Basing Debian packages on the work we did for the Docker containers is unfortunately not realistic. (I have some ideas though; will send you an email.)

@barak
Copy link

barak commented Sep 6, 2020

@lassik It's reasonably straightforward to create something Debian users can add to /etc/apt/sources.list, see https://wiki.debian.org/DebianRepository/Setup

There's been talk of making a Debian version of Ubuntu PPAs, but it hasn't happened yet.

You can also use Ubuntu PPAs directly with Debian, albeit sometimes with some issues.

@barak
Copy link

barak commented Sep 6, 2020

$ dput ../chibi-scheme_0.9.1-1_amd64.changes 
Successfully signed dsc, buildinfo, changes files
Uploading chibi-scheme_0.9.1-1.dsc
Uploading chibi-scheme_0.9.1.orig.tar.xz
Uploading chibi-scheme_0.9.1-1.debian.tar.xz
Uploading chibi-scheme-common_0.9.1-1_all.deb
Uploading chibi-scheme-dbgsym_0.9.1-1_amd64.deb
Uploading chibi-scheme-doc_0.9.1-1_all.deb
Uploading chibi-scheme-images_0.9.1-1_all.deb
Uploading chibi-scheme_0.9.1-1_amd64.buildinfo
Uploading chibi-scheme_0.9.1-1_amd64.deb
Uploading libchibi-scheme-dev_0.9.1-1_amd64.deb
Uploading libchibi-scheme-ffi-dbgsym_0.9.1-1_amd64.deb
Uploading libchibi-scheme-ffi_0.9.1-1_amd64.deb
Uploading libchibi-scheme0-dbgsym_0.9.1-1_amd64.deb
Uploading libchibi-scheme0_0.9.1-1_amd64.deb
Uploading chibi-scheme_0.9.1-1_amd64.changes

@ashinn
Copy link
Owner

ashinn commented Sep 10, 2020

So I guess this will go into bullseye? Anything else needed before we close the ticket?

@barak
Copy link

barak commented Sep 10, 2020

No, I think that's that. Let me know if there are any issues with it.

@ashinn
Copy link
Owner

ashinn commented Sep 10, 2020

Thanks!

@ashinn ashinn closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants