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
transition to using install program #14804
Comments
Attachment: sage-dist-install.gz |
comment:2
Python distutils at least encapsulates the file operations in The alternative is to serialize the install phase and diff the Yet another possibility is to use separate install trees for each spkg in "sage-the-distribution", as in Nix or Stow. |
comment:3
Replying to @vbraun:
For example. but i have no idea how to "hook into that" yet without patching distutils. is there any python magic you have in mind?
Won't give me DESTDIR. serialization is one of the uglier hacks (no way). diff takes quadratic time (even less way).
Just complicates the issue. better is supporting no "install" at all (like sage-doc currently does). |
comment:4
Replying to @sagetrac-felixs:
You can patch it (Python / setuptools / whatever), but you don't necessarily have to, as most Python objects are mutable, including functions / methods, i.e., you can overwrite them... :-)
And you could e.g. do so in an spkg's |
comment:5
Replying to @nexttime:
I dont want to. I'd just patch upstream if it's completely hosed.
I don't quite understand. Are you proposing to patch the upstream package? (this would be worse, as it involves more than just distutils patching). I need something of the kind
or
within spkg-install. is this even possible? |
comment:6
Replying to @sagetrac-felixs:
Sure, I was just writing a post scriptum: And in the latter case, you wouldn't even have to patch / modify the spkg's / upstream's python <<EOF
# Do some stuff, e.g. modifying distutils.file_util.*
# (preferably importing an alternate implementation located elsewhere)
import sys
sys.argv = ["setup.py", "install"]
execfile("setup.py")
EOF Or just create a (shell) script that does similar, and call that instead of doing |
comment:7
P.P.S.: Of course, as is that relies on upstream only using distutils (at least to copy / install files), just like your custom |
comment:8
... but you may have to wrap Still, uninstalling an spkg by (just) removing the files it added (probably restoring those it deleted or modified, too) can easily break a Sage installation, but I guess you're aware of the pitfalls (that aren't specific to Sage)... |
comment:9
Attachment: sage-setup.py.gz Thanks Leif, I wasn't aware of that overriding possibility. Replying to @nexttime:
.. and lets see what else autotools uses |
comment:10
Replying to @sagetrac-felixs:
Note that your replacement (or wrapper) function will of course finally have to mimic the full behaviour of the original one, i.e., has to take the same optional arguments (with the same default values), and has to return a tuple. |
comment:11
Replying to @nexttime:
It is supposed to call the original function after it's done with file listing.
works, except for the default values... |
comment:12
Replying to @sagetrac-felixs:
... and infinite recursion. ;-) |
comment:13
Replying to @nexttime:
that was typed to fast, also some asterisks are missing. as it seems it even does the right thing wrt default values... |
comment:14
And indeed, |
comment:15
It may make sense to wrap the whole (depending on what else you intend to do) |
comment:16
There is now With these, most spkg-install scripts can be augmented to support both the #14796 build system (together with #14792) as well as the current one. Please have a look whether this could break anything. |
comment:17
This is now in git. It works for all packages I have tried with. |
Branch: u/felixs/sagedist |
Commit: |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:21
Needs to be rebased. |
comment:25
This was in a way trying to do what is now accomplished (in spirit--not so much in the details) by some combination of #23160 an #22509. I don't think this particular approach really fits in with what we're doing now. But thank you Felix for your early pioneering work on trying to fix Sage's build system... |
To keep track of installed files, it's probably most convenient to use a unified install program within all spkg-install scripts, like the one included within #14796.
For transitional purposes, the non-#14796 build-system should provide an install program within $PATH. I propose to place it as
sage-dist-install
into$SAGE_SRC/bin
. It should just ignore -F for now.For python-distutils packages, a setup.py wrapper is included.
CC: @nexttime @jondo
Component: distribution
Keywords: spkg-install filelist destdir
Author: Felix Salfelder
Branch/Commit: u/felixs/sagedist @
2584344
Issue created by migration from https://trac.sagemath.org/ticket/14804
The text was updated successfully, but these errors were encountered: