Re: Python 2.7 – allow another db version beside 4.8

2018-01-11 Thread Joshua Root
On 2018-1-12 03:55 , Ken Cunningham wrote:
> 
> On 2018-01-11, at 12:28 AM, Jan Stary wrote:
>>
>>
>> Does anyone now? If my port requires (say) python (any python),
>> what is the right way to say that? (In some cases, having
>> /usr/bin/python is just fine.)
>>
> 
> MacPorts tries to undertake the principle of reproducible builds
> .
> 
> A port is built as much as possible the same way on every system and
> issues are more easily debugged. Specifying a fully determined version
> of python or perl helps to remove the issue of different versions
> building the software differently.
> 
> In the main, port submissions are required to have a fully spec'd
> version of python or perl for this reason -- a version that is verified
> to work correctly, and consistent across all builds. If you were
> managing a system of 20,000 ports and users of all different skill
> levels, you would eventually come to the same conclusion.
> 
> In simple cases, it might be allowed to slide.

Aiming for reproducible builds is certainly a consideration, but there
are more basic reasons why depending on "any python/perl" is a problem.

Does the port build differently depending on which interpreter version
is found? (This can include stuff like putting the path to a particular
version in shebang lines of scripts.) That's incompatible with
distributing prebuilt archives -- the "any version" on the buildbot
isn't necessarily the same as the "any version" on the user's system.

Does the port require one or more modules as well as the interpreter? If
so, you can't just have "any version" of a module and "any version" of
the interpreter; the versions of the two must match. Using python36 to
satisfy a python dependency and py35-numpy to satisfy a numpy dependency
isn't going to work.

Sometimes just using /usr/bin/python always may be fine. If not, and you
want to offer users a choice of which python version to use, then you
need to do it via variants.

- Josh


Re: Python 2.7 – allow another db version beside 4.8

2018-01-11 Thread Ken Cunningham

On 2018-01-11, at 12:28 AM, Jan Stary wrote:
> 
> 
> Does anyone now? If my port requires (say) python (any python),
> what is the right way to say that? (In some cases, having
> /usr/bin/python is just fine.)
> 

MacPorts tries to undertake the principle of reproducible builds 
.

A port is built as much as possible the same way on every system and issues are 
more easily debugged. Specifying a fully determined version of python or perl 
helps to remove the issue of different versions building the software 
differently.

In the main, port submissions are required to have a fully spec'd version of 
python or perl for this reason -- a version that is verified to work correctly, 
and consistent across all builds. If you were managing a system of 20,000 ports 
and users of all different skill levels, you would eventually come to the same 
conclusion.

In simple cases, it might be allowed to slide.

K



Re: Python 2.7 – allow another db version beside 4.8

2017-12-27 Thread Vincent Habchi
On 25 Dec 2017, at 20:30, Jan Stary  wrote:

> Generally, I tend to let the port/package use any version,
> unless there is a specific reason for some specific version.
> For example, if a port requires Python, then I consider
> _any_ installed python to satsfy this requirement,
> unless there is a reason it has to be python36 (or whatever).
> 
> What is the right way to state this in a Portfile?

I’m not sure. You could use a file dependency instead of a port one, assuming 
every version installs the same set of files.

Also, you can write a script that uses the TCL instruction glob to find out 
what version of a file is installed, given that the filename is composed of a 
stem and an extension that varies according to the version. If there’s no file, 
then you can decide to install whatever default version you deem fit.

But I’m not 110% sure it’s standard practice though.




Re: Python 2.7 – allow another db version beside 4.8

2017-12-25 Thread Jan Stary
On Dec 25 10:04:33, vi...@macports.org wrote:
> > On 24 Dec 2017, at 11:23, Jan Stary  wrote:
> >> On Dec 24 05:19:35, j...@macports.org wrote:
> >>> On 2017-12-24 04:28 , Clemens Lang wrote:
> >>> Is there a reason to not just always use a newer version?
> >> And to turn the question around, what is gained by using the newer version?
> > 
> > Exactly.
> > 
> > Insisting on the newest version of everything
> > has cost me countless hours of comutation spent on nothing
> > except "having the newest version" (with the newest bugs).
> 
> Well my initial request was not about using the last version, but being able 
> to choose one version and stick to it through multiple ports that depend 
> thereon. I have a 128 GB SSD, and I’d rather not squander space with 
> installing different versions of the same software for no reason except that 
> the Portfile doesn’t offer the possibility to pick the version I want.

Generally, I tend to let the port/package use any version,
unless there is a specific reason for some specific version.
For example, if a port requires Python, then I consider
_any_ installed python to satsfy this requirement,
unless there is a reason it has to be python36 (or whatever).

What is the right way to state this in a Portfile?

Jan



Re: Python 2.7 – allow another db version beside 4.8

2017-12-25 Thread Vincent Habchi
Folks,

happy Xmas to all!

> On 24 Dec 2017, at 11:23, Jan Stary  wrote:
> 
>> On Dec 24 05:19:35, j...@macports.org wrote:
>>> On 2017-12-24 04:28 , Clemens Lang wrote:
>>> Is there a reason to not just always use a newer version?
>> And to turn the question around, what is gained by using the newer version?
> 
> Exactly.
> 
> Insisting on the newest version of everything
> has cost me countless hours of comutation spent on nothing
> except "having the newest version" (with the newest bugs).

Well my initial request was not about using the last version, but being able to 
choose one version and stick to it through multiple ports that depend thereon. 
I have a 128 GB SSD, and I’d rather not squander space with installing 
different versions of the same software for no reason except that the Portfile 
doesn’t offer the possibility to pick the version I want.

That’s all. Peace! :)

Vincent




Re: Python 2.7 – allow another db version beside 4.8

2017-12-24 Thread Jan Stary
On Dec 24 05:19:35, j...@macports.org wrote:
> On 2017-12-24 04:28 , Clemens Lang wrote:
> > Is there a reason to not just always use a newer version?
> And to turn the question around, what is gained by using the newer version?

Exactly.

Insisting on the newest version of everything
has cost me countless hours of comutation spent on nothing
except "having the newest version" (with the newest bugs).

Jan



Re: Python 2.7 – allow another db version beside 4.8

2017-12-23 Thread Joshua Root
On 2017-12-24 04:28 , Clemens Lang wrote:
> Hi,
> 
> On Sat, Dec 23, 2017 at 12:39:34PM +0100, Vincent Habchi wrote:
>> I’ve a made a private change to my python27 Portfile to allow it to
>> use DB60 instead of the default DB48, which was installed only for its
>> needs. I think allowing people (through a variant) to build a Python
>> 2.7 version which relies on another version of DB would be nice.
> 
> Is there a reason to not just always use a newer version?

Just as a data point, the _bsddb.so in the binary installer from
python.org appears to be statically linked against Berkeley DB 4.7.25.
And to turn the question around, what is gained by using the newer version?

- Josh


Re: Python 2.7 – allow another db version beside 4.8

2017-12-23 Thread Clemens Lang
Hi,

On Sat, Dec 23, 2017 at 12:39:34PM +0100, Vincent Habchi wrote:
> I’ve a made a private change to my python27 Portfile to allow it to
> use DB60 instead of the default DB48, which was installed only for its
> needs. I think allowing people (through a variant) to build a Python
> 2.7 version which relies on another version of DB would be nice.

Is there a reason to not just always use a newer version?

-- 
Clemens