Skip to content

Commit

Permalink
add --arch flag (#3349)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Sep 7, 2021
1 parent 37d476b commit 5f96d5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/make_bundle.yml
Expand Up @@ -63,7 +63,7 @@ jobs:
VER=`python bundle.py --version`
echo "version=${VER}" >> $GITHUB_ENV
echo "Version: $VER"
ARCH_SUFFIX=`python -c "import platform; print(platform.machine())"`
ARCH_SUFFIX=`python bundle.py --arch`
echo "arch-suffix=${ARCH_SUFFIX}" >> $GITHUB_ENV
echo "Machine: ${ARCH_SUFFIX}"
- name: Make Bundle
Expand Down
14 changes: 13 additions & 1 deletion bundle.py
Expand Up @@ -207,7 +207,16 @@ def patch_python_lib_location():


def patch_environment_variables():
os.environ["ARCH"] = ARCH
os.environ["ARCH"] = architecture()


def architecture():
arch = platform.machine() or "generic"
# Try to canonicalize across OS
replacements = {
"amd64": "x86_64",
}
return replacements.get(arch.lower(), arch)


def make_zip():
Expand Down Expand Up @@ -283,4 +292,7 @@ def bundle():
if '--version' in sys.argv:
print(VERSION)
sys.exit()
if '--arch' in sys.argv:
print(architecture())
sys.exit()
print('created', bundle())

0 comments on commit 5f96d5d

Please sign in to comment.