From e411ee141199f543f55cebdc0d58a0428fda8dfc Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 22 Mar 2025 11:14:07 +0200 Subject: [PATCH] thirdparty: update thirdparty-linux-amd64_tcc.sh, to also record its own full invocation command, and commit the changes automatically --- .../thirdparty-linux-amd64_tcc.sh | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/thirdparty/build_scripts/thirdparty-linux-amd64_tcc.sh b/thirdparty/build_scripts/thirdparty-linux-amd64_tcc.sh index 8e4684bea3..0f38542b4c 100755 --- a/thirdparty/build_scripts/thirdparty-linux-amd64_tcc.sh +++ b/thirdparty/build_scripts/thirdparty-linux-amd64_tcc.sh @@ -1,4 +1,18 @@ -#!/usr/bin/env bash +## NOTE: this script does *not* use a shebang **deliberately**, in order to +## access the same shell, to capture its own launching command with `fc`, +## and to record it later in the new commit message in thirdpart/tcc. + +## WARNING: THE ORIGINAL OF THIS SCRIPT IS IN: +## https://github.com/vlang/v/blob/master/thirdparty/build_scripts/thirdparty-linux-amd64_tcc.sh , +## I.E. IN THE MAIN V REPOSITORY. IF YOU NEED TO MAKE CHANGES, CHANGE THAT. +## +## THE `build.sh` FILE IN `vlang/tccbin` REPO IS A COPY, RECORDED AT THE TIME +## OF REBUILDING, FOR EASIER/RELIABLE REPRODUCTION OF HISTORIC VERSIONS. +## IT IS NOT INTENDED TO BE MODIFIED. + +BUILD_CMD=`fc -nl -0` +## remove whitespaces before/after the actual command: +BUILD_CMD="$(echo "${BUILD_CMD}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" set -e @@ -13,9 +27,10 @@ export TCC_COMMIT="${TCC_COMMIT:-mob}" export TCC_FOLDER="${TCC_FOLDER:-thirdparty/tcc.$TCC_COMMIT}" export CC="${CC:-gcc}" +echo " BUILD_CMD: \`$BUILD_CMD\`" echo " CC: $CC" echo "TCC_COMMIT: $TCC_COMMIT" -echo "TCC_FOLDER: $TCC_FOLDER" +echo "TCC_FOLDER: \`$TCC_FOLDER\`" echo =============================================================== rm -rf tinycc/ @@ -69,4 +84,11 @@ uname -a > $TCC_FOLDER/build_machine_ ## show the builtin search paths for sanity checking: $TCC_FOLDER/tcc.exe -v -v +pushd . +cd $TCC_FOLDER +git add . +git commit -m "build with \`$BUILD_CMD\`" +popd + echo "tcc commit: $TCC_COMMIT , full hash: $TCC_COMMIT_FULL_HASH . The tcc executable is ready in $TCC_FOLDER/tcc.exe " +