Opened 9 years ago

Closed 8 years ago

#10492 closed enhancement (fixed)

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 Merged in: sage-5.0.beta10
Authors: Jeroen Demeyer Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #12479, #12602, #12608, #12609, #12712 Stopgaps:

Description (last modified by jdemeyer)

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 to SAGE_ROOT
  2. 10492_no_more_newest_version.patch to SCRIPTS.

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

Attachments (2)

10492_no_more_newest_version.patch (1.0 KB) - added by jdemeyer 8 years ago.
10492_deps_to_Makefile.patch (20.3 KB) - added by jdemeyer 8 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 Changed 9 years ago by jdemeyer

  • Component changed from build to scripts

comment:2 Changed 9 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 8 years ago by jdemeyer

  • Component changed from scripts to build
  • Description modified (diff)
  • Keywords deps Makefile added
  • 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 8 years ago by jdemeyer

  • Authors set to Jeroen Demeyer

Changed 8 years ago by jdemeyer

comment:5 Changed 8 years ago by jdemeyer

  • Description modified (diff)

comment:6 Changed 8 years ago by jdemeyer

  • Dependencies set to #12479, #12602

comment:7 Changed 8 years ago by jdemeyer

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

comment:8 Changed 8 years ago by jdemeyer

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

comment:9 Changed 8 years ago by jdemeyer

  • Status changed from new to needs_review

comment:10 Changed 8 years 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: Changed 8 years ago by jhpalmieri

  • Status changed from needs_review to needs_work

I think that make distclean should delete spkg/Makefile.

comment:12 Changed 8 years ago by jdemeyer

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

Changed 8 years ago by jdemeyer

comment:13 in reply to: ↑ 11 Changed 8 years 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 8 years ago by jhpalmieri

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

comment:15 Changed 8 years 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 8 years ago by leif

  • Cc leif added

comment:17 follow-up: Changed 8 years 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 8 years 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 8 years ago by jdemeyer

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

comment:20 in reply to: ↑ 17 ; follow-up: Changed 8 years 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 8 years 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: Changed 8 years 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 8 years 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 8 years ago by jdemeyer

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