[Debian-science-sagemath] sympow cachedir

Tobias Hansen thansen at debian.org
Sat Jan 7 13:18:46 UTC 2017


On 12/26/2016 05:37 PM, Jerome BENOIT wrote:
> Hello Forum
> 
> On 18/12/16 15:18, Jerome BENOIT wrote:
>> Hello, thanks for the precision.
> 
>> On 18/12/16 10:09, Ximin Luo wrote:
>>> Control: retitle -1 Document SYMPOW_CACHEDIR better and automatically try to create it
> 
>>> Jerome BENOIT:
>>>> Hello SymPow enthusiasts,
>>>>
>>>> On 17/12/16 15:46, Jerome BENOIT wrote:
>>>>>> It would be good if sympow could automatically create SYMPOW_CACHEDIR
>>>>>>> if it doesn't exist. Otherwise, I would have to add this logic to
>>>>>>> Sage, which seems a bit unclean.
>>>>> I not so sure that it is a good idea to create SYMPOW_CACHEDIR on the fly.
>>>>> Not that if SYMPOW_CACHEDIR does not exist, an appropraite message is printed.
>>>>
>>>>>>
>>>> I am on my way to add a mechanism to create SYMPOW_CACHEDIR on the fly
>>>> (that may avoid to add a dirty trick on Sage).
>>>>
> 
>>> Hey, thanks for this. To explain in some more detail: at the moment I have to patch Sage like this:
> 
>>> sage/src/sage/lfunctions/sympow.py:
>>> -        cmd = 'sympow %s'%args
>>> +        cmd = 'env HOME="%s" sympow %s' % (DOT_SAGE, args)
> 
>>> Setting HOME is ugly, it would be nicer to do this instead:
> 
>>> -        cmd = 'sympow %s'%args
>>> +        cmd = 'env SYMPOW_CACHEDIR="%s" sympow %s' % (os.path.join(DOT_SAGE, "sympow"), args)
> 
>>> However I can't, because sympow does not automatically create SYMPOW_CACHEDIR. I would have to do this instead:
> 
>>> -        cmd = 'sympow %s'%args
>>> +        cmd = 'mkdir "{0}" && env SYMPOW_CACHEDIR="{0}" sympow {1}'.format(os.path.join(DOT_SAGE, "sympow"), args)
> 
>>> Note, it's not necessary to create all the parent directories like what `mkdir -p` does. That is, if `dirname $SYMPOW_CACHEDIR` does not exist, I think it's fine that sympow fails - because there is no way to know what permissions (etc) to create parent directories with, it is a sysadmin and local policy issue, and it means there is a bug somewhere else.
> 
>>> However if `dirname $SYMPOW_CACHEDIR` does exist, then sympow should try to create SYMPOW_CACHEDIR inside it - it "controls" this directory, so it knows what permissions to use.
> 
>>> So actually, I think there is no bug in sympow regarding non-existent HOME. It is OK to fail, if HOME does not exist and SYMPOW_CACHEDIR is not set. It is better that during tests, SYMPOW_CACHEDIR is set explicitly in a Makefile, or by the parent process (Sage) which already has a "directory for testing" (DOT_SAGE).
> 
> 
>> I am working on it. It would be something like:
> 
>> cmd = 'env SYMPOW_CACHEDIR="%s///" sympow %s' % (os.path.join(DOT_SAGE, "sympow"), args)
> 
>> (Note the magic triplet `///').
>> Please give one more night: I want to implement something consistent and solid.
> 
> I needed more time, but I did.
> The new version is currently on its way to Sid.
> Note that a README.Debian has been introduced.
> 
> 

Ximin, you did the change in sagemath now, but during my last test build
on i386 I got the test failures in the attached file. Could you have
another look?

Best,
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sympow_failures.log
Type: text/x-log
Size: 26402 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-science-sagemath/attachments/20170107/1cf44838/attachment-0001.bin>


More information about the Debian-science-sagemath mailing list