[Debian-science-sagemath] sympow cachedir

Ximin Luo infinity0 at debian.org
Sun Jan 8 02:13:00 UTC 2017


Tobias Hansen:
> On 01/07/2017 02:37 PM, Ximin Luo wrote:
>> 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
>>
> 
> Yes I had sympow 1.023-8 installed. I just did a test build of sage on
> amd64 and didn't have this problem. I'm ready to upload brial and then
> sagemath. Should I wait some more until you did a i386 build or go
> ahead? I could increase the failed-test threshold to 90 to make sure
> these failures don't mess up the i386 build.
> 

My i386 build was good with 51 failed tests. (Numpy was fixed recently so that means we have ~25 less failures now, so I think we don't need to increase the threshold to 90.)

However the overall build failed because the docbuild ran out of memory but didn't fail; it was only accidentally noticed by the "install" step. I've added a check for this in d/rules so it fails earlier. It should be fine on amd64, which is what the buildds use for arch-all builds in practise.

I'm happy to upload, I suggest you do a source-only upload though and have the buildds do everything. That's what I've been doing.

X

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



More information about the Debian-science-sagemath mailing list