How to use spkg-install in a travis-ci script?

62 views
Skip to first unread message

Simon King

unread,
Jul 30, 2019, 2:34:40 PM7/30/19
to sage-...@googlegroups.com
Hi!

I learned at Sage Days 100 how to post the code for my cohomology spkg
on github, and learned basics about travis-ci.

Meanwhile I found out how to start a docker container and install the
prerequisites of my spkg.

Current problem: How to launch the package's spkg-install?

Of course(?) the spkg-install script is run in a sage shell, but
apparently this is not enough, as
sage -sh "/full/path/to/spkg-install"
fails because it cannot find sdh_make, sdh_die etc.

So, what can I do to make the Sage distribution helpers (is that the
meaning of "sdh"?) available to spkg-install?

Best regards,
Simon

Dima Pasechnik

unread,
Jul 30, 2019, 3:21:48 PM7/30/19
to sage-...@googlegroups.com
just fix the PATH, no?

It should include SAGE_ROOT/src/bin, SAGE_ROOT/build/bin, etc



Best regards,
Simon

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/qhq2jm%242pk6%241%40blaine.gmane.org.

Simon King

unread,
Jul 30, 2019, 4:03:15 PM7/30/19
to sage-...@googlegroups.com
Hi Dima,

On 2019-07-30, Dima Pasechnik <dim...@gmail.com> wrote:
> just fix the PATH, no?
>
> It should include SAGE_ROOT/src/bin, SAGE_ROOT/build/bin, etc

Apparently sage -sh is fixing the path:

$ ~/Sage/git/sage/sage -sh -c 'echo $PATH'
/home/king/Sage/git/sage/local/libexec/ccache:/home/king/Sage/git/sage/build/bin:/home/king/Sage/git/sage/src/bin:/home/king/Sage/git/sage/local/bin:/home/king/bin:/home/king/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ echo $PATH
/home/king/bin:/home/king/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

If I understand correctly, the sdh_* thingies aren't executables (but I
don't know what they are instead -- macros for the shell language?).
I guess that's why the path is not enough.

Best regards,
Simon

Simon King

unread,
Jul 30, 2019, 4:09:26 PM7/30/19
to sage-...@googlegroups.com
Perhaps I found a solution.

Apparently the sdh_* shell functions are defined in
$SAGE_ROOT/build/bin/sage-dist-helpers. Sourcing, so it seems, makes the
spkg-install script work.

Best regards,
Simon

Simon King

unread,
Jul 30, 2019, 4:35:55 PM7/30/19
to sage-...@googlegroups.com
On 2019-07-30, Simon King <simon...@uni-jena.de> wrote:
> Perhaps I found a solution.

Yes and no.

Yes, it does work with the sage version on my laptop

No, it does not work on travis-ci with a sage docker image.

Namely, sage-dist-helpers cannot be found in $SAGE_ROOT/build/bin in the
docker image:

ls $SAGE_ROOT/build/bin
sage-apply-patches
sage-download-file
sage-flock
sage-logger
sage-package
sage-pip-install
sage-python23
sage-spkg
sage-spkg-uninstall
sage-system-python
sage-uncompress-spkg

I guess simply the version in the docker image (which is "latest") is
too old. What can I replace "source $SAGE_ROOT/build/bin/sage-dist-helpers"
with, in the docker image?

Best regards,
Simon

Dima Pasechnik

unread,
Jul 30, 2019, 5:25:27 PM7/30/19
to sage-devel
That file has been moved recently. It used to be
src/bin/sage-dist-helpers

I guess that's where it is on your docker image.
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/qhq9mv%242fkc%241%40blaine.gmane.org.

Markus Wageringel

unread,
Jul 31, 2019, 8:21:43 AM7/31/19
to sage-devel
I think it would be good to keep the install script for Travis-CI as close as possible to what you would normally do to install a package in Sage, that is, create an updated tarball of your repository and copy it to upstream/, update the checksums and then install it with sage -i. This way, Sage will handle the details of running the spkg-install script. You can set a custom docker entrypoint to avoid running everything inside a Sage subshell, see for example here, though I used pip for installing the package.

Simon King

unread,
Jul 31, 2019, 11:20:56 AM7/31/19
to sage-...@googlegroups.com
Hi Markus,
><https://github.com/mwageringel/fgb_sage/blob/b6924832fabe86f274e4e43b7271f0f6565a72a8/.travis.yml#L20>,
> though I used pip for installing the package.

That sounds very reasonable. Will definitely do so in future, when I'm
done experimenting with docker and travis-ci, turning towards actual
production.

Best regards,
Simon

Simon King

unread,
Jul 31, 2019, 5:26:07 PM7/31/19
to sage-...@googlegroups.com
Hi Markus,

On 2019-07-31, Markus Wageringel <markus.w...@gmail.com> wrote:
> I think it would be good to keep the install script for Travis-CI as close
> as possible to what you would normally do to install a package in Sage,
> that is, create an updated tarball of your repository and copy it to
> upstream/, update the checksums and then install it with sage -i.

Thank you for encouraging me to do this. Before, I created that tarball
and updated checksums etc. *manually*. Now, I wrote scripts for it, and in
fact installation now works on travis-ci.

I have a follow-up, though, but I guess that belongs to a new thread.

Best regards,
Simon

Reply all
Reply to author
Forward
0 new messages