Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable python3 for ninja bootstrap on macOS 11+ #936

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

dhomeier
Copy link
Contributor

Fixes #932 (tested on 12.1-13.1 – no further py3 conversion needed).

@nieder
Copy link
Member

nieder commented Dec 30, 2022

This made ninja build on 12.6. I tried ledger and libnss3.0e which both use ninja, and they failed similarly. Is the python path hardcoded in the binary?

Can probably be fixed likewise.

Is it worth doing something like this to avoid having to duplicate the final command?

  if [ -x /usr/bin/python ]; then
    PYTHON=/usr/bin/python
  else
    PYTHON=/usr/bin/python3
  fi
  $PYTHON configure.py --bootstrap

@dhomeier
Copy link
Contributor Author

This made ninja build on 12.6. I tried ledger and libnss3.0e which both use ninja, and they failed similarly. Is the python path hardcoded in the binary?

I rather don't think so; in meson builds e.g. the Python interpreter that is configured by meson setup builddir is then defined in the configuration files inside builddir like build.ninja, compile_commands.json and retrieved from there when running ninja -C builddir. I assume similar is done in those packages, but I cannot try to build them currently since I don't even get to build emacsen-common on Ventura.

Copy link
Member

@nieder nieder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for now.
I wasn't able to find any simple proof that ninja hardcodes the python used into the binary for later runtime events. If it turns out to be the case, we can always split ninja into /usr/bin/python and /usr/bin/python3 .info files (or merge them to use a single %p/bin/python3.XX.

Edit: never mind about python not being hardcoded. It is in fact hardcoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ninja looks for python
3 participants