Opened 2 years ago

Closed 2 years ago

#65870 closed defect (fixed)

icu @71.1 sets incorrect Python version

Reported by: ballapete (Peter "Pete" Dyballa) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: tiger ppc Cc: kirill@…
Port: icu

Description

The environment contains

PYTHON='/opt/local/bin/python2.7'

but configure obviously searches for something completely different:

checking for python3... /opt/local/bin/python2.7

This needs a change too:

Build Dependencies:   python27

Removing all references to Python 2.7 in Portfile lets icu build. port test icu too succeeds:

[All tests passed successfully...]
Elapsed Time: 00:03:58.038
---------------
ALL TESTS SUMMARY:
All tests OK:  testdata intltest iotest cintltst
verifying that icu-config --selfcheck can operate
verifying that /usr/bin/gnumake -f Makefile.inc selfcheck can operate
PASS: config selfcheck OK

Attachments (1)

main.log (1.1 MB) - added by catap (Kirill A. Korinsky) 2 years ago.

Download all attachments as: .zip

Change History (29)

comment:1 Changed 2 years ago by catap (Kirill A. Korinsky)

The issue: icu is used as part of bootstrap for c-compiler which is required to build python :(

Also, we may have much more complicated issue in the future. Upstream plans to remove support python 2.7: https://unicode-org.atlassian.net/browse/ICU-20301

Anyway, I'll try to find some solution ASAP.

comment:2 Changed 2 years ago by lukaso (Lukas Oberhuber)

Last edited 2 years ago by lukaso (Lukas Oberhuber) (previous) (diff)

comment:3 Changed 2 years ago by catap (Kirill A. Korinsky)

In 5a88171bbb1a8bf3476d23d4e8d19b1621565847/macports-ports (master):

icu{,-devel}: use system python on 10.7+

See: #65870

comment:4 Changed 2 years ago by catap (Kirill A. Korinsky)

Peter, I've just tried to run port test icu-devel with python-2.7 and it successfully build and run.

May you share the issue? Yes, configure script checking for python3 but it still works with python2.7 ;)

Last edited 2 years ago by catap (Kirill A. Korinsky) (previous) (diff)

Changed 2 years ago by catap (Kirill A. Korinsky)

Attachment: main.log added

comment:5 in reply to:  4 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Replying to catap: I am trying to get rid of Python 2.7.

comment:6 Changed 2 years ago by catap (Kirill A. Korinsky)

Peter, this is build dependency which is installed only to build icu.

Thus, python-2.7 is a part of bootstrap for modern clang on old system and I really doubt that you can remove it.

comment:7 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Right now I have:

pete 291 /\ port echo dependentof:python27
clang-3.4                       
pete 292 /\ port echo dependentof:clang-3.4

The Python 2 code in Clang 3.4 could be translated with 2to3 to Python 3 code…

comment:8 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Or could Apple's original Python 2.3.5 suffice? (Doesn't MacPorts install itself with this version?)

comment:9 Changed 2 years ago by catap (Kirill A. Korinsky)

I have no idea.

I feel that this ticket should be closed because it isn’t related to ICU port and no issue here.

comment:10 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Testing icu-devel it starts similarly to icu, i.e. it has

PYTHON='/opt/local/bin/python2.7'

for which configure has to find

checking for python3... /opt/local/bin/python2.7

Nothing changed or was improved…

comment:11 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

After some time I got:

nice port deps installed | ggrep -E 'Full Name:|python27|clang-3.4|llvm-3.4'

Full Name: cctools @949.0.1_2+llvm34
Library Dependencies: llvm-3.4

Full Name: clang-3.4 @3.4.2_17+analyzer
Library Dependencies: llvm-3.4, python27, libffi, ncurses, zlib

Full Name: harfbuzz @5.2.0_0
Test Dependencies:    python27

Full Name: icu @71.1_0
Build Dependencies:   python27, gcc7

Full Name: libnetpbm @10.99.02_0
Build Dependencies:   gmake, python27, apple-gcc42

Full Name: llvm-3.4 @3.4.2_16
Build Dependencies:   python27, apple-gcc42

Full Name: netpbm @10.99.02_1+x11
Build Dependencies:   gmake, python27, pkgconfig, apple-gcc42

which can be reduced by installing cctools +xcode.

comment:12 Changed 2 years ago by catap (Kirill A. Korinsky)

Peter, did test fails on icu with python2.7? You're reporting about configure label. Yes, ICU is checking for python3 but support of python2.7 isn't broken yet :)

Thus, installed icu won't require python-2,7 and port reclaim will remove it, if you remove library dependencies.

comment:13 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

I did not try to test since nothing has changed and I stopped the process while in configure stage. The tests with Python 3 via patched Portfile succeeded, as reported.

comment:14 Changed 2 years ago by catap (Kirill A. Korinsky)

Peter, I've tried to run test on python2.7 and it works well.

This is a reason why I try to understand this bug.

comment:15 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

The bug is easy to understand: Portfile sets in environment

PYTHON='/opt/local/bin/python2.7'

via line #122 and configure has to use this old solftware.

Last edited 2 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:16 Changed 2 years ago by catap (Kirill A. Korinsky)

Peter, icu is a part of dependency for building modern clang which is used to build modern python. It isn't a bug until icu supports old python :)

comment:17 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Once icu is built with whatever Python version ancient Clang/LLVM will build. Because Clang/LLVM do not use exactly the same software as the software it uses to be built itself. Or, in other words, you do not need to use the same screw drivers that were used in a Chinese factory to build your Mac when you try to repair it.

comment:18 Changed 2 years ago by catap (Kirill A. Korinsky)

Yes, but it is should be still possible to build from scratch. Switching to python 3.10 may introduce a cyclic dependency.

comment:19 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

In my view Python 3.10 is in a far future and I am not sure whether I shall experience it. Besides, why should an icu version built with Python 3 introduce a cyclic dependency in the obscure case that I would need to build Clang or LLVM again?

comment:20 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Invoking nice port rdeps python39 (or python310) gives on macOS Monterey:

The following ports are dependencies of python39 @3.9.14_0+lto+optimizations:
  xz
    lbzip2
    gettext
      libiconv
        gperf
      libtextstyle
        ncurses
      gettext-runtime
      gettext-tools-libs
  pkgconfig
  bzip2
  expat
  libedit
  libffi
    expect
      automake
        autoconf
          m4
      tcl
    dejagnu
  openssl
    openssl3
      zlib
  sqlite3
  python_select
  python3_select

So it looks as if Python 3 can be easily installed for icu

comment:21 Changed 2 years ago by catap (Kirill A. Korinsky)

Peter, icu uses system python on Monterey. python-2.7 ie required for macOS before 10.7; BTW I thought we're talking about 10.4 on PPC ;)

comment:22 in reply to:  21 Changed 2 years ago by ballapete (Peter "Pete" Dyballa)

Replying to catap:

I thought we're talking about 10.4 on PPC ;)

My Tiger is switched off to save some energy for winter time.

comment:23 in reply to:  3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to catap:

In 5a88171bbb1a8bf3476d23d4e8d19b1621565847/macports-ports (master):

icu{,-devel}: use system python on 10.7+

See: #65870

I don't understand this commit.

Previously, the port set configure.python to a correct and deterministic value on all systems. On Mac OS X 10.7 through macOS 11 inclusive it used /usr/bin/python because the OS-supplied version of Python 2 was new enough. On Mac OS X 10.6 and earlier, it used MacPorts Python 2.7 because the OS-supplied Python 2 was too old. On macOS 12 and later, it used MacPorts Python 2.7 because as of macOS 12.3 there is no OS-supplied version of Python 2 anymore.

Now, it uses MacPorts Python 2.7 on Mac OS X 10.6 and earlier, and what Python it uses on Mac OS X 10.7 and later is undefined. For example, if the user has used python select to select some version of Python, it seems likely to me that the build will use that Python. That's not reproducible, not deterministic, so that's a regression.

comment:24 in reply to:  description Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Peter is reporting that the build system now wants a version of Python 3, but MacPorts was telling it to use a version of Python 2:

Replying to ballapete:

checking for python3... /opt/local/bin/python2.7

If the build system now requires Python 3, the port should ensure that it always supplies a version of Python 3. IIRC, Python 3 was not supplied with the OS until macOS 10.15, so the port should depend on port:python310 and set configure.python ${prefix}/bin/python3.10 for macOS earlier than 10.15 and should set configure.python /usr/bin/python3 for macOS 10.15 and later.

One must indeed be careful about circular dependencies with the compilers, but the python310 port already declares that it is a dependency of the newer clang compilers (by including the clang_dependency portgroup, just like the icu port does) which should avoid the problem.

comment:25 Changed 2 years ago by catap (Kirill A. Korinsky)

Ryan, thanks for a point regarding not reproducible. I'll revert that.

Build system is checking for python3, but it isn't mandatory yet.

So, in few days I'll prepare upgrade of icu, include reverts of used python version and explain that 2.7 is good enough with link to issue at upstream about giveup support of python before 3.0

comment:26 Changed 2 years ago by catap (Kirill A. Korinsky)

In f5db3b9d0f2768a093664d85ce6b1dfc03f2983c/macports-ports (master):

icu-devel: clean used python version

See: #65870

[skip ci]

comment:27 Changed 2 years ago by catap (Kirill A. Korinsky)

In 64e2efd6a287bc9308406ebf44df2a20c481a67e/macports-ports (master):

icu: update to 72.1

Also clean used python version

See: #65870

comment:28 Changed 2 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed

this looks as fixed as it will ever be, for the time being at least

Note: See TracTickets for help on using tickets.