I've spent some time looking at hashdist which is probably the closest to 
what we need, but I don't think its the way to go for us right now. First, 
Sage depends on the LD_LIBRARY_PATH hack on too many places. Before that is 
fixed its hard to do anything with a real package management system. At the 
same time, hashdist isn't ready. Its version 0.2, which is incompatible to 
0.1, there is no documentation for writing builder plugins / API. And much 
of the source is, let's say, lightly documented with doctests being almost 
completely absent. And no parallel build support, ... But in the future we 
should definitely reconsider that, when these issues have been addressed on 
both sides.

What I don't like in hashdist is that the packages don't have a clear 
backing as Python classes in the code, which is related to not being able 
to customize the heck out of it. There is the school of thought that says 
you shouldn't be allowed to do anything that doesn't lead to provably 
correct hash->build maps, and everything must be stateless functional. 
Thats nice if you want a package manager for end users only, but that is 
IMHO not good enough for development purposes. I'd rather have to do an 
occasional "make clean" than an extra 10k file ops every time I test a 
change. Fundamentally, what does a package define? Its how to get the 
source code, the version of the source code, and how to turn the source 
into a binary. Right now, hashdist packages only have a hook into the third 
part. Why can't we override how hashing works, or where to get the source 
from? Yes that might allow you to break the promise of provably correct 
builds, but we are all adults here. As long as you build stuff in my home 
directory I ought to be able to break anything I want.

Not only is package == builder Python object a clear API to override all 
aspects of the package build, you then can't help yourself but load them 
all into an IPython session. I found that to be a really nice mechanism to 
debug and explore the whole packaging:
 

$ ./build/manager/sage-pkg shell
Python 2.7.5 (default, Feb 19 2014, 13:47:28) 
Type "copyright", "credits" or "license" for more information.

IPython 0.13.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
Loaded packages: atlas, autotools, boehm_gc, boost_cropped, bzip2, cddlib, 
cephes, cliquer, configure, conway_polynomials, cryptominisat, cvxopt, 
cython, database_cremona_ellcurve, database_gap, database_stein_watkins, 
database_stein_watkins_mini, database_symbolic_data, dateutil, docutils, 
dot2tex, ecl, eclib, ecm, elliptic_curves, fflas_ffpack, flint, flintqs, 
freetype, gap, gap_packages, gcc, gd, gdmodule, genus2reduction, gf2x, 
gfan, git, git_trac, givaro, glpk, gmp, graphs, gsl, iconv, iml, ipython, 
jinja2, jmol, lcalc, libfplll, libgap, libm4ri, libm4rie, libogg, libpng, 
libtheora, linbox, lrcalc, matplotlib, maxima, mcqd, mercurial, mpc, mpfi, 
mpfr, mpir, mpmath, ncurses, networkx, ntl, numpy, openssl, palp, pari, 
pari_galdata, pari_seadata_small, patch, pexpect, pillow, pkgconf, 
pkgconfig, polybori, polytopes_db, ppl, pycrypto, pygments, pynac, 
pyparsing, python, r, ratpoints, readline, rpy2, rubiks, sage_c_library, 
sage_mode, sage_noarch, sage_python_library, sagenb, sagetex, scipy, scons, 
setuptools, singular, six, sphinx, sqlalchemy, sqlite, symmetrica, sympow, 
sympy, tachyon, termcap, topcom, tornado, zlib, zn_poly

In [1]: ppl.config
Out[1]: 
Configuration:
- config.builder.check_script = spkg-check
- config.builder.install_script = spkg-install
- config.builder.type = SpkgInstallScript
- config.category = standard
- config.depends.hard = ['mpir', 'glpk']
- config.name = ppl
- config.source.tarball.name = ppl-1.1.tar.bz2
- config.source.tarball.sha1 = f76fbc2d374170771fed030b79a5ffac08d907bf
- config.source.version = 1.1

In [2]: type(ppl)
Out[2]: sage_pkg.package.spkg_install.SpkgInstallScript

In [3]: type(ppl).mro()
Out[3]: 
[sage_pkg.package.spkg_install.SpkgInstallScript,
 sage_pkg.package.sage_environment_mixin.SageEnvironmentMixin,
 sage_pkg.package.sage_mirror_mixin.SageMirrorMixin,
 sage_pkg.package.base.PackageBase,
 object]

In [4]: ppl.version_stamp
Out[4]: 'c2b217a0d2c918132a0af6189d5f9a74bce4c41f'

In [5]: ppl.get_all_dependencies()
Out[5]: (mpir, glpk)

In [6]: ppl.get_all_dependencies()[0] is mpir
Out[6]: True

In [7]: ppl.download()
http://www.sagemath.org/packages/upstream/ppl/ppl-1.1.tar.bz2
[............................................................]

In [8]: ppl.unpack()

In [10]: ppl.prepare()

In [11]: ppl.install()
====================================================
ppl
****************************************************
Host system:
Linux localhost.localdomain 3.14.4-200.fc20.x86_64 #1 SMP Tue May 13 
13:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
****************************************************
C compiler: gcc
C compiler version:
...
make[1]: Leaving directory 
`/home/vbraun/Code/sage/local/var/tmp/sage-build/ppl/ppl-1.1/m4'
Successfully installed ppl
Finished installing ppl.spkg

In [12]: 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to