Re: [sage-devel] Factoring for Fun and Profit

2022-05-31 Thread ph h
Hi,

> When SAGE_ROOT is not available, "sage --advanced" will not show the
commands for rebuilding Sage, which need SAGE_ROOT.

and any other options like "sage --coverageall", :sage --testall", ... and
what else?

Not only that  "sage --advanced" will not show the options but also 'sage'
should NOT attempt to do them (when the users insist) with error messages.
'Sage' should instead give some wise advice and gracefully exits(?):

" For this option to work, you need '$SAGE_ROOT' which is not available on
your system right now.
(In case you are testing me, you know that I know what you are doing,
please 'mv beta1_ beta1' (smiley))"

Cheers,

phiho



On Tue, May 31, 2022 at 2:44 PM Matthias Koeppe 
wrote:

> On Tuesday, May 31, 2022 at 10:45:47 AM UTC-7 hohoa...@gmail.com wrote:
>
>> > "It is not supported to move the SAGE_ROOT or SAGE_LOCAL directory
>> after building Sage. If you do move the directories, you will have to
>> run make distclean and build Sage again from scratch."
>>
>> So, practically speaking, BOTH "$SAGE_ROOT" and "$SAGE_LOCAL" are part of
>> the 'sage' installation?
>>
>
> SAGE_LOCAL is the self-contained Sage installation.
>
> You need SAGE_ROOT only if you want to refer back to the source or rebuild
> Sage.
>
> However, when both are available:
>> ~/sage-9.7$ local.beta1 --advanced | wc -l
>> 242
>>
>> and when "$SAGE_ROOT" is renamed to "$SAGE_ROOT"_:
>> ~/sage-9.7$ local1 --advanced | wc -l
>>
> 154
>> What are these missing 88(?) lines in "sage --advanced"?
>>
>
> When SAGE_ROOT is not available, "sage --advanced" will not show the
> commands for rebuilding Sage, which need SAGE_ROOT.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/0be69090-6dc3-487c-be56-ad68fb0fa87an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1b5bPTGT1jB8OJz%2BR%2BU15mNjsBOj%2BVpXk1Jc3kWPogKdA%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-31 Thread Matthias Koeppe
On Tuesday, May 31, 2022 at 10:45:47 AM UTC-7 hohoa...@gmail.com wrote:

> > "It is not supported to move the SAGE_ROOT or SAGE_LOCAL directory after 
> building Sage. If you do move the directories, you will have to run make 
> distclean and build Sage again from scratch."
>
> So, practically speaking, BOTH "$SAGE_ROOT" and "$SAGE_LOCAL" are part of 
> the 'sage' installation?
>

SAGE_LOCAL is the self-contained Sage installation.
 
You need SAGE_ROOT only if you want to refer back to the source or rebuild 
Sage.

However, when both are available:
> ~/sage-9.7$ local.beta1 --advanced | wc -l
> 242
>
> and when "$SAGE_ROOT" is renamed to "$SAGE_ROOT"_:
> ~/sage-9.7$ local1 --advanced | wc -l
>
154
> What are these missing 88(?) lines in "sage --advanced"?
>

When SAGE_ROOT is not available, "sage --advanced" will not show the 
commands for rebuilding Sage, which need SAGE_ROOT.

 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/0be69090-6dc3-487c-be56-ad68fb0fa87an%40googlegroups.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-31 Thread ph h
Hi,

> "It is not supported to move the SAGE_ROOT or SAGE_LOCAL directory after
building Sage. If you do move the directories, you will have to run make
distclean and build Sage again from scratch."

So, practically speaking, BOTH "$SAGE_ROOT" and "$SAGE_LOCAL" are part of
the 'sage' installation?
However, when both are available:

~/sage-9.7$ root.beta1 --advanced | wc -l
242
~/sage-9.7$ local.beta1 --advanced | wc -l
242

and when "$SAGE_ROOT" is renamed to "$SAGE_ROOT"_:

~/sage-9.7$ mv beta1 beta1_
~/sage-9.7$ root.beta1 --advanced
-bash: /home/hph/bin/root.beta1: No such file or directory
~/sage-9.7$ local1 --advanced | wc -l
154
~/sage-9.7$

What are these missing 88(?) lines in "sage --advanced"?

Thank you for your help.

Regards,

phiho







On Tue, May 31, 2022 at 1:20 PM Matthias Koeppe 
wrote:

> https://github.com/sagemath/sage#relocation
> "It is not supported to move the SAGE_ROOT or SAGE_LOCAL directory after
> building Sage. If you do move the directories, you will have to run make
> distclean and build Sage again from scratch."
>
>
> On Tuesday, May 31, 2022 at 10:15:57 AM UTC-7 hohoa...@gmail.com wrote:
>
>> Dear All,
>>
>> A plain vanilla Sage 9.7 Beta1 was built from "~/sage-9.7$/beta1" which
>> then is renamed to "~/sage-9.7$/beta1_"
>> "root.beta1" is a symlink to "$SAGE_ROOT/sage" and "local.beta1" is a
>> symlink to "$SAGE_LOCAL/bin/sage".
>>
>> Please find appended below the scenario when some of the 'sage' options
>> were tried.
>> Is the outcome expected or is it just something that happens only on this
>> machine?
>>
>> Please note that "--coverageall" and "--testall"  are
>> available, according to "sage --advanced" which does not show "--sdist"
>> (but this user is familiar with it and has been using it)
>>
>> Thank you for your help.
>>
>> Regards,
>>
>> phiho
>>
>> ~/sage-9.7$ mv beta1 beta1_
>> ~/sage-9.7$ root.beta1
>> -bash: /home/hph/bin/root.beta1: No such file or directory
>>
>> ~/sage-9.7$ local.beta1 --coverageall
>> Traceback (most recent call last):
>>   File "/mnt/g/Maths/sage-9.7/beta1/bin/sage-coverage", line 60, in
>> 
>> coverage_all(os.path.join(os.environ["SAGE_SRC"], 'sage'))
>>   File "/usr/lib/python3.10/os.py", line 679, in __getitem__
>> raise KeyError(key) from None
>> KeyError: 'SAGE_SRC'
>>
>> ~/sage-9.7$ local.beta1 --sdist
>> /home/hph/bin/local.beta1: line 994: exec: sage-sdist: not found
>>
>> ~/sage-9.7$ local.beta1 --testall
>> too many failed tests, not using stored timings
>> Running doctests with ID 2022-05-31-12-38-54-59a8fb70.
>> Using --optional=pip,sage
>> Features to be detected:
>> 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,gfan,graphviz,imagemagick,jupymake,kenzo,latte_int,lrslib,mcqd,meataxe,nauty,palp,pandoc,pdf2svg,pdftocairo,phitigra,plantri,polytopes_db,polytopes_db_4d,pynormaliz,python_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.plot,sage.rings.number_field,sage.rings.padics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,sphinx,tdlib
>> Doctesting entire Sage library.
>> Traceback (most recent call last):
>>   File "/mnt/g/Maths/sage-9.7/beta1/bin/sage-runtests", line 151, in
>> 
>> err = DC.run()
>>   File
>> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
>> line 1343, in run
>> self.add_files()
>>   File
>> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
>> line 840, in add_files
>> all_files()
>>   File
>> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
>> line 823, in all_files
>> import sage_docbuild
>>   File
>> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage_docbuild/__init__.py",
>> line 59, in 
>> from .build_options import (LANGUAGES, SPHINXOPTS, OMIT,
>>   File
>> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage_docbuild/build_options.py",
>> line 9, in 
>> LANGUAGES = [d for d in os.listdir(SAGE_DOC_SRC) if
>> re.match('^[a-z][a-z]$', d)]
>> FileNotFoundError: [Errno 2] No such file or directory: 'src/doc'
>> ~/sage-9.7$
>>
>>
>> On Tue, May 10, 2022 at 4:46 PM Michael Orlitzky 
>> wrote:
>>
>>> On Tue, 2022-05-10 at 09:54 -0700, John H Palmieri wrote:
>>> > Regarding the very last question: the decision many years ago was that
>>> the
>>> > startup scripts for Sage should be shell scripts, because using Python
>>> > scripts seemed to add to the startup time. If anyone wants to change
>>> this,
>>> > they need to do some careful evaluations and comparisons regarding
>>> startup
>>> > times.
>>> > > > > >
>>>
>>> Keep in mind also the recent thread about "make build". Many people
>>> still believe that "sage -i" should be able to install python for them.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "sage-devel" 

Re: [sage-devel] Factoring for Fun and Profit

2022-05-31 Thread Matthias Koeppe
https://github.com/sagemath/sage#relocation
"It is not supported to move the SAGE_ROOT or SAGE_LOCAL directory after 
building Sage. If you do move the directories, you will have to run make 
distclean and build Sage again from scratch."


On Tuesday, May 31, 2022 at 10:15:57 AM UTC-7 hohoa...@gmail.com wrote:

> Dear All,
>
> A plain vanilla Sage 9.7 Beta1 was built from "~/sage-9.7$/beta1" which 
> then is renamed to "~/sage-9.7$/beta1_"
> "root.beta1" is a symlink to "$SAGE_ROOT/sage" and "local.beta1" is a 
> symlink to "$SAGE_LOCAL/bin/sage".
>
> Please find appended below the scenario when some of the 'sage' options 
> were tried.
> Is the outcome expected or is it just something that happens only on this 
> machine?
>
> Please note that "--coverageall" and "--testall"  are available, according 
> to "sage --advanced" which does not show "--sdist" (but this user is 
> familiar with it and has been using it)
>
> Thank you for your help.
>
> Regards,
>
> phiho
>
> ~/sage-9.7$ mv beta1 beta1_
> ~/sage-9.7$ root.beta1
> -bash: /home/hph/bin/root.beta1: No such file or directory
>
> ~/sage-9.7$ local.beta1 --coverageall
> Traceback (most recent call last):
>   File "/mnt/g/Maths/sage-9.7/beta1/bin/sage-coverage", line 60, in 
> 
> coverage_all(os.path.join(os.environ["SAGE_SRC"], 'sage'))
>   File "/usr/lib/python3.10/os.py", line 679, in __getitem__
> raise KeyError(key) from None
> KeyError: 'SAGE_SRC'
>
> ~/sage-9.7$ local.beta1 --sdist
> /home/hph/bin/local.beta1: line 994: exec: sage-sdist: not found
>
> ~/sage-9.7$ local.beta1 --testall
> too many failed tests, not using stored timings
> Running doctests with ID 2022-05-31-12-38-54-59a8fb70.
> Using --optional=pip,sage
> Features to be detected: 
> 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,gfan,graphviz,imagemagick,jupymake,kenzo,latte_int,lrslib,mcqd,meataxe,nauty,palp,pandoc,pdf2svg,pdftocairo,phitigra,plantri,polytopes_db,polytopes_db_4d,pynormaliz,python_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.plot,sage.rings.number_field,sage.rings.padics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,sphinx,tdlib
> Doctesting entire Sage library.
> Traceback (most recent call last):
>   File "/mnt/g/Maths/sage-9.7/beta1/bin/sage-runtests", line 151, in 
> 
> err = DC.run()
>   File 
> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
>  
> line 1343, in run
> self.add_files()
>   File 
> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
>  
> line 840, in add_files
> all_files()
>   File 
> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
>  
> line 823, in all_files
> import sage_docbuild
>   File 
> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage_docbuild/__init__.py",
>  
> line 59, in 
> from .build_options import (LANGUAGES, SPHINXOPTS, OMIT,
>   File 
> "/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage_docbuild/build_options.py",
>  
> line 9, in 
> LANGUAGES = [d for d in os.listdir(SAGE_DOC_SRC) if 
> re.match('^[a-z][a-z]$', d)]
> FileNotFoundError: [Errno 2] No such file or directory: 'src/doc'
> ~/sage-9.7$
>
>
> On Tue, May 10, 2022 at 4:46 PM Michael Orlitzky  
> wrote:
>
>> On Tue, 2022-05-10 at 09:54 -0700, John H Palmieri wrote:
>> > Regarding the very last question: the decision many years ago was that 
>> the 
>> > startup scripts for Sage should be shell scripts, because using Python 
>> > scripts seemed to add to the startup time. If anyone wants to change 
>> this, 
>> > they need to do some careful evaluations and comparisons regarding 
>> startup 
>> > times.
>> > > > > > 
>>
>> Keep in mind also the recent thread about "make build". Many people
>> still believe that "sage -i" should be able to install python for them.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/298a04c7a9808fd8f61a0588ce1ae014e4a53db7.camel%40orlitzky.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/07b2aa47-7707-43a1-ae4e-62b26bf23049n%40googlegroups.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-31 Thread ph h
Dear All,

A plain vanilla Sage 9.7 Beta1 was built from "~/sage-9.7$/beta1" which
then is renamed to "~/sage-9.7$/beta1_"
"root.beta1" is a symlink to "$SAGE_ROOT/sage" and "local.beta1" is a
symlink to "$SAGE_LOCAL/bin/sage".

Please find appended below the scenario when some of the 'sage' options
were tried.
Is the outcome expected or is it just something that happens only on this
machine?

Please note that "--coverageall" and "--testall"  are available, according
to "sage --advanced" which does not show "--sdist" (but this user is
familiar with it and has been using it)

Thank you for your help.

Regards,

phiho

~/sage-9.7$ mv beta1 beta1_
~/sage-9.7$ root.beta1
-bash: /home/hph/bin/root.beta1: No such file or directory

~/sage-9.7$ local.beta1 --coverageall
Traceback (most recent call last):
  File "/mnt/g/Maths/sage-9.7/beta1/bin/sage-coverage", line 60, in 
coverage_all(os.path.join(os.environ["SAGE_SRC"], 'sage'))
  File "/usr/lib/python3.10/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'SAGE_SRC'

~/sage-9.7$ local.beta1 --sdist
/home/hph/bin/local.beta1: line 994: exec: sage-sdist: not found

~/sage-9.7$ local.beta1 --testall
too many failed tests, not using stored timings
Running doctests with ID 2022-05-31-12-38-54-59a8fb70.
Using --optional=pip,sage
Features to be detected:
4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,gfan,graphviz,imagemagick,jupymake,kenzo,latte_int,lrslib,mcqd,meataxe,nauty,palp,pandoc,pdf2svg,pdftocairo,phitigra,plantri,polytopes_db,polytopes_db_4d,pynormaliz,python_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.groups,sage.plot,sage.rings.number_field,sage.rings.padics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,sagemath_doc_html,sphinx,tdlib
Doctesting entire Sage library.
Traceback (most recent call last):
  File "/mnt/g/Maths/sage-9.7/beta1/bin/sage-runtests", line 151, in

err = DC.run()
  File
"/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
line 1343, in run
self.add_files()
  File
"/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
line 840, in add_files
all_files()
  File
"/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage/doctest/control.py",
line 823, in all_files
import sage_docbuild
  File
"/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage_docbuild/__init__.py",
line 59, in 
from .build_options import (LANGUAGES, SPHINXOPTS, OMIT,
  File
"/mnt/g/Maths/sage-9.7/beta1/lib/python3.10/site-packages/sage_docbuild/build_options.py",
line 9, in 
LANGUAGES = [d for d in os.listdir(SAGE_DOC_SRC) if
re.match('^[a-z][a-z]$', d)]
FileNotFoundError: [Errno 2] No such file or directory: 'src/doc'
~/sage-9.7$


On Tue, May 10, 2022 at 4:46 PM Michael Orlitzky 
wrote:

> On Tue, 2022-05-10 at 09:54 -0700, John H Palmieri wrote:
> > Regarding the very last question: the decision many years ago was that
> the
> > startup scripts for Sage should be shell scripts, because using Python
> > scripts seemed to add to the startup time. If anyone wants to change
> this,
> > they need to do some careful evaluations and comparisons regarding
> startup
> > times.
> > > > > >
>
> Keep in mind also the recent thread about "make build". Many people
> still believe that "sage -i" should be able to install python for them.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/298a04c7a9808fd8f61a0588ce1ae014e4a53db7.camel%40orlitzky.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1Yt4siyXpGOkKdn7Mqr0%3Dfjdg4LKiep7PX_i4A9Zd8_cw%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-11 Thread Matthias Koeppe
On Tuesday, May 10, 2022 at 1:46:55 PM UTC-7 Michael Orlitzky wrote:

> Keep in mind also the recent thread about "make build". Many people 
> still believe that "sage -i" should be able to install python for them.


This is not actually related because Sage needs a version of python as a 
build prerequisite.
This is "sage-bootstrap-python".

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/daeff9d9-70fb-4381-8ea9-e296c9500689n%40googlegroups.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-10 Thread Michael Orlitzky
On Tue, 2022-05-10 at 09:54 -0700, John H Palmieri wrote:
> Regarding the very last question: the decision many years ago was that the 
> startup scripts for Sage should be shell scripts, because using Python 
> scripts seemed to add to the startup time. If anyone wants to change this, 
> they need to do some careful evaluations and comparisons regarding startup 
> times.
> > > > > 

Keep in mind also the recent thread about "make build". Many people
still believe that "sage -i" should be able to install python for them.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/298a04c7a9808fd8f61a0588ce1ae014e4a53db7.camel%40orlitzky.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-10 Thread Michael Orlitzky
On Tue, 2022-05-10 at 00:41 -0400, ph h wrote:
> 
> and exported:
> 
> export READLINKPY=$SAGE_ROOT/readlink.py
> 
> 

How do you know $SAGE_ROOT? That's what we're trying to determine in
the first place.

This is a code smell, and an easy problem to fix, but to be blunt:
you're not going to fix it. We need an adult in charge of the sage
build system first. Other packages don't have this problem because they
can substitute the correct path into the scripts at build/install time.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/e9e03cf024a5699234759fadcd34ef42aa665379.camel%40orlitzky.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-09 Thread ph h
  Hi,

>  running sage from a symlink is something that should be supported

Absolutely, yes.

In a hurry she forgot to mention that :

SELF=$(cd `dirname $0` ; pwd)/`basename $0`

is for the links from within $SAGE_ROOT only, of course any link from
outside would need to be resolved with 'resolvelinks'.
Unless this 'readlink.py' works on all platforms that 'sage' supports:


#!/usr/bin/python
import sys, os

thispath=sys.argv[1]

if os.path.islink( thispath  ):
 thispath  =os.readlink( thispath  )
else:
 thispath  =os.path.abspath( thispath  )

print( thispath  )


and in top level 'sage', it is embedded:

readlink() { cat << READLINK
import sys, os
thispath="$0"

if os.path.islink(thispath):
thispath=os.readlink(thispath)
else:
thispath=os.path.abspath(thispath)

print(thispath)

READLINK
}

SELF=`readlink | python3`

and exported:

export READLINKPY=$SAGE_ROOT/readlink.py

in 'sage.src.bin.sage':

SELF=`$READLINKPY "${0}"`

In 'sage.src.bin.sage-env':

DOT_SAGE=`$READLINKPY "$HOME/.sage"
nodeenv_activate=`$READLINKPY "$nodeenv_activate"`

Is 'resolvelinks' better than Python 'os.readlink()'? Are there any issues
with  the latter?
Would it be nice if 'Sage' has more Python code?

Regards,

phiho


On Wed, May 4, 2022 at 8:15 AM Michael Orlitzky 
wrote:

> On Wed, 2022-05-04 at 01:56 -0400, ph h wrote:
> > Hi,
> >
> > > Sadly, readlink is not a POSIX standard utility; otherwise we would
> > > already be using it in place of resolvelinks().
> >
> > In that case, please try this:
> >
> > #SELF=$(readlink -f $0)
> > SELF=$(cd `dirname $0` ; pwd)/`basename $0`
> >
>
> That will fail if $0 is a symlink, because `dirname $0` will get the
> directory that contains the symlink itself and not its target.
>
> Our installation instructions suggest creating such a symlink:
>
>   https://doc.sagemath.org/html/en/installation/source.html
>
> I don't have much nice to say about that installation procedure, but
> running sage from a symlink is something that should be supported
> regardless of how it was installed.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/c4295d4a6af9e3b69c72b4f4ba425325d52e5634.camel%40orlitzky.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1ZtB9ybXYgqiFUkx8g3Mx4j80qoQjWTd_vb8V4Bgsno7Q%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-04 Thread Michael Orlitzky
On Wed, 2022-05-04 at 01:56 -0400, ph h wrote:
> Hi,
> 
> > Sadly, readlink is not a POSIX standard utility; otherwise we would
> > already be using it in place of resolvelinks().
> 
> In that case, please try this:
> 
> #SELF=$(readlink -f $0)
> SELF=$(cd `dirname $0` ; pwd)/`basename $0`
> 

That will fail if $0 is a symlink, because `dirname $0` will get the
directory that contains the symlink itself and not its target.

Our installation instructions suggest creating such a symlink:

  https://doc.sagemath.org/html/en/installation/source.html

I don't have much nice to say about that installation procedure, but
running sage from a symlink is something that should be supported
regardless of how it was installed.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/c4295d4a6af9e3b69c72b4f4ba425325d52e5634.camel%40orlitzky.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread ph h
Hi,

> Sadly, readlink is not a POSIX standard utility; otherwise we would
> already be using it in place of resolvelinks().

In that case, please try this:

#SELF=$(readlink -f $0)
SELF=$(cd `dirname $0` ; pwd)/`basename $0`

So far 'sage --coverageall', 'sage --sdist', './configure' and make is
churning along happily:

~/sage-9.6/git/rc3/sage.mod8$ ls -l logs/pkgs/
total 524
-rw-rw-rw- 1 hph hph  13791 May  4 01:43 ccache-3.3.4.log
-rw-rw-rw- 1 hph hph 107491 May  4 01:51 cython-0.29.28.log
-rw-rw-rw- 1 hph hph  0 May  4 01:43 flint-2.8.4.log
-rw-rw-rw- 1 hph hph   4728 May  4 01:45 flit_core-3.4.0.log
-rw-rw-rw- 1 hph hph   9167 May  4 01:47 gmpy2-2.1.1.log
-rw-rw-rw- 1 hph hph  13366 May  4 01:46 packaging-21.3.log
-rw-rw-rw- 1 hph hph   4473 May  4 01:52 pari-2.13.3.log
-rw-rw-rw- 1 hph hph   3352 May  4 01:51 pari_galdata-20080411.p0.log
-rw-rw-rw- 1 hph hph   3430 May  4 01:51 pari_seadata_small-20090618.p0.log
-rw-rw-rw- 1 hph hph 128307 May  4 01:45 pip-22.0.2.log
-rw-rw-rw- 1 hph hph   9690 May  4 01:46 pyparsing-3.0.6.log
-rw-rw-rw- 1 hph hph 107180 May  4 01:44 setuptools-59.8.0.log
-rw-rw-rw- 1 hph hph  11881 May  4 01:47 setuptools_scm-6.3.2.log
-rw-rw-rw- 1 hph hph  40502 May  4 01:46 setuptools_wheel-59.8.0.log
-rw-rw-rw- 1 hph hph   4625 May  4 01:45 tomli-1.2.1.log
-rw-rw-rw- 1 hph hph  19554 May  4 01:44 wheel-0.37.0.log
~/sage-9.6/git/rc3/sage.mod8$ ls -l logs/pkgs/ | wc -l
17
~/sage-9.6/git/rc3/sage.mod8$

She will be out of brane in the next few weeks, please allow her to catch
up upon her return.

Thank you for your help.

Regards,

phiho


On Tue, May 3, 2022 at 7:39 PM Michael Orlitzky 
wrote:

> On Tue, 2022-05-03 at 14:30 -0700, ph h wrote:
> >
> > *SELF=$(readlink -f $0)
>
> Sadly, readlink is not a POSIX standard utility; otherwise we would
> already be using it in place of resolvelinks().
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-devel/CuYOEY5pfdI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/5e9947445de86811f34c05e204f8e45c100e421d.camel%40orlitzky.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1Y01AzkBufFQ29BQUz-pMjhr-8%3Db8AvAhZug2RtVZk0ig%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread Michael Orlitzky
On Tue, 2022-05-03 at 22:21 -0400, ph h wrote:
> > Those are C functions:
> > https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html
> 
> Is it installable at configuration time?

It just means that those functions are "guaranteed" to be present in
the C standard library on most unix-like systems. It's not something
that can be used directly by a shell script.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/783ebe4528d69be9164e0910ea39d75406530f61.camel%40orlitzky.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread Michael Orlitzky
On Tue, 2022-05-03 at 21:07 -0400, ph h wrote:
> Hi,
> 
> > Sadly, readlink is not a POSIX standard utility; otherwise we would
> > already be using it in place of resolvelinks().
> 
> Thank you so much. That's the constraint that Sage must face.
> 
> BTW, which of the platforms that Sage supports do not have readlink?
> 

I think the macOS/BSD implementation does something different or is
missing the "-f" flag or something like that.

We would have the same problem with any shell function though. Python
packaging just isn't equipped to handle it, and probably never will be.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/f762af98308c6532a6c9d486dde82506dd0cd68d.camel%40orlitzky.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread ph h
> Those are C functions:
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html

Is it installable at configuration time?
Which of the platforms that Sage supports do not have readlink?



On Tue, May 3, 2022 at 10:18 PM Michael Orlitzky 
wrote:

> On Tue, 2022-05-03 at 21:33 -0400, ph h wrote:
> > P.S:  What does this mean? Thanks.
> >
> > https://man7.org/linux/man-pages/man2/readlink.2.html
> > CONFORMING TO top
> > 
> >
> >*readlink*(): 4.4BSD (*readlink*() first appeared in 4.2BSD),
> >POSIX.1-2001, POSIX.1-2008.
> >
> >*readlinkat*(): POSIX.1-2008.
> >
> >
>
> Those are C functions:
>
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/d623b4c02c132d66b9f6cbe4ad0c256f58fa26f1.camel%40orlitzky.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1bzDuM6-4VobJ7XhUNg%2BdkR66GfJx_FvT%2BhaY-QAqcbZQ%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread Michael Orlitzky
On Tue, 2022-05-03 at 21:33 -0400, ph h wrote:
> P.S:  What does this mean? Thanks.
> 
> https://man7.org/linux/man-pages/man2/readlink.2.html
> CONFORMING TO top
> 
> 
>*readlink*(): 4.4BSD (*readlink*() first appeared in 4.2BSD),
>POSIX.1-2001, POSIX.1-2008.
> 
>*readlinkat*(): POSIX.1-2008.
> 
> 

Those are C functions:

https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d623b4c02c132d66b9f6cbe4ad0c256f58fa26f1.camel%40orlitzky.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread ph h
P.S:  What does this mean? Thanks.

https://man7.org/linux/man-pages/man2/readlink.2.html
CONFORMING TO top


   *readlink*(): 4.4BSD (*readlink*() first appeared in 4.2BSD),
   POSIX.1-2001, POSIX.1-2008.

   *readlinkat*(): POSIX.1-2008.



On Tue, May 3, 2022 at 9:07 PM ph h  wrote:

> Hi,
>
> > Sadly, readlink is not a POSIX standard utility; otherwise we would
> > already be using it in place of resolvelinks().
>
> Thank you so much. That's the constraint that Sage must face.
>
> BTW, which of the platforms that Sage supports do not have readlink?
>
> Regards,
>
> phiho
>
>
> On Tue, May 3, 2022 at 7:39 PM Michael Orlitzky 
> wrote:
>
>> On Tue, 2022-05-03 at 14:30 -0700, ph h wrote:
>> >
>> > *SELF=$(readlink -f $0)
>>
>> Sadly, readlink is not a POSIX standard utility; otherwise we would
>> already be using it in place of resolvelinks().
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "sage-devel" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/sage-devel/CuYOEY5pfdI/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> sage-devel+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sage-devel/5e9947445de86811f34c05e204f8e45c100e421d.camel%40orlitzky.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1bgUBTASRseM%3DErn_aB-pwYDb_mm8Y%3D98yL1aTqXenrfA%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread ph h
Hi,

> Sadly, readlink is not a POSIX standard utility; otherwise we would
> already be using it in place of resolvelinks().

Thank you so much. That's the constraint that Sage must face.

BTW, which of the platforms that Sage supports do not have readlink?

Regards,

phiho


On Tue, May 3, 2022 at 7:39 PM Michael Orlitzky 
wrote:

> On Tue, 2022-05-03 at 14:30 -0700, ph h wrote:
> >
> > *SELF=$(readlink -f $0)
>
> Sadly, readlink is not a POSIX standard utility; otherwise we would
> already be using it in place of resolvelinks().
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-devel/CuYOEY5pfdI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-devel/5e9947445de86811f34c05e204f8e45c100e421d.camel%40orlitzky.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CALZQg1b%3DaKyFgfA%3D-ZKCx99aMWtV_xLO7cftcz_bE%3DVKFgsTnQ%40mail.gmail.com.


Re: [sage-devel] Factoring for Fun and Profit

2022-05-03 Thread Michael Orlitzky
On Tue, 2022-05-03 at 14:30 -0700, ph h wrote:
> 
> *SELF=$(readlink -f $0)

Sadly, readlink is not a POSIX standard utility; otherwise we would
already be using it in place of resolvelinks().

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/5e9947445de86811f34c05e204f8e45c100e421d.camel%40orlitzky.com.