Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#62259 closed defect (fixed)

ninja @1.10.2_0+universal build issues on Big Sur Intel

Reported by: kencu (Ken) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: ninja

Description

There are two issues when building ninja universal, using the muniversal PortGroup as it does now.

  1. configure.py: error: option --host: invalid choice: 'aarch64-apple-darwin20.3.0'

This option is set by the muniveral PG but to value the script does not accept.

  1. :info:build sh: ./ninja: Bad CPU type in executable

The portfile has been written to bootstrap ninja and then rebuild ninja with itself. This is not possible if the arch is not runnable on the given os.

Change History (6)

comment:1 Changed 4 years ago by kencu (Ken)

I am having one of those sessions where trac will not allow me to attach files to the ticket.

For now, here is a snippet around the first error:

:debug:configure SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk'
:info:configure Executing:  cd "/opt/buildX11/var/macports/build/_opt_buildX11_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ninja/ninja/work/ninja-1.10.2-arm64" && /usr/bin/python configure.py --with-python=/usr/bin/python --host=aarch64-apple-darwin20.3.0 --bootstrap --verbose 
:debug:configure system:  cd "/opt/buildX11/var/macports/build/_opt_buildX11_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ninja/ninja/work/ninja-1.10.2-arm64" && /usr/bin/python configure.py --with-python=/usr/bin/python --host=aarch64-apple-darwin20.3.0 --bootstrap --verbose 
:info:configure Usage: configure.py [options]
:info:configure configure.py: error: option --host: invalid choice: 'aarch64-apple-darwin20.3.0' (choose from 'linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5', 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd', 'aix', 'dragonfly')
:info:configure Command failed:  cd "/opt/buildX11/var/macports/build/_opt_buildX11_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ninja/ninja/work/ninja-1.10.2-arm64" && /usr/bin/python configure.py --with-python=/usr/bin/python --host=aarch64-apple-darwin20.3.0 --bootstrap --verbose 
:info:configure Exit code: 2
:error:configure Failed to configure ninja: configure failure: command execution failed
:debug:configure Error code: NONE

and here is a snippet around the second error:

:debug:build SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk'
:info:build Executing:  cd "/opt/buildX11/var/macports/build/_opt_buildX11_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ninja/ninja/work/ninja-1.10.2-arm64" && ./ninja -j16 -v 
:debug:build system:  cd "/opt/buildX11/var/macports/build/_opt_buildX11_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ninja/ninja/work/ninja-1.10.2-arm64" && ./ninja -j16 -v 
:info:build sh: ./ninja: Bad CPU type in executable
:info:build Command failed:  cd "/opt/buildX11/var/macports/build/_opt_buildX11_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ninja/ninja/work/ninja-1.10.2-arm64" && ./ninja -j16 -v 
:info:build Exit code: 126
:error:build Failed to build ninja: command execution failed
:debug:build Error code: NONE

comment:3 Changed 4 years ago by kencu (Ken)

% sudo /opt/buildX11/bin/port -v installed ninja                                                                                                            
Password:
The following ports are currently installed:
  ninja @1.10.2_0+universal (active) platform='darwin 20' archs='arm64 x86_64' date='2021-02-10T23:09:53-0800'

comment:4 Changed 3 years ago by kencu (Ken)

Resolution: wontfix
Status: assignedclosed

I fixed this three different ways, but all were unacceptable.

comment:5 Changed 3 years ago by kencu (Ken)

this was the best of them IMHO, for anyone stuck:

https://github.com/macports/macports-ports/pull/10027

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:6 Changed 3 years ago by Ken <21211439+kencu@…>

Resolution: wontfixfixed

In d35329911f6eda3dddca1410d7374bea15730402/macports-ports (master):

ninja: fix cross-arch universal build (https://github.com/macports/macports-ports/pull/12122)

Apple's gcc compilers do not allow dependency file generation
when multiple arch flags are used

This resulted in the muniversal portgroup being used to repair the
build of ninja several years ago, however this has it's own
issues by not allowing a cross-arch universal binary to be built,
due to the way the ninja bootstraps itself during compilation.

if we strip the (unnecessary) dependency file generation by removing
the dependency flags, then the muniversal PortGroup is no longer
needed and the cross-arch universal build can succeed without
using the muniversal portgroup.

see: https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html
see: 701e7b2597f2da954a390b1b63aa90d6f7aaba20/macports-base
see: #56494

closes: #62259

Note: See TracTickets for help on using tickets.