]> arthur.barton.de Git - bup.git/commit
Bypass Python 3 glibc argv problems by routing args through env
authorRob Browning <rlb@defaultvalue.org>
Sun, 7 Jun 2020 14:05:26 +0000 (09:05 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 5 Jul 2020 16:16:22 +0000 (11:16 -0500)
commita4f58b2e4bb1a0208a9cec4b76a596d36134a881
tree214e45d613a32f0480fd3fb38ac390763da06370
parented4c09941a1f9df13ea3cd6a7522327c4009c8e4
Bypass Python 3 glibc argv problems by routing args through env

Until/unless https://sourceware.org/bugzilla/show_bug.cgi?id=26034 is
resolved by Python or GNU libc, sidestep the problem, which can crash
Python 3 during initialization, with a trivial sh wrapper that diverts
the command line arguments into BUP_ARGV_{0,1,2,...} environment
variables, since those can be safely retrieved.

Add compat.argvb and compat.argv and populate them at startup with the
BUP_ARGV_* values.  Adjust all the relevant commands to rely on those
vars instead of sys.argv.

Although the preamble say "rewritten during install", that's not in
place yet, but will be soon (when we drop LC_CTYPE and rework
bup-python).

Thanks to Johannes Berg for suggesting this, and help figuring out the
details.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
43 files changed:
lib/bup/compat.py
lib/cmd/bloom-cmd.py
lib/cmd/bup
lib/cmd/cat-file-cmd.py
lib/cmd/daemon-cmd.py
lib/cmd/damage-cmd.py
lib/cmd/drecurse-cmd.py
lib/cmd/fsck-cmd.py
lib/cmd/ftp-cmd.py
lib/cmd/fuse-cmd.py
lib/cmd/gc-cmd.py
lib/cmd/get-cmd.py
lib/cmd/help-cmd.py
lib/cmd/import-duplicity-cmd.py
lib/cmd/index-cmd.py
lib/cmd/init-cmd.py
lib/cmd/join-cmd.py
lib/cmd/list-idx-cmd.py
lib/cmd/ls-cmd.py
lib/cmd/margin-cmd.py
lib/cmd/memtest-cmd.py
lib/cmd/meta-cmd.py
lib/cmd/midx-cmd.py
lib/cmd/mux-cmd.py
lib/cmd/on--server-cmd.py
lib/cmd/on-cmd.py
lib/cmd/prune-older-cmd.py
lib/cmd/random-cmd.py
lib/cmd/restore-cmd.py
lib/cmd/rm-cmd.py
lib/cmd/save-cmd.py
lib/cmd/server-cmd.py
lib/cmd/split-cmd.py
lib/cmd/tag-cmd.py
lib/cmd/tick-cmd.py
lib/cmd/version-cmd.py
lib/cmd/web-cmd.py
lib/cmd/xstat-cmd.py
t/echo-argv-bytes
t/hardlink-sets
t/ns-timestamp-resolutions
t/test-argv
t/test-get