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

Optionally build spkgs in $SAGE_BUILD_DIR #4949

Closed
sagetrac-mabshoff mannequin opened this issue Jan 7, 2009 · 84 comments
Closed

Optionally build spkgs in $SAGE_BUILD_DIR #4949

sagetrac-mabshoff mannequin opened this issue Jan 7, 2009 · 84 comments

Comments

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 7, 2009

$SAGE_ROOT/spkg/build can be slow in case it is NFS-mounted for example. So using local scratch space or even better a RAM disk should speed up the build by a nice factor. To do so, use $SAGE_BUILD_DIR instead of $SAGE_ROOT/spkg/build/.


Apply attachment: trac_4949-root.v5.patch and attachment: 4949_review.patch to the Sage root repository.

Apply attachment: trac_4949-installation.v3.patch to the Sage library.

CC: @sagetrac-drkirkby @nexttime

Component: build

Keywords: sd32

Author: John Palmieri

Reviewer: Mariah Lenox, Leif Leonhardy, Maarten Derickx, Jeroen Demeyer

Merged: sage-5.0.beta5

Issue created by migration from https://trac.sagemath.org/ticket/4949

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-3.3 milestone Jan 7, 2009
@sagetrac-mabshoff sagetrac-mabshoff mannequin self-assigned this Jan 7, 2009
@williamstein
Copy link
Contributor

comment:2

As a temporary hack to see how this "feels" you could delete spkg/build, then make it a symlink to /tmp/build/.

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri
Copy link
Member

comment:3

Here's a patch. This implements both SAGE_BUILD_TMPDIR and SAGE_KEEP_BUILT_SPKGS -- see #9444. (This is an incremental change rather than a complete reworking of the sage-spkg script, which might be called for.)

@jhpalmieri
Copy link
Member

comment:4

A little explanation: BUILD is defined (as "build") by sage-env, but it was used sporadically in sage-spkg. With this patch, it is used more consistently.

@qed777
Copy link
Mannequin

qed777 mannequin commented Aug 6, 2010

comment:5

If/when this merges, we should consider closing #6550. SAGE_KEEP_BUILT_SPKGS is a much better name than SAGE_KEEP_SPKG_BUILD.

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 6, 2010

comment:6

Nice to see progress in the build process... :)

See also #6550 comment:7 .

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 6, 2010

comment:7

Should SAGE_BUILD_TMPDIR default to SAGE_TMPDIR?

(We have btw. lots of - in some cases not very well-named - environment variables.)

Making use of e.g. a RAM disk (or some user-provided directory) for doctesting is also worth doing.

@qed777
Copy link
Mannequin

qed777 mannequin commented Aug 19, 2010

comment:8

Replying to @nexttime:

Making use of e.g. a RAM disk (or some user-provided directory) for doctesting is also worth doing.

You can already set SAGE_TESTDIR (or DOT_SAGE) to do this. Or maybe I misunderstand?

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 20, 2011

comment:9

[attachment: trac_4949-scripts.patch] does not apply:

sage: hg_sage.apply("/home/mariah/trac_4949-scripts.patch")
cd "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-core2-fc/devel/sage" && hg status
cd "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-core2-fc/devel/sage" && hg status
cd "/home/mariah/sage/sage-4.7.rc2-x86_64-Linux-core2-fc/devel/sage" && hg import   "/home/mariah/trac_4949-scripts.patch"
applying /home/mariah/trac_4949-scripts.patch
unable to find 'sage-spkg' for patching
5 out of 5 hunks FAILED -- saving rejects to file sage-spkg.rej
abort: patch failed to apply
sage: 

@sagetrac-mariah sagetrac-mariah mannequin modified the milestones: sage-4.7, sage-4.7.1 May 20, 2011
@jhpalmieri
Copy link
Member

comment:10

Here's a rebased version of attachment: trac_4949-scripts.patch. Note that it's for the scripts repository, so you have to apply it with "hg_scripts.apply(...)" rather than "hg_sage.apply(...)".

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 25, 2011

comment:11

I applied the patch attachment: trac_4949-scripts.patch, then moved
the modified sage-spkg file to a fresh source directory of sage-4.7.rc4. I set SAGE_BUILD_TMPDIR and SAGE_KEEP_BUILT_SPKGS, and
did 'make testlong'. The builds took place in the location SAGE_BUILD_TMPDIR and all tests passed. I applied the patch [attachment: trac_4949-installation.patch], did 'sage -b', then 'sage -docbuild installation html' and verified that the documentation change was made and makes sense. Positive review.

@sagetrac-mariah
Copy link
Mannequin

sagetrac-mariah mannequin commented May 25, 2011

Reviewer: Mariah Lenox

@sagetrac-mariah

This comment has been minimized.

@jhpalmieri

This comment has been minimized.

@jdemeyer
Copy link

comment:50

Lines 210 and 216 of sage-spkg: you have twice cd "$SAGE_BUILD_DIR". Remove the second and move the check (line 219) up, after the first cd. You probably want to "exit 1" if cd fails.

Line 227 of sage-spkg: replace

if [ -e "$dir" ]; then

by

if [ -d "$dir" ]; then

@jdemeyer
Copy link

comment:51

Line 235: why "mv -f" and not simply "mv"?

@jhpalmieri
Copy link
Member

comment:52

Replying to @jdemeyer:

Lines 210 and 216 of sage-spkg: you have twice cd "$SAGE_BUILD_DIR". Remove the second and move the check (line 219) up, after the first cd. You probably want to "exit 1" if cd fails.

Well, the old version had a second 'cd' command, justified by the comment

# Make triply sure that we are in the build directory before doing  
# a scary "rm -rf"

So I left the second one in. You think I should change this? In any case, you're right about the "exit 1".

Line 227 of sage-spkg: replace

if [ -e "$dir" ]; then

by

if [ -d "$dir" ]; then

On the off-chance that there is a file (not a directory) in the build directory with the wrong name, shouldn't we move it, too?

Replying to @jdemeyer:

Line 235: why "mv -f" and not simply "mv"?

Left over from the previous version. I can fix that.

@jhpalmieri
Copy link
Member

Attachment: trac_4949-root-delta4to5.patch.gz

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:53

Attachment: trac_4949-root.v5.patch.gz

@jdemeyer
Copy link

comment:54

Attachment: 4949_review.patch.gz

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Changed reviewer from Mariah Lenox, Leif Leonhardy, Maarten Derickx to Mariah Lenox, Leif Leonhardy, Maarten Derickx, Jeroen Demeyer

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title Optionally build spkgs in $SAGE_BUILD_TMPDIR Optionally build spkgs in $SAGE_BUILD_DIR Feb 15, 2012
@jhpalmieri
Copy link
Member

comment:56

The review patch looks okay to me.

@jdemeyer
Copy link

comment:57

Looks good to me too.

@jdemeyer
Copy link

Merged: sage-5.0.beta5

@jhpalmieri
Copy link
Member

comment:59

See #12637 for a followup.

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

6 participants