Opened 3 years ago

Last modified 3 years ago

#21480 closed enhancement

Keep src/ clean by using --build-base when building sagelib — at Version 12

Reported by: mkoeppe Owned by:
Priority: blocker Milestone: sage-7.4
Component: build Keywords:
Cc: felixs, jdemeyer, fbissey, embray, leif, vbraun, dimpase, jhpalmieri, vdelecroix, saraedum, slabbe, nthiery, mmezzarobba Merged in:
Authors: Matthias Koeppe Reviewers:
Report Upstream: N/A Work issues:
Branch: u/mkoeppe/keep_src__clean_by_using___build_base_when_building_sagelib (Commits) Commit: e399bf41d805da7ea602daa5b554e0c7ecf2e7b5
Dependencies: Stopgaps:

Description (last modified by mkoeppe)

Currently, building sagelib creates the src/build directory, with subdirectories cython_debug, cythonized, lib.UNAME, temp.UNAME.

In preparation for VPATH builds of sage-the-distribution (#21469), let's keep src/ clean by using setup.py --build-base=$SAGE_BUILD_DIR/sagelib-VERSION

($SAGE_BUILD_DIR defaults to $SAGE_ROOT/var/tmp/sage/build/)

Some possibly useful information:

  • Documentation on distutils (https://docs.python.org/2/install/), describing use of --build-base to do VPATH builds.
  • pip install keeps the source directory clean, building instead in a temporary directory, by copying the sources. pip install also offers options --build to select a build directory (though it seems as if it does not work with all packages). However, there are some pip issues: 2060, 2053, 804 that affect this
  • #14807 has some tricks to making VPATH builds work without copying all python source files. But it uses automake instead of setup.sh; we will not do this in our ticket.

Change History (12)

comment:1 Changed 3 years ago by fbissey

Am interesting issue is that technically cython_debug has to be installed somewhere (preferably somewhere standard) to be accessible at runtime separately from the source.

I do something in sage-on-gentoo but that's not really satisfactory.

Last edited 3 years ago by fbissey (previous) (diff)

comment:2 in reply to: ↑ description ; follow-up: Changed 3 years ago by leif

Replying to mkoeppe:

In preparation for VPATH builds of sage-the-distribution (#21469), let's keep src/ clean by using setup.py --build-base=$SAGE_ROOT/var/tmp/sage/build/sagelib

Please use --build-base=$SAGE_BUILD_DIR/sagelib.

comment:3 Changed 3 years ago by leif

... and sagelib perhaps with a version suffix.

comment:4 in reply to: ↑ 2 ; follow-up: Changed 3 years ago by mkoeppe

Replying to leif:

Replying to mkoeppe:

In preparation for VPATH builds of sage-the-distribution (#21469), let's keep src/ clean by using setup.py --build-base=$SAGE_ROOT/var/tmp/sage/build/sagelib

Please use --build-base=$SAGE_BUILD_DIR/sagelib.

Yes, the plan *after* #21469 is to use the Sage builddir -- not just for sagelib, but also for other packages.

*Before* #21469 is merged, I want to use $SAGE_ROOT/var/tmp/sage/build/sagelib to match what other packages do.

comment:5 Changed 3 years ago by mkoeppe

  • Description modified (diff)

Ah, I see what you meant, now I've found $SAGE_BUILD_DIR. Changed description accordingly.

comment:6 in reply to: ↑ 4 ; follow-up: Changed 3 years ago by leif

Replying to mkoeppe:

Replying to leif:

Replying to mkoeppe:

In preparation for VPATH builds of sage-the-distribution (#21469), let's keep src/ clean by using setup.py --build-base=$SAGE_ROOT/var/tmp/sage/build/sagelib

Please use --build-base=$SAGE_BUILD_DIR/sagelib.

Yes, the plan *after* #21469 is to use the Sage builddir -- not just for sagelib, but also for other packages.

??? SAGE_BUILD_DIR exists since years already... (Its default is $SAGE_ROOT/var/tmp/sage/build/.)


*Before* #21469 is merged, I want to use $SAGE_ROOT/var/tmp/sage/build/sagelib to match what other packages do.

comment:7 in reply to: ↑ 6 Changed 3 years ago by mkoeppe

Replying to leif:

??? SAGE_BUILD_DIR exists since years already... (Its default is $SAGE_ROOT/var/tmp/sage/build/.)

Yes, thanks, see my other comment.

comment:8 Changed 3 years ago by leif

Ah ok, race condition.

comment:9 Changed 3 years ago by mkoeppe

By the way, help with implementing this change would be appreciated. I haven't looked at the sagelib build system at all so far.

comment:10 Changed 3 years ago by mkoeppe

  • Branch set to u/mkoeppe/keep_src__clean_by_using___build_base_when_building_sagelib

comment:11 Changed 3 years ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Commit set to e399bf41d805da7ea602daa5b554e0c7ecf2e7b5

New commits:

e399bf4First, wishful step

comment:12 Changed 3 years ago by mkoeppe

  • Description modified (diff)
Note: See TracTickets for help on using tickets.