Opened 9 years ago

Closed 9 years ago

#12614 closed enhancement (fixed)

prereq should clean up its build directory

Reported by: jhpalmieri Owned by: GeorgSWeber
Priority: minor Milestone: sage-5.1
Component: build Keywords:
Cc: Merged in: sage-5.1.beta1
Authors: John Palmieri Reviewers: Keshav Kini
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

The prereq "spkg" should clean up its build directory, just like sage-spkg does for other spkgs.

Apply trac_12614-prereq.rebased.patch to the root repo.

Attachments (1)

trac_12614-prereq.rebased.patch (782 bytes) - added by kini 9 years ago.
apply to $SAGE_ROOT

Download all attachments as: .zip

Change History (11)

comment:1 Changed 9 years ago by jhpalmieri

  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 follow-up: Changed 9 years ago by Snark

I tried your patch, and it doesn't look like it works : I still have the bzip2 and prereq sources in $SAGE_ROOT/spkg/build, although they have been built long ago.

Where is $SAGE_BUILD_DIR defined?

Shouldn't it be $BUILD, as used in the rest of the bzip2-1.0.5-install script?

Aside: is it normal that neither bzip2 nor prereq prints "Successfully installed ..." when it succeeds, as do all other spkg?

comment:3 in reply to: ↑ 2 Changed 9 years ago by jhpalmieri

Replying to Snark:

I tried your patch, and it doesn't look like it works : I still have the bzip2 and prereq sources in $SAGE_ROOT/spkg/build, although they have been built long ago.

The patch here will only do something when those packages are actually built. So you could take a fresh Sage tar ball, apply this patch to the SAGE_ROOT directory, then type make. The bzip2 and prereq subdirectories of spkg/build should be created and then deleted when those packages are successfully built.

I guess you should be able to force installation of those packages in an existing Sage installation, maybe by running sage -sh and then $SAGE_ROOT/spkg/base/prereq-0.9-install, for example. That should clean up spkg/base/prereq-0.9.

Where is $SAGE_BUILD_DIR defined?

Shouldn't it be $BUILD, as used in the rest of the bzip2-1.0.5-install script?

Sorry, I forgot to list #4949 as a dependency. That ticket changes $BUILD to $SAGE_BUILD_DIR.

Aside: is it normal that neither bzip2 nor prereq prints "Successfully installed ..." when it succeeds, as do all other spkg?

I don't know about "normal". The issue is that most spkgs are installed by the script sage-spkg, but prereq and bzip2 are not, because (for example) sage-spkg tries to bunzip spkgs, so we shouldn't use it on bzip2. The sage-spkg script is responsible for printing messages like this, as well as for deleting the temporary build directories, and the patch here is trying to make at least part of the installation of bzip2 and prereq act like other spkgs.

comment:4 Changed 9 years ago by Snark

I know how to apply a patch, and I tested it on a just-untarred sage -- the fact that you forgot the patch dependency is definitely the reason why it failed. I'm not sure I'll have the time to give it another go right now.

Notice that I generally untar tar.* (and spkg) files with "tar xaf <filename>" -- the 'a' meaning 'automatic decompression method', so I don't have to tell it what to do (no xzf, no xjf).

If that 'a' switch is available in the tar implementation of all sage platforms :

  • sage-spkg could use that switch (instead of the complicated "bunzip2 | tar" it uses now;
  • bzip2 could be made an almost-normal spkg, just different in that it's the only one which isn't a .tar.bz2 but a .tar.gz

Wouldn't that fix that bug nicely too?

comment:5 Changed 9 years ago by Snark

I'm really not sure the 'a' option is standard ; and the might not be either, so indeed one probably has to use the bunzip2 | tar trick :-/

Still, the current sage-spkg does :

bunzip2 -c "$PKG_SRC" 2>/dev/null | tar fx${UNTAR_VERBOSE} -  2>/dev/null
if [ ! -d "$PKG_NAME" ]; then
    tar fx${UNTAR_VERBOSE} "$PKG_SRC"
fi

but perhaps it could do :

tar fx${UNTAR_VERBOSE} "$PKG_SRC"
if [ ! -d "$PKG_NAME" ]; then
  tar fxz${UNTAR_VERBOSE} "$PKG_SRC"
fi

if [ ! -d "$PKG_NAME" ]; then
  bunzip2 -c "$PKG_SRC" 2>/dev/null | tar fx${UNTAR_VERBOSE} -  2>/dev/null
fi

That way it could handle three levels of compressions -- and if bzip2 is the first package it meets, then it could handle it, and then the rest of the packages would work with the last step.

comment:6 Changed 9 years ago by jhpalmieri

  • Description modified (diff)
  • Summary changed from bzip2 and prereq should clean up their build directories to prereq should clean up its build directory

See #12102 for the bzip2 issue.

Changed 9 years ago by kini

apply to $SAGE_ROOT

comment:7 Changed 9 years ago by kini

Rebased to Sage 5.0. Now testing. (Thanks to Snark for mentioning this on IRC.)

comment:8 Changed 9 years ago by kini

  • Reviewers set to Keshav Kini
  • Status changed from needs_review to positive_review

Looks good to me. Positive review!

comment:9 Changed 9 years ago by jdemeyer

  • Description modified (diff)
  • Milestone changed from sage-5.0 to sage-5.1

comment:10 Changed 9 years ago by jdemeyer

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