
Raymond Toy pushed to branch issue-363-add-version-number at cmucl / cmucl Commits: a460d05f by Raymond Toy at 2025-02-08T07:50:42-08:00 Add -print-version option and use it in make-dist.sh to get version make-dist.sh needs to have a version that's consistent with the version used in lisp. To that end, we add a new string `cmucl_version` in lisp.c that has the version string that is used to setup the search list. To make this available, we also add a new commandline option, `-print-version` that just prints this string and exits. In make-dist.sh get the version number from `lisp -print-version`. In this way the created directory versions match what lisp thinks the version is. Without this, we sometimes end up in a situation where we can't find the core file. This can happen when we have a clean repo, do the build and end up with a dirty repo because the build update some pot files or something. Then make-dist ends up putting everything in the wrong directory. - - - - - 2 changed files: - bin/make-dist.sh - src/lisp/lisp.c Changes: ===================================== bin/make-dist.sh ===================================== @@ -94,11 +94,6 @@ def_arch_os () { # Figure out the architecture and OS in case options aren't given def_arch_os -# Choose a version based on the git hash as the default version. We -# only compute a default if the git hash looks like a snapshot -# ("snapshot-yyyy-mm") or a release number.. -DEFAULT_VERSION="`bin/git-version.sh`" - # Default compression is -J (xz). These variables are passed to the # other scripts via the environmen, so export them. COMPRESS=-J @@ -149,17 +144,6 @@ if [ -n "$COMPRESS_ARG" ]; then esac fi -if [ -z "$VERSION" ]; then - # If a default version exists, use it. Otherwise this is an - # error---at least one of these must not be empty. - if [ -z "${DEFAULT_VERSION}" ]; then - echo "Version (-V) must be specified because default version cannot be determined." - usage - else - VERSION=${DEFAULT_VERSION} - fi -fi - if [ ! -d "$1" ] then echo "$1 isn't a directory" @@ -180,6 +164,22 @@ fi TARGET="`echo $1 | sed 's:/*$::'`" +# Choose a version based on the git hash as the default version. We +# only compute a default if the git hash looks like a snapshot +# ("snapshot-yyyy-mm") or a release number.. +DEFAULT_VERSION="`$TARGET/lisp/lisp -print-version`" + +if [ -z "$VERSION" ]; then + # If a default version exists, use it. Otherwise this is an + # error---at least one of these must not be empty. + if [ -z "${DEFAULT_VERSION}" ]; then + echo "Version (-V) must be specified because default version cannot be determined." + usage + else + VERSION=${DEFAULT_VERSION} + fi +fi + echo INSTALL_DIR = $INSTALL_DIR echo cmucl-$VERSION-$ARCH-$OS ===================================== src/lisp/lisp.c ===================================== @@ -95,6 +95,9 @@ alloc_str_list(const char *list[]) } /* Default paths for CMUCLLIB */ + +static char cmucl_version[] = CMUCL_VERSION; + static char *cmucllib_search_list[] = { "./../lib/cmucl/" CMUCL_VERSION "/lib", NULL @@ -676,7 +679,14 @@ main(int argc, const char *argv[], const char *envp[]) debug_lisp_search = TRUE; } else if (strcmp(arg, "-unidata") == 0) { unidata = *++argptr; - } + } else if (strcmp(arg, "-print-version") == 0) { + /* + * Print the version and exit; we don't want to do + * anything else! + */ + printf("%s\n", cmucl_version); + return 0; + } } default_core = arch_init(fpu_mode); View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a460d05ff6c4dbfff7bf6ead... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a460d05ff6c4dbfff7bf6ead... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)