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

Added support for armv7l #2620

Merged
merged 6 commits into from
Dec 13, 2024
Merged

Added support for armv7l #2620

merged 6 commits into from
Dec 13, 2024

Conversation

Lauszus
Copy link
Contributor

@Lauszus Lauszus commented Dec 11, 2024

No description provided.

@Lauszus Lauszus force-pushed the feature/armv7l branch 4 times, most recently from d3b6a7b to 04d8687 Compare December 11, 2024 21:07
@Lauszus Lauszus marked this pull request as ready for review December 11, 2024 21:29
@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 11, 2024

@jsirois this one is ready. I just tested this by compiling my lift branch (a-scie/lift#106) and then using that using the --scie-science-binary argument.

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 11, 2024

I'm a bit unsure about all the tests, but I tried to add armv7l a few places I thought made sense.

pex/version.py Outdated
@@ -1,4 +1,4 @@
# Copyright 2015 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

__version__ = "2.25.2"
__version__ = "2.26.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsirois I have prepared for a release here as well. Let me know if you want me to do any other changes.

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 12, 2024

@jsirois I'm struggling a bit to get the get-scie-platform script working. At least it is running now, but I am getting:

$ docker run --rm -v "/tmp/pex:/tmp/pex" -v $PWD:/code -w /code --platform linux/arm/v7 python:3.11-slim-bookworm bash ./gen-scie-platform.sh
ROOT: provision> .tox/.tox/bin/python -m tox -e gen-scie-platform -- -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0
gen-scie-platform create: /code/.tox/gen-scie-platform
gen-scie-platform installdeps: httpx==0.23.0, toml==0.10.2, PyGithub==2.4.0, cryptography==43.0.3
gen-scie-platform installed: anyio==3.7.1,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.3,Deprecated==1.2.15,h11==0.12.0,httpcore==0.15.0,httpx==0.23.0,idna==3.10,pycparser==2.22,PyGithub==2.4.0,PyJWT==2.10.1,PyNaCl==1.5.0,requests==2.32.3,rfc3986==1.5.0,sniffio==1.3.1,toml==0.10.2,typing_extensions==4.12.2,urllib3==2.2.3,wrapt==1.17.0
gen-scie-platform run-test-pre: PYTHONHASHSEED='707027689'
gen-scie-platform run-test: commands[0] | python scripts/gen-scie-platform.py -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0
HTTP Error 404: Not Found
Command '['/code/.tox/gen-scie-platform/bin/python', '-m', 'pex', '.', '-c', 'pex3', '--scie', 'lazy', '--scie-pbs-release', '20241016', '--scie-python-version', '3.13.0', '-o', '/tmp/tmp8qw_ylpz/pex3']' returned non-zero exit status 1.
ERROR: InvocationError for command /code/.tox/gen-scie-platform/bin/python scripts/gen-scie-platform.py -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0 (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   gen-scie-platform: commands failed

Same command work when using --platform linux/amd64

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 12, 2024

@jsirois I'm struggling a bit to get the get-scie-platform script working. At least it is running now, but I am getting:

$ docker run --rm -v "/tmp/pex:/tmp/pex" -v $PWD:/code -w /code --platform linux/arm/v7 python:3.11-slim-bookworm bash ./gen-scie-platform.sh
ROOT: provision> .tox/.tox/bin/python -m tox -e gen-scie-platform -- -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0
gen-scie-platform create: /code/.tox/gen-scie-platform
gen-scie-platform installdeps: httpx==0.23.0, toml==0.10.2, PyGithub==2.4.0, cryptography==43.0.3
gen-scie-platform installed: anyio==3.7.1,certifi==2024.8.30,cffi==1.17.1,charset-normalizer==3.4.0,cryptography==43.0.3,Deprecated==1.2.15,h11==0.12.0,httpcore==0.15.0,httpx==0.23.0,idna==3.10,pycparser==2.22,PyGithub==2.4.0,PyJWT==2.10.1,PyNaCl==1.5.0,requests==2.32.3,rfc3986==1.5.0,sniffio==1.3.1,toml==0.10.2,typing_extensions==4.12.2,urllib3==2.2.3,wrapt==1.17.0
gen-scie-platform run-test-pre: PYTHONHASHSEED='707027689'
gen-scie-platform run-test: commands[0] | python scripts/gen-scie-platform.py -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0
HTTP Error 404: Not Found
Command '['/code/.tox/gen-scie-platform/bin/python', '-m', 'pex', '.', '-c', 'pex3', '--scie', 'lazy', '--scie-pbs-release', '20241016', '--scie-python-version', '3.13.0', '-o', '/tmp/tmp8qw_ylpz/pex3']' returned non-zero exit status 1.
ERROR: InvocationError for command /code/.tox/gen-scie-platform/bin/python scripts/gen-scie-platform.py -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0 (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   gen-scie-platform: commands failed

Same command work when using --platform linux/amd64

Turning on verbose did not give more outout:

gen-scie-platform run-test: commands[0] | python scripts/gen-scie-platform.py -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0 -v
HTTP Error 404: Not Found
Command '['/code/.tox/gen-scie-platform/bin/python', '-m', 'pex', '.', '-c', 'pex3', '--scie', 'lazy', '--scie-pbs-release', '20241016', '--scie-python-version', '3.13.0', '-o', '/tmp/tmpzagyb9oh/pex3']' returned non-zero exit status 1.
ERROR: InvocationError for command /code/.tox/gen-scie-platform/bin/python scripts/gen-scie-platform.py -d /tmp/pex-tmp --pbs-release 20241016 --python-version 3.13.0 -v (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   gen-scie-platform: commands failed

@jsirois
Copy link
Member

jsirois commented Dec 12, 2024

@Lauszus is CI running gen-scie-platform or are you running it to test it? If the latter, what command are you using exactly?

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 12, 2024

@Lauszus is CI running gen-scie-platform or are you running it to test it? If the latter, what command are you using exactly?

I'm running it locally since I can not trigger the CI.

I'm running:

docker run --rm -v "/tmp/pex:/tmp/pex" -v $PWD:/code -w /code --platform linux/arm/v7 python:3.11-slim-bookworm bash ./gen-scie-platform.sh

My install scripts looks like this:

#!/usr/bin/env bash

python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -U tox
python -V

tox -e gen-scie-platform -- \
  -d /tmp/pex \
  --pbs-release 20241016 \
  --python-version 3.13.0 -v

@jsirois
Copy link
Member

jsirois commented Dec 12, 2024

I'm running it locally since I can not trigger the CI.

Ok, thanks for those details. There are a few issues here:

  • The 404: This is due to the default science version remaining at 0.8.0 which has no armv7l release available to download; so that needs to be bumped to 0.9.0:
    MIN_SCIENCE_VERSION = Version("0.8.0")
  • After that, no wheels for psutil: The Pex PEX scies are all built from locks that do not allow sdists, only wheels. The current locking code just uses PyPI; so does not find a wheel for psutil for armv7l and dies. This will need plumbing of --use-pip-config to pick up your tox.ini setup of PIP_EXTRA_INDEX_URL, which currently only applies to bare use of Pip and not Pex internal uses of Pip (locking / resolving) which are hermetic by default. But even then, psutil 6.0 is only pre-built for 3.11 and the Pex PEX scies use 3.13 currently: https://www.piwheels.org/project/psutil/

I have no clue what timezone you're actually in right now - we're both working odd hours it seems. Combined with the fact the complete-platform gen will need to happen before release, but that this PR needs to land before complete-platform gen can be run means the CHANGES.md / pex/version.py changes will need to be backed out. I'm sorry about that - I should have seen that coming. Unless you say otherwise, I'm going to get involved in this PR with a few edits towards these ends to move this along and get out a release today.

@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 12, 2024

I'm running it locally since I can not trigger the CI.

Ok, thanks for those details. There are a few issues here:

  • The 404: This is due to the default science version remaining at 0.8.0 which has no armv7l release available to download; so that needs to be bumped to 0.9.0:

    MIN_SCIENCE_VERSION = Version("0.8.0")

  • After that, no wheels for psutil: The Pex PEX scies are all built from locks that do not allow sdists, only wheels. The current locking code just uses PyPI; so does not find a wheel for psutil for armv7l and dies. This will need plumbing of --use-pip-config to pick up your tox.ini setup of PIP_EXTRA_INDEX_URL, which currently only applies to bare use of Pip and not Pex internal uses of Pip (locking / resolving) which are hermetic by default. But even then, psutil 6.0 is only pre-built for 3.11 and the Pex PEX scies use 3.13 currently: https://www.piwheels.org/project/psutil/

I have no clue what timezone you're actually in right now - we're both working odd hours it seems. Combined with the fact the complete-platform gen will need to happen before release, but that this PR needs to land before complete-platform gen can be run means the CHANGES.md / pex/version.py changes will need to be backed out. I'm sorry about that - I should have seen that coming. Unless you say otherwise, I'm going to get involved in this PR with a few edits towards these ends to move this along and get out a release today.

No problem. Just push to this PR.

FYI I'm based in Sweden, so just go ahead with the release.

Also roll back the release prep changes. The Pex PEX scie complete
platforms and lock will need to be re-generated before a release.
Copy link
Member

@jsirois jsirois left a comment

Choose a reason for hiding this comment

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

We'll see how this goes. Your stuff looks good @Lauszus but my Pex PEX scie complete platform changes are a bit more doubtful.

@jsirois jsirois merged commit 195d8fd into pex-tool:main Dec 13, 2024
23 checks passed
@jsirois
Copy link
Member

jsirois commented Dec 13, 2024

Alright, I was not able to get the Pex PEX scie working for Linux armv7l for the 2.26.0 release @Lauszus but you can still use Pex on and for armv7l; it's just that there is no native Pex PEX scie binary for the platform yet. I'm not even sure if you care about that. At any rate, I'll be adding one, if possible, in a follow up release.

@Lauszus Lauszus deleted the feature/armv7l branch December 13, 2024 08:43
@Lauszus
Copy link
Contributor Author

Lauszus commented Dec 13, 2024

Alright, I was not able to get the Pex PEX scie working for Linux armv7l for the 2.26.0 release @Lauszus but you can still use Pex on and for armv7l; it's just that there is no native Pex PEX scie binary for the platform yet. I'm not even sure if you care about that. At any rate, I'll be adding one, if possible, in a follow up release.

Thanks. No I don't really need a Pex PEX scie binary. My use cases is that I want to create a PEX for a Python application for some embedded devices on a cellular connection and I can just do that on a x86-64 machine.

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.

2 participants