Ticket #10492 (closed enhancement: fixed)

Opened 2 years ago

Last modified 14 months ago

Rework spkg/install, spkg/standard/deps, spkg/standard/newest_version

Reported by: jdemeyer Owned by: GeorgSWeber
Priority: major Milestone: sage-5.0
Component: build Keywords: scripts install newest_version deps Makefile
Cc: leif Work issues:
Report Upstream: N/A Reviewers: John Palmieri
Authors: Jeroen Demeyer Merged in: sage-5.0.beta10
Dependencies: #12479, #12602, #12608, #12609, #12712 Stopgaps:

Description (last modified by jdemeyer) (diff)

The current system of spkg/install setting environment variables like $TERMCAP with the version numbers of the various packages is quite bad.

In this ticket, I change spkg/install to create a file spkg/Makefile (which includes spkg/standard/deps) which is used as makefile instead of spkg/standard/deps. Instead of using environment variables for the versions, I simply use make variables.

The shell script newest_version is also removed in favor of a shell function in spkg/install. It gracefully handles non-existing packages. Previously a non-existing package will not signal any error or warning.

Apply:

  1. 10492_deps_to_Makefile.patch Download to SAGE_ROOT
  2. 10492_no_more_newest_version.patch Download to SCRIPTS.

See also #12609: fixing the developer manual to take into account the changes on this ticket.

Attachments

10492_no_more_newest_version.patch Download (1.0 KB) - added by jdemeyer 16 months ago.
10492_deps_to_Makefile.patch Download (20.3 KB) - added by jdemeyer 15 months ago.

Change History

comment:1 Changed 2 years ago by jdemeyer

  • Component changed from build to scripts

comment:2 Changed 2 years ago by vbraun

It would be nice if a shell function newest_version() would also be available for other spkg to check that required versions of dependencies are available. So I'd like it to be in 3rd file install-functions (or so) that is sourced by install. Perhaps with a better name, for example requires_version(mpir,1,1,2)...

Moreover, the current newest_version script does not check that it is called from $SAGE_ROOT/spkg. If it is called from the wrong directory, I get

/home/vbraun/Sage/sage/spkg/standard
[vbraun@volker-two standard]$ ./newest_version mpir
mpir-1.2.2.p2

on Linux and

vbraun@t2:standard$ pwd
/home/vbraun/t2/sage-4.6.1-sunos-32bit-5.10-sun4v-SunOS/spkg/standard
vbraun@t2:standard$ ./newest_version mpir

(no output) on t2/Solaris.

comment:3 Changed 16 months ago by jdemeyer

  • Keywords deps Makefile added
  • Component changed from scripts to build
  • Description modified (diff)
  • Summary changed from spkg/install: implement newest_version using a shell function to Rework spkg/install, spkg/standard/deps, spkg/standard/newest_version

comment:4 Changed 16 months ago by jdemeyer

  • Authors set to Jeroen Demeyer

Changed 16 months ago by jdemeyer

comment:5 Changed 16 months ago by jdemeyer

  • Description modified (diff)

comment:6 Changed 15 months ago by jdemeyer

  • Dependencies set to #12479, #12602

comment:7 Changed 15 months ago by jdemeyer

  • Dependencies changed from #12479, #12602 to #12479, #12602, #12608

comment:8 Changed 15 months ago by jdemeyer

  • Dependencies changed from #12479, #12602, #12608 to #12479, #12602, #12608, #12609
  • Description modified (diff)

comment:9 Changed 15 months ago by jdemeyer

  • Status changed from new to needs_review

comment:10 Changed 15 months ago by jhpalmieri

Is the code in data/extcode/debian dead? It uses newest_version, but is it relevant anymore?

Otherwise, the changes here make sense, and I've been using this (via #12369) for some time now with no problems. I'll test on a few more systems, and then (pending the answer to my question) I can give it a positive review.

comment:11 follow-up: ↓ 13 Changed 15 months ago by jhpalmieri

  • Status changed from needs_review to needs_work

I think that make distclean should delete spkg/Makefile.

comment:12 Changed 15 months ago by jdemeyer

For Debian, see #12470. Yes, it's unused.

Changed 15 months ago by jdemeyer

comment:13 in reply to: ↑ 11 Changed 15 months ago by jdemeyer

  • Status changed from needs_work to needs_review

Replying to jhpalmieri:

I think that make distclean should delete spkg/Makefile.

Yes, it should. Fixed.

comment:14 Changed 15 months ago by jhpalmieri

  • Status changed from needs_review to positive_review
  • Reviewers set to John Palmieri

comment:15 Changed 15 months ago by jdemeyer

Thanks for the review!

Looks like the whole build system will be cleaned up nicely in sage-5.0 (#11073, #12479, #10492,...)

comment:16 Changed 14 months ago by leif

  • Cc leif added

comment:17 follow-up: ↓ 20 Changed 14 months ago by leif

It would be nicer (and more appropriate) to use basename (which is POSIX) in newest_version*().


Any reason to copy spkg/standard/deps rather than include it by the generated Makefile?

comment:18 Changed 14 months ago by jhpalmieri

It turns out that this change breaks the optional Sage package database_gap, since that package uses the newest_version script. See #12712.

comment:19 Changed 14 months ago by jdemeyer

  • Dependencies changed from #12479, #12602, #12608, #12609 to #12479, #12602, #12608, #12609, #12712

comment:20 in reply to: ↑ 17 ; follow-up: ↓ 21 Changed 14 months ago by jdemeyer

Replying to leif:

Any reason to copy spkg/standard/deps rather than include it by the generated Makefile?

1) because it looks cleaner to me to have just one Makefile.

2) because I was worried about the portability of including files inside Makefiles.

comment:21 in reply to: ↑ 20 Changed 14 months ago by leif

Replying to jdemeyer:

Replying to leif:

Any reason to copy spkg/standard/deps rather than include it by the generated Makefile?

1) because it looks cleaner to me to have just one Makefile.

Well, after copying, we still have two... ;-)


2) because I was worried about the portability of including files inside Makefiles.

Then you should avoid looking at the eclib package, which does (really) horrible things... B)

(Sage won't build with anything else but GNU make anyway, and this will not change in the foreseeable future, since many upstream packages rely on GNU make as well.)

comment:22 follow-up: ↓ 23 Changed 14 months ago by leif

Any nice idea of how one could pass some flags just to the top-level make, but not to the instances building spkgs? (I'm thinking of -k.)

comment:23 in reply to: ↑ 22 Changed 14 months ago by jdemeyer

Replying to leif:

Any nice idea of how one could pass some flags just to the top-level make, but not to the instances building spkgs? (I'm thinking of -k.)

Assuming that spkg/Makefile exists:

cd spkg
MAKE="make -S" make -k

(not tested)

comment:24 Changed 14 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.0.beta10
Note: See TracTickets for help on using tickets.