[Debian-science-sagemath] sympow cachedir

Ximin Luo infinity0 at debian.org
Sat Jan 7 13:37:00 UTC 2017


Tobias Hansen:
> 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?
> 

I'm running a i386 build now, it'll be a while before it finishes though. Are you sure you have 1.023-8 installed?

X

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



More information about the Debian-science-sagemath mailing list