This is one of those things I don’t know where to post. Feel free to flame me for selecting this group, or move it somewhere you think is more appropriate. Sorry, it also turned out to be longer than I thought.
I don’t really do much development anymore, but I still like to track changes to recent branches. Every now and then, my sorta old-and-weird personal environment reveals a minor problem. Every day or two I get bored and run something like
git fetch --all
git pull
nice make -j test
Sometimes I need to re-run configure
or want to add another argument to the configure command line to enable something I normally live without. I will
grep configure config.status
then copy/paste the relevant configure
command line to the shell prompt and (maybe) add new arg(s). That’s fine as far as it goes, as I don’t often need to do that. I’m sure there’s a way to add the args when rerunning config.status
, but I’ve never bothered to figure it out.
The problem arises when I sometimes need to run git clean -fdx
because the Makefile
dependencies aren’t perfect and the loader got its knickers in a twist. So it’s
git clean -fdx
./configure
nice make -j test
except now I’ve lost whatever args were lurking in config.status
. Dang. Then I came up with this:
mv config.status ..
git clean -fdx
mv ../config.status .
./config.status --recheck
nice make -j test
Much better, but man, I still have to remember the mv
commands. And anyway, I’m a (retired) software engineer, so by nature, I’m lazy. That’s two whole extra commands! Plus if I’m super lazy one day and forget them, I’m back to square one.
Today it finally (after what, 30 years?) dawned on me that I could stash my configure
args in my own file! My Mac’s directory structure looks like this:
/Users/skip
/src
/python
/cpython
/3.13
/3.12
(similar on my old Dell laptop and Raspberry Pi)
I created a file named config-args.cpython
in my .../src/python
directory, where git clean
can’t find it:
--enable-framework=./framework
--with-framework-name=fred
--with-openssl=/opt/homebrew/Cellar/openssl@3/3.3.1
--with-readline=readline
LIBREADLINE_CFLAGS=-I/opt/homebrew/Cellar/readline/8.2.10/include
LIBREADLINE_LIBS='-L/opt/homebrew/Cellar/readline/8.2.10/lib -lreadline'
LIBB2_CFLAGS='-I/opt/homebrew/include'
PKG_CONFIG=/opt/homebrew/Cellar/pkg-config/0.29.2_3/bin/pkg-config
and can rerun configure
using xargs
:
xargs ./configure << ../config-args.cpython
The process is similar for the 3.13 and 3.12 branches. Oh, and I could easily have multiple “mixin” arg files, say for building with different compilers or different OpenSSL versions. That suggests a slightly different xargs command:
cat ../config.args.cpython ../config.args.g++ ../config.args.framework | xargs ./configure
This will be useful for maybe three people in the next decade, and will probably shake loose thirty-seven better ways of skinning this cat(*) which never occurred to me, but this seems good enough for now.
(*) Please don’t tell anybody on Threads that I occasionally skin cats. I will never hear the end of it.