this post was submitted on 10 Jun 2024
25 points (100.0% liked)

Python

6337 readers
36 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

If I run this

#!/bin/bash

ARCH=$(python fetch_architecture.py)
if [ $ARCH == "aarch64" -o $ARCH == "armv71" ] ; then
    export PATH=/opt/local/llvm/bin:${PATH}
    cd /app
    RUSTFLAGS="-C linker=lld" wasm-pack build --target web --release plume-front
else
    wasm-pack build --target web --release plume-front
fi

via the terminal, it works just fine. But when I run it via the Dockerfile,

COPY . . 
RUN cargo install wasm-pack 
RUN chmod a+x ./script/plume-front.sh 
RUN sleep 1 
RUN ./script/plume-front.sh

It says python: command not found and then [: too many arguments

you are viewing a single comment's thread
view the rest of the comments
[–] wasabi@discuss.tchncs.de 1 points 4 months ago (1 children)

Could you elaborate on the weird behaviour introduced by pipefail?

[–] onlinepersona@programming.dev 2 points 4 months ago* (last edited 4 months ago) (1 children)

This wiki explains one pitfall of nonstandard return codes in pipes. The other one that bit me is pipes that just stop existing (error 141).

Anti Commercial-AI license

[–] wasabi@discuss.tchncs.de 1 points 4 months ago (1 children)

Thanks. Bash should just be avoided except trivial uses. It has an impressive collection of footguns. I've written a lot of bash, even used it for CGI scripts to create web tools, but honestly it is time to move on. Ansible and Python cover most of the bash use cases.

[–] onlinepersona@programming.dev 1 points 4 months ago

I fully agree with you. Hopefully newer shells will be used for distros (nushell, xonsh, osh, ...). Backwards compatibility with bash is a huge pitfall that should be a disqualification criterion.

Anti Commercial-AI license