Closed timblaktu closed 2 years ago
@timblaktu I probably need to update my instructions, https://github.com/awsdocs/aws-cli-user-guide/issues/11#issuecomment-1141227642 shows somewhat different way, if this doesn't work I'd love to help you figure this out
Yeah, those are actually the instructions I followed ( The most recent ones from may in that link you sent). ( Sorry about the line formatting problems in my post...).
I'll try to post more information on it Later today.
@missingcharacter I updated my OP to include the full error. The awscrt
recipe compiles fine then gets the posted linker error not recognizing linker option '-fatal_warnings', suggesting '-fatal-warnings'. This last linker step is thr only command that includes the problem.option:
aarch64-linux-android-clang -shared -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -L/home/builder/.termux-build/_cache/android-r23c-api-24-v0/sysroot/usr/lib -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -L/home/builder/.termux-build/_cache/android-r23c-api-24-v0/sysroot/usr/lib build/temp.linux-aarch64-cpython-310/source/auth_credentials.o build/temp.linux-aarch64-cpython-310/source/auth_signer.o build/temp.linux-aarch64-cpython-310/source/auth_signing_config.o build/temp.linux-aarch64-cpython-310/source/common.o build/temp.linux-aarch64-cpython-310/source/crc.o build/temp.linux-aarch64-cpython-310/source/crypto.o build/temp.linux-aarch64-cpython-310/source/event_stream_headers.o build/temp.linux-aarch64-cpython-310/source/event_stream_rpc_client_connection.o build/temp.linux-aarch64-cpython-310/source/event_stream_rpc_client_continuation.o build/temp.linux-aarch64-cpython-310/source/http_connection.o build/temp.linux-aarch64-cpython-310/source/http_headers.o build/temp.linux-aarch64-cpython-310/source/http_message.o build/temp.linux-aarch64-cpython-310/source/http_proxy.o build/temp.linux-aarch64-cpython-310/source/http_stream.o build/temp.linux-aarch64-cpython-310/source/io.o build/temp.linux-aarch64-cpython-310/source/module.o build/temp.linux-aarch64-cpython-310/source/mqtt_client.o build/temp.linux-aarch64-cpython-310/source/mqtt_client_connection.o build/temp.linux-aarch64-cpython-310/source/pkcs11_lib.o build/temp.linux-aarch64-cpython-310/source/s3_client.o build/temp.linux-aarch64-cpython-310/source/s3_meta_request.o -L/data/data/com.termux/files/usr/lib -Lbuild/temp.linux-aarch64-cpython-310/deps/install/lib -l:libaws-c-s3.a -l:libaws-c-mqtt.a -l:libaws-c-auth.a -l:libaws-c-http.a -l:libaws-c-event-stream.a -l:libaws-c-compression.a -l:libaws-checksums.a -l:libaws-c-io.a -l:libaws-c-cal.a -l:libaws-c-sdkutils.a -l:libaws-c-common.a -l:libs2n.a -l:libcrypto.a -lrt -lpython3.10 -o build/lib.linux-aar
ch64-cpython-310/_awscrt.cpython-310.so -pthread -Wl,-fatal_warnings
I cant grep any reference to either "fatal warning" option in the awscli repo, branch v2 at HEAD commit b06369b1d5b5e98e93974bd4ea714dc024e87850:
.../tmp.Nwh0N3p16Z/aws-cli $ grep -rE "fatal*warnings"
.../tmp.Nwh0N3p16Z/aws-cli $
So i'm guessing this is a problem with my local termux clang or lld package. Ill try to go deeper to see where these linker options are being set.
You have any bright ideas?
Edit: i dont see any reference to this linker option in llvm's lld nor gnu ld. Hmm...
Also im using python 3.10.6 and newer awscli v2 commit. Maybe you can try to repro in your environment to upgrade your awscli?
@timblaktu I was able to reproduce:
$ pkg upgrade
$ pkg install -y rust
$ python -m venv newvenv
$ source newvenv/bin/activate
$ git clone -b v2 https://github.com/aws/aws-cli.git new-aws-cli
$ cd new-aws-cli
$ pip install --upgrade pip
$ pip install ruamel.yaml==0.17.17
$ pip install -e .
Let me see if I can fix it
@missingcharacter turns out this is just a bug in awscrt python project, reported a couple months ago..
https://github.com/awslabs/aws-crt-python/issues/366
Ill try to track down the commit that added this bogus linker argument and try to build the previous version, or fork and fix..
Edit: bullseye
@timblaktu I was able to build with these instructions, let me know if these work and I'll update my docs
$ pkg upgrade
$ pkg install -y rust
$ python -m venv newvenv
$ source newvenv/bin/activate
$ git clone -b v2 https://github.com/aws/aws-cli.git new-aws-cli
$ cd new-aws-cli
$ pip install --upgrade pip
$ pip install ruamel.yaml==0.17.17
$ pip install awscrt==0.13.0
$ vim setup.cfg
$ git diff
diff --git a/setup.cfg b/setup.cfg index 91abf8b80..30dcf0048 100644 --- a/setup.cfg
+++ b/setup.cfg @@ -36,7 +36,7 @@ install_requires =
wcwidth<0.2.0 prompt-toolkit>=3.0.24,<3.0.29 distro>=1.5.0,<1.6.0
- awscrt>=0.12.4,<=0.14.0
+ awscrt==0.13.0
python-dateutil>=2.1,<3.0.0
jmespath>=0.7.1,<1.1.0
urllib3>=1.25.4,<1.27
$ pip install -e .
$ aws --version aws-cli/2.7.29 Python/3.10.6 Linux/5.10.107-android13-4-00008-g466e95df8c7c-ab8760753 source/aarch64 prompt/off
@missingcharacter Oh i see you used an old version of awscrt. You could also pre-imstall the awscrt dependency from my fork to get a newer version that works, using:
pip install git+https://github.com/timblaktu/aws-crt-python.git@bugfix366-fatal_warnings-linker-typo Collecting git+https://github.com/timblaktu/aws-crt-python.git@bugfix366-fatal_warnings-linker-typo Cloning https://github.com/timblaktu/aws-crt-python.git (to revision bugfix366-fatal_warnings-linker-typo) to /data/data/com.termux/files/usr/tmp/pip-req-build-x364gu7h Running command git clone --filter=blob:none --quiet https://github.com/timblaktu/aws-crt-python.git /data/data/com.termux/files/usr/tmp/pip-req-build-x364gu7h Running command git checkout -b bugfix366-fatal_warnings-linker-typo --track origin/bugfix366-fatal_warnings-linker-typo Switched to a new branch 'bugfix366-fatal_warnings-linker-typo' branch 'bugfix366-fatal_warnings-linker-typo' set up to track 'origin/bugfix366-fatal_warnings-linker-typo'. Resolved https://github.com/timblaktu/aws-crt-python.git to commit 9cbbd1b8ef7a2843de9aea54db13f79ef8d45a9f Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... done Using legacy 'setup.py install' for awscrt, since package 'wheel' is not installed. Installing collected packages: awscrt Running setup.py install for awscrt ... done Successfully installed awscrt-1.0.0.dev0
Wow, the state of python packaging is really messy. (Its been a while for me). So...
@missingcharacter, I was able to get my fork/branch working with the latest awscli version by modifying awscli's setup.py using:
sed -i 's/awscrt.*$/''awscrt @ git+ssh:\/\/git@github.com\/timblaktu\/aws-crt-python@366-localtest''/g' setup.cfg
Once they merge the awscrt PR, we can remove this hack..
Following your instructions for installing aws cli on termux, last step produces:
Using:
With: