Opened 7 months ago

Closed 7 months ago

#69729 closed defect (fixed)

python313-devel @3.13.0a6 Builds OK, but destroot fails with 'missing file' on macOS < 10.12

Reported by: snowflake (Dave Evans) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.9.99
Keywords: Cc:
Port: python313-devel

Description

python313-devel - Destroot fails with missing file.

The buildbots confirm the error.

Commit is dc55475381de52cfd3bc6055cf248907dc82bacd/macports-ports

Here's the tail of the log:

make: Leaving directory `/opt/local/var/macports/build/_Users_davidevans_macports_sources_github.com_macports_macports-ports_lang_python313-devel/python313-devel/work/Python-3.13.0a6'
DEBUG: Executing proc-post-org.macports.destroot-destroot-0
--->  Patching _sysconfigdata__darwin_darwin.py: s|^([[:space:]]*'LINKFORSHARED':).*|\1 '-L/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/config-3.13-darwin -lpython3.13 -ldl -framework CoreFoundation',|
DEBUG: Executing reinplace: /usr/bin/sed -E {s|^([[:space:]]*'LINKFORSHARED':).*|\1 '-L/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/config-3.13-darwin -lpython3.13 -ldl -framework CoreFoundation',|} </opt/local/var/macports/build/_Users_davidevans_macports_sources_github.com_macports_macports-ports_lang_python313-devel/python313-devel/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/_sysconfigdata__darwin_darwin.py >@file12
DEBUG: couldn't read file "/opt/local/var/macports/build/_Users_davidevans_macports_sources_github.com_macports_macports-ports_lang_python313-devel/python313-devel/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/_sysconfigdata__darwin_darwin.py": no such file or directory
DEBUG:     while executing
DEBUG: "exec -ignorestderr -- {*}$cmdline"
Error: reinplace: couldn't read file "/opt/local/var/macports/build/_Users_davidevans_macports_sources_github.com_macports_macports-ports_lang_python313-devel/python313-devel/work/destroot/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/_sysconfigdata__darwin_darwin.py": no such file or directory
Error: Failed to destroot python313-devel: reinplace sed(1) failed
DEBUG: Error code: NONE
DEBUG: Backtrace: reinplace sed(1) failed
DEBUG:     while executing
DEBUG: "$post $targetname"
DEBUG: dropping privileges: euid changed to 502, egid changed to 501.
Error: See /opt/local/var/macports/logs/_Users_davidevans_macports_sources_github.com_macports_macports-ports_lang_python313-devel/python313-devel/main.log for details.

Attachments (1)

config.log.gz (53.9 KB) - added by snowflake (Dave Evans) 7 months ago.
config log for El Capitan

Download all attachments as: .zip

Change History (16)

comment:1 Changed 7 months ago by jmroot (Joshua Root)

Needs to be reported upstream, and they'll need information from the config.log to know why the ABI name is not set.

comment:2 Changed 7 months ago by snowflake (Dave Evans)

I would submit a bug if I could figure out what the exact problem is, but I have pored over logs and I haven't got it yet. Python 3.13.0a6 installs on my new Mac running Sonoma, but not a my very old Mac running El Capitan.

On my old mac I have built and installed the latest commit of Python using this shell script:

#!/bin/sh
# Python build script
CPPFLAGS="-I/opt/local/include -DTARGET_OS_OSX=1" \
	LDFLAGS="-L/opt/local/lib" \
	CC="/opt/local/bin/clang-mp-13" \
	./configure --with-pydebug --prefix=/opt/python

If I were to submit a bug upstream they would no doubt tell me that it installs with a simple config script, so there must be a problem with macports.

Here's proof it works:

Python 3.13.0a6+ (heads/main:0dcfd0d522, Apr 15 2024, 00:45:52) [Clang 13.0.1 ] on darwin

comment:3 Changed 7 months ago by jmroot (Joshua Root)

Can you attach the config.log from El Capitan?

comment:4 Changed 7 months ago by jmroot (Joshua Root)

Also, did you try the actual 3.13.0a6 release on El Capitan with your shell script? It's possible that the issue was fixed upstream between that and the latest commit.

Last edited 7 months ago by jmroot (Joshua Root) (previous) (diff)

Changed 7 months ago by snowflake (Dave Evans)

Attachment: config.log.gz added

config log for El Capitan

comment:5 Changed 7 months ago by jmroot (Joshua Root)

Well this is the problem, but the config.log unfortunately doesn't give any clues as to why it's happening:

configure:6892: checking for the platform triplet based on compiler characteristics
configure:6900: result: none

The correct result as seen with python312 on 10.11 is:

checking for the platform triplet based on compiler characteristics... darwin

comment:6 Changed 7 months ago by snowflake (Dave Evans)

I modified my script to use the system clang.

With tag: v3.13.0a6 it builds, installed, and runs OK

comment:7 Changed 7 months ago by snowflake (Dave Evans)

On my git checkout with tag v3.13.0a6 and system clang I get:

configure:6890: checking for the platform triplet based on compiler characteristics
configure:6895: result: darwin
configure:6903: checking for multiarch
configure:6926: result: darwin
Last edited 7 months ago by snowflake (Dave Evans) (previous) (diff)

comment:8 Changed 7 months ago by jmroot (Joshua Root)

Looks like this broke somewhere between a4 and a5.

comment:9 Changed 7 months ago by snowflake (Dave Evans)

I had to modify my script to add a CPPFLAGS for -DTARGET_OS_OSX=1 otherwise Modules/_testexternalinspection.c did not build. This has changed since v3.13.0a4

comment:10 Changed 7 months ago by snowflake (Dave Evans)

TARGET_OS_OSX is also used in Misc/platform_triplet.c

comment:11 Changed 7 months ago by jmroot (Joshua Root)

In a0a5b21f5d7c2ced9fc5f0e1374734e748bdd2ee/macports-ports (master):

python313-devel: attempt to fix platform_triplet.c failure

See: #69729

comment:13 Changed 7 months ago by snowflake (Dave Evans)

Your patch has fixed the destroot on El Capitan. Thank you.

comment:14 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

It still failed on the 10.7 buildbot worker with:

./Modules/_testexternalinspection.c:20:7: error: 'TARGET_OS_OSX' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
#  if TARGET_OS_OSX
      ^
./Modules/_testexternalinspection.c:56:27: error: 'TARGET_OS_OSX' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
#if defined(__APPLE__) && TARGET_OS_OSX
                          ^
./Modules/_testexternalinspection.c:379:29: error: 'TARGET_OS_OSX' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
#elif defined(__APPLE__) && TARGET_OS_OSX
                            ^
./Modules/_testexternalinspection.c:435:29: error: 'TARGET_OS_OSX' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
#elif defined(__APPLE__) && TARGET_OS_OSX
                            ^
4 errors generated.

comment:15 Changed 7 months ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

In 0c6b77f5ceffc8f8d7035d8451cf973a7394a7d4/macports-ports (master):

python313-devel: handle undefined TARGET_OS_OSX

Closes: #69729

Note: See TracTickets for help on using tickets.