[Debian-science-sagemath] Possible fix for fplll/fpylll issue with default strategy path

Ximin Luo infinity0 at debian.org
Mon Aug 7 19:40:00 UTC 2017


Ximin Luo:
> Ximin Luo:
>> Julien Puydt:
>>> Hi,
>>>
>>> I just pushed to fplll's Debian git repository a tentative 5.1.0-3 which
>>> would fix the recently reported issue with fpylll : I rewrote the patch
>>> for the default strategies path changes.
>>>
>>> I'm a bit at loss on how to check if that really fixes anything : I
>>> tried to build fpylll (success), but then trying to "import fpylll" in
>>> python gave:
>>> RuntimeError: You must get the file local/bin/sage-maxima.lisp
>>>
>>> so I can't really test seriously...
>>>
>>
>> I can reproduce this, it works if you uninstall sage (but of course we have to fix it properly).
>>
>> The underlying issue is caused by the fact that Sage sets things like SAGE_LOCAL outside of python itself, so that one gets e.g.:
>>
>> $ python -c 'from sage.env import DOT_SAGE, SAGE_SCRIPTS_DIR; print(SAGE_SCRIPTS_DIR)'
>> $SAGE_LOCAL/bin
>> $ sage -c 'from sage.env import DOT_SAGE, SAGE_SCRIPTS_DIR; print(SAGE_SCRIPTS_DIR)'
>> /usr/share/sagemath/bin
>>
>> I would guess that this also affects upstream Sage, but perhaps the issue is hidden somehow (Debian uses a different "sage-env" shell script).
>>
> 
> So for example this works, with sage installed:
> 
> $ SAGE_LOCAL=/usr SAGE_SCRIPTS_DIR=/usr/share/sagemath/bin python -c "import fpylll"
> # no errors, exit code 0
> 
> Now the question is, does Sage always expect that itself should be run via the "sage" program, with particular envvars set? 
> 
> If yes, then fpylll should run the "sage" version of itself after detecting the presence of these envvars - a simple "try: import sage; except ImportError" is not enough.
> 

I've pushed a slightly simpler fix to our git and opened a PR here: https://github.com/fplll/fpylll/pull/97

Also have built+uploaded fplll/fpylll to deb-sci-sage. Please upload them to sid & close this bug report when you are ready!

> If no (i.e. "import sage" etc should work in a plain python program), then sage should put its own "sage-env" shell script logic, into the "sage.env" python module instead, so that it gets run properly when things like "from sage.env import *" are done by third-party libs/programs. (And we in Debian would patch this logic for Debian paths.)
> 
> In both cases, this should be documented somewhere upstream in the Sage source code / documentation.
> 
> François & Jeroen (and any other Sage devs here), what do you think? Shall I file an upstream trac ticket about this?
> 
> (In any case, I think the fplll/fpylll bug is fixed, and we can upload + close #870698).
> 
X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



More information about the Debian-science-sagemath mailing list