[Git][cmucl/cmucl][issue-379-gnu-style-options] 4 commits: Fix #363: Add version number to files and directories

Raymond Toy pushed to branch issue-379-gnu-style-options at cmucl / cmucl Commits: 009e1382 by Raymond Toy at 2025-02-13T16:00:10+00:00 Fix #363: Add version number to files and directories - - - - - 5269a666 by Raymond Toy at 2025-02-13T16:00:10+00:00 Merge branch 'issue-363-add-version-number' into 'master' Fix #363: Add version number to files and directories Closes #363 See merge request cmucl/cmucl!261 - - - - - a35904d4 by Raymond Toy at 2025-02-14T07:44:20-08:00 Merge branch 'master' into issue-379-gnu-style-options - - - - - 4ae52140 by Raymond Toy at 2025-02-14T07:54:30-08:00 Update pot file because docstrings have changed. - - - - - 23 changed files: - .gitlab-ci.yml - bin/build-utils.sh - bin/build.sh - bin/cross-build-world.sh - + bin/git-version.sh - bin/load-world.sh - bin/make-dist.sh - bin/make-extra-dist.sh - bin/make-main-dist.sh - bin/make-src-dist.sh - bin/run-unit-tests.sh - src/code/commandline.lisp - src/code/default-site-init.lisp - src/compiler/arm/parms.lisp - src/compiler/ppc/parms.lisp - src/compiler/sparc/parms.lisp - src/compiler/x86/parms.lisp - src/general-info/release-21f.md - src/i18n/locale/cmucl-bsd-os.pot - src/i18n/locale/cmucl-unix.pot - src/i18n/locale/cmucl.pot - src/lisp/lisp.c - src/tools/worldload.lisp Changes: ===================================== .gitlab-ci.yml ===================================== @@ -51,9 +51,9 @@ linux:build: # instead of clang. - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp # - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp - # Use -V to specify the version in case some tag makes git - # describe return something that make-dist.sh doesn't like. - - bin/make-dist.sh -V `git describe --dirty` -I dist linux-4 + # When the result of `git describe` cannot be used as a version + # string, an alternative can be provided with the -V flag + - bin/make-dist.sh -I dist linux-4 linux:cross-build: stage: build @@ -80,8 +80,8 @@ linux:cross-build: - bin/create-target.sh xtarget - bin/create-target.sh xcross - bin/cross-build-world.sh -crl xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp dist/bin/lisp - - bin/build.sh -b xlinux $bootstrap -R -C "" -o xtarget/lisp/lisp - - bin/make-dist.sh -V `git describe --dirty` -I xdist xlinux-4 + - bin/build.sh -b xlinux $bootstrap -R -C "" -o "xtarget/lisp/lisp -lib xtarget/lisp" + - bin/make-dist.sh -I xdist xlinux-4 linux:test: stage: test @@ -194,9 +194,9 @@ osx:build: # Regular build using the cross-compiled result or snapshot. # Need /opt/local/bin to get msgmerge and msgfmt programs. - PATH=/opt/local/bin:$PATH bin/build.sh $bootstrap -R -C "" -o snapshot/bin/lisp - # Use -V to specify the version in case some tag makes git + # If needed use -V to specify the version in case some tag makes git # describe return something that make-dist.sh doesn't like. - - bin/make-dist.sh -V `git describe --dirty` -I dist darwin-4 + - bin/make-dist.sh -I dist darwin-4 osx:test: stage: test @@ -319,9 +319,9 @@ opensuse:build: # instead of clang. - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp # - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp - # Use -V to specify the version in case some tag makes git + # If needed use -V to specify the version in case some tag makes git # describe return something that make-dist.sh doesn't like. - - bin/make-dist.sh -V `git describe --dirty` -I dist linux-4 + - bin/make-dist.sh -I dist linux-4 opensuse:test: stage: test ===================================== bin/build-utils.sh ===================================== @@ -16,7 +16,7 @@ TARGET="`echo $1 | sed 's:/*$::'`" shift $TARGET/lisp/lisp \ - -noinit -nositeinit -batch "$@" <<EOF || exit 3 + -lib $TARGET/lisp -noinit -nositeinit -batch "$@" <<EOF || exit 3 (in-package :cl-user) (setf lisp::*enable-package-locked-errors* nil) ===================================== bin/build.sh ===================================== @@ -110,6 +110,13 @@ case `uname -s` in esac ;; esac +# Set default version and generate lisp/cmucl-version.h +DEFAULT_VERSION="`bin/git-version.sh`" +export DEFAULT_VERISON +echo DEFAULT_VERSION = $DEFAULT_VERSION + +bin/git-version.sh -f > src/lisp/cmucl-version.h + export LANG=en_US.UTF-8 buildit () @@ -142,9 +149,10 @@ buildit () then $BUILDWORLD $TARGET $OLDLISP $BOOT || { echo "Failed: $BUILDWORLD"; exit 1; } fi - $TOOLDIR/load-world.sh $TARGET "$VERSION" || { echo "Failed: $TOOLDIR/load-world.sh"; exit 1; } + $TOOLDIR/load-world.sh $TARGET || { echo "Failed: $TOOLDIR/load-world.sh"; exit 1; } + + $TARGET/lisp/lisp -lib $TARGET/lisp -batch -noinit -nositeinit < /dev/null || { echo "Failed: $TARGET/lisp/lisp -batch -noinit"; exit 1; } - $TARGET/lisp/lisp -batch -noinit -nositeinit < /dev/null || { echo "Failed: $TARGET/lisp/lisp -batch -noinit"; exit 1; } return 0; fi } @@ -221,7 +229,7 @@ buildit bootfiles= TARGET=$BASE-3 -OLDLISP="${BASE}-2/lisp/lisp $OLDLISPFLAGS" +OLDLISP="${BASE}-2/lisp/lisp -lib ${BASE}-2/lisp $OLDLISPFLAGS" ENABLE=$ENABLE3 BUILD=2 @@ -232,7 +240,7 @@ buildit TARGET=$BASE-4 CLEAN_FLAGS="-K all" -OLDLISP="${BASE}-3/lisp/lisp $OLDLISPFLAGS" +OLDLISP="${BASE}-3/lisp/lisp -lib ${BASE}-3/lisp $OLDLISPFLAGS" ENABLE=$ENABLE4 if [ "${BUILD_POT}" = "yes" ]; then @@ -250,7 +258,7 @@ buildit # Asdf and friends are part of the base install, so we need to build # them now. -$TARGET/lisp/lisp -noinit -nositeinit -batch << EOF || exit 3 +$TARGET/lisp/lisp -lib $TARGET/lisp -noinit -nositeinit -batch << EOF || exit 3 (in-package :cl-user) (setf (ext:search-list "target:") '("$TARGET/" "src/")) @@ -270,7 +278,7 @@ EOF if [ "$SKIPUTILS" = "no" ]; then - OLDLISP="${BASE}-4/lisp/lisp $OLDLISPFLAGS" + OLDLISP="${BASE}-4/lisp/lisp -lib ${BASE}-4/lisp $OLDLISPFLAGS" time $TOOLDIR/build-utils.sh $TARGET fi ===================================== bin/cross-build-world.sh ===================================== @@ -138,10 +138,11 @@ EOF if [ "$BUILD_RUNTIME" = "yes" ]; then echo Building runtime + bin/git-version.sh -f > src/lisp/cmucl-version.h (cd $TARGET/lisp; ${MAKE}) fi if [ "$LOAD_KERNEL" = "yes" ]; then echo Load kernel.core - bin/load-world.sh -p $TARGET cross-compiled + bin/load-world.sh -p $TARGET fi ===================================== bin/git-version.sh ===================================== @@ -0,0 +1,39 @@ +#!/bin/sh + +# If FILE=yes, print out the version as a C file #define. Otherwise, +# just print the version to stdout and exit. +FILE="" + +while getopts "f" arg; do + case $arg in + f) FILE=yes + ;; + esac +done + +# Script to determine the cmucl version based on git describe +GIT_HASH="`(git describe --dirty 2>/dev/null || git describe 2>/dev/null)`" + +if [ `expr "X$GIT_HASH" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]'` != 0 ]; then + # The git hash looks like snapshot-yyyy-mm-<stuff>. Remove the + # "snapshot-" part. + DEFAULT_VERSION=`expr "$GIT_HASH" : "snapshot-\(.*\)"` +elif [ `expr "X$GIT_HASH" : 'X[0-9][0-9][a-f]'` != 0 ]; then + # The git hash looks like a release which is 3 hex digits. Use it as is. + DEFAULT_VERSION="${GIT_HASH}" +fi + +if [ -z "$FILE" ]; then + echo $DEFAULT_VERSION +else + cat <<EOF +/* + * Cmucl version + * + * DO NOT EDIT! This file is auto-generated via bin/git-version.sh. + */ + +#define CMUCL_VERSION "$DEFAULT_VERSION" +EOF +fi + ===================================== bin/load-world.sh ===================================== @@ -2,30 +2,14 @@ usage() { - echo "load-world.sh [-?p] target-directory [version-string]" + echo "load-world.sh [-?p] target-directory" echo " -p Skip loading of PCL (Mostly for cross-compiling)" echo " -? This help" - echo " If the version-string is not given, the current date and time is used" exit 1 } SKIP_PCL= NO_PCL_FEATURE= -# Default version is the date with the git hash. Older versions of -# git don't support --dirty, but the output in that case is what we -# want (except for ending with "dirty"), so we're set. -GIT_HASH="`(cd src; git describe --dirty 2>/dev/null || git describe 2>/dev/null)`" - -# If the git hash looks like a snapshot tag or release, don't add the date. -VERSION="`date '+%Y-%m-%d %H:%M:%S'`${GIT_HASH:+ $GIT_HASH}" -if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then - VERSION="${GIT_HASH}" -fi - -if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then - VERSION="${GIT_HASH}" -fi -echo $VERSION while getopts "p" arg do ===================================== bin/make-dist.sh ===================================== @@ -94,21 +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.. -GIT_HASH="`(cd src; git describe --dirty 2>/dev/null)`" - -echo GIT_HASH = ${GIT_HASH} - -if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then - DEFAULT_VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"` -fi - -if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then - DEFAULT_VERSION="${GIT_HASH}" -fi - # Default compression is -J (xz). These variables are passed to the # other scripts via the environmen, so export them. COMPRESS=-J @@ -159,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" @@ -190,10 +164,24 @@ fi TARGET="`echo $1 | sed 's:/*$::'`" -if [ -n "$INSTALL_DIR" ]; then - VERSION="today" +# 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 --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 ROOT=`dirname $0` ===================================== bin/make-extra-dist.sh ===================================== @@ -66,6 +66,8 @@ VERSION=$2 ARCH=$3 OS=$4 +CMUCLLIBVER="lib/cmucl/$VERSION" + case $ARCH in x86*) FASL="sse2f" ;; sparc*) FASL=sparcf ;; @@ -90,41 +92,29 @@ if [ -z "$INSTALL_DIR" ]; then fi echo Installing extra components -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/subsystems +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/subsystems -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/contrib +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/contrib for ext in $FASL do install ${GROUP} ${OWNER} -m 0644 $TARGET/clx/clx-library.$ext \ - $DESTDIR/lib/cmucl/lib/subsystems/ + $DESTDIR/$CMUCLLIBVER/lib/subsystems/ install ${GROUP} ${OWNER} -m 0644 $TARGET/hemlock/hemlock-library.$ext \ - $DESTDIR/lib/cmucl/lib/subsystems/ + $DESTDIR/$CMUCLLIBVER/lib/subsystems/ install ${GROUP} ${OWNER} -m 0644 $TARGET/interface/clm-library.$ext \ - $DESTDIR/lib/cmucl/lib/subsystems/ + $DESTDIR/$CMUCLLIBVER/lib/subsystems/ done -# Not sure we really need these, but we'll install them in the -# ext-formats directory. (Should they go somewhere else?) -#install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/ext-formats -#for f in src/i18n/NameAliases.txt src/i18n/UnicodeData.txt -#do -# echo $f -# install ${GROUP} ${OWNER} -m 0644 $f $DESTDIR/lib/cmucl/lib/ext-formats/ -#done - -# install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/fonts/ -# install ${GROUP} ${OWNER} -m 0644 misc/8x13u.snf misc/fonts.dir \ -# $DESTDIR/lib/cmucl/lib/fonts/ install ${GROUP} ${OWNER} -m 0644 src/hemlock/XKeysymDB \ src/hemlock/hemlock11.cursor src/hemlock/hemlock11.mask \ $TARGET/hemlock/spell-dictionary.bin \ - $DESTDIR/lib/cmucl/lib/ -install ${GROUP} ${OWNER} -m 0755 src/hemlock/mh-scan $DESTDIR/lib/cmucl/lib/ + $DESTDIR/$CMUCLLIBVER/lib/ +install ${GROUP} ${OWNER} -m 0755 src/hemlock/mh-scan $DESTDIR/$CMUCLLIBVER/lib/ install ${GROUP} ${OWNER} -m 0755 $TARGET/motif/server/motifd \ - $DESTDIR/lib/cmucl/lib/ + $DESTDIR/$CMUCLLIBVER/lib/ # Install the contrib stuff. Create the directories and then copy the files. # @@ -132,39 +122,29 @@ install ${GROUP} ${OWNER} -m 0755 $TARGET/motif/server/motifd \ # these directories. for d in `(cd src; find contrib -type d -print | grep -v "asdf\|defsystem")` do - install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/$d + install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/$d done for f in `(cd src/contrib; find . -type f -print | grep -v "asdf\|defsystem\|unix")` do - FILE=`basename $f` DIR=`dirname $f` - install ${GROUP} ${OWNER} -m 0644 src/contrib/$f $DESTDIR/lib/cmucl/lib/contrib/$DIR + install ${GROUP} ${OWNER} -m 0644 src/contrib/$f $DESTDIR/$CMUCLLIBVER/lib/contrib/$DIR done # Install all the locale data. for d in `(cd src/i18n/; find locale -type d -print)` do - install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/$d + install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/$d done # Install mo files. Ignore any emacs-style backup files. for f in `(cd $TARGET/i18n; find locale -type f -print | grep -v '~.*~\|.*~')` do - FILE=`basename $f` DIR=`dirname $f` - install ${GROUP} ${OWNER} -m 0644 $TARGET/i18n/$f $DESTDIR/lib/cmucl/lib/$DIR + install ${GROUP} ${OWNER} -m 0644 $TARGET/i18n/$f $DESTDIR/$CMUCLLIBVER/lib/$DIR done -# Install po files. (Do we really need to distribute the po files?) -#for f in `(cd $TARGET/i18n; find locale -type f -print | grep -v '~.*~\|.*~')` -#do -# FILE=`basename $f` -# DIR=`dirname $f` -# install ${GROUP} ${OWNER} -m 0644 $TARGET/i18n/$f $DESTDIR/lib/cmucl/lib/$DIR -#done - if [ -z "$INSTALL_DIR" ]; then sync ; sleep 1 ; sync ; sleep 1 ; sync echo Tarring extra components ===================================== bin/make-main-dist.sh ===================================== @@ -64,14 +64,24 @@ then exit 2 fi -DESTDIR=${INSTALL_DIR:-release-$$} -DOCDIR=${DOCDIR:-doc/cmucl} -MANDIR=${MANDIR:-man/man1} -TARGET="`echo $1 | sed 's:/*$::'`" VERSION=$2 ARCH=$3 OS=$4 +# Where to install the main library of cmucl files +CMUCLLIBVER="lib/cmucl/$VERSION" + +# Where to install everything +DESTDIR=${INSTALL_DIR:-release-$$} + +# Where to install docs +DOCDIR=${DOCDIR:-share/cmucl/$VERSION/doc} + +# Where to install man pages +MANDIR=${MANDIR:-share/man/man1} + +TARGET="`echo $1 | sed 's:/*$::'`" + # Core file to look for. CORE=lisp.core case $ARCH in @@ -123,52 +133,59 @@ fi # set -x echo Installing main components install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/bin -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/subsystems -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/ext-formats +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/subsystems +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/ext-formats install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/${DOCDIR} install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/${MANDIR} -install ${GROUP} ${OWNER} -m 0755 $TARGET/lisp/lisp $DESTDIR/bin/ +install ${GROUP} ${OWNER} -m 0755 $TARGET/lisp/lisp $DESTDIR/bin/lisp-$VERSION +# Install symlink for lisp +(cd $DESTDIR/bin; ln -fs lisp-$VERSION lisp) +# Install symlink for man pages +(cd $DESTDIR/${MANDIR} + ln -fs lisp-$VERSION.1 lisp.1 + ln -fs cmucl-$VERSION.1 cmucl.1) + if [ "$EXECUTABLE" = "true" ] then - install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/lisp.a $DESTDIR/lib/cmucl/lib/ - install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/exec-init.o $DESTDIR/lib/cmucl/lib/ - install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/exec-final.o $DESTDIR/lib/cmucl/lib/ - install ${GROUP} ${OWNER} -m 0755 src/tools/linker.sh $DESTDIR/lib/cmucl/lib/ + install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/lisp.a $DESTDIR/$CMUCLLIBVER/lib/ + install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/exec-init.o $DESTDIR/$CMUCLLIBVER/lib/ + install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/exec-final.o $DESTDIR/$CMUCLLIBVER/lib/ + install ${GROUP} ${OWNER} -m 0755 src/tools/linker.sh $DESTDIR/$CMUCLLIBVER/lib/ if [ -f src/tools/$SCRIPT-cmucl-linker-script ]; then - install ${GROUP} ${OWNER} -m 0755 src/tools/$SCRIPT-cmucl-linker-script $DESTDIR/lib/cmucl/lib/ + install ${GROUP} ${OWNER} -m 0755 src/tools/$SCRIPT-cmucl-linker-script $DESTDIR/$CMUCLLIBVER/lib/ fi fi for corefile in $TARGET/lisp/$CORE do - install ${GROUP} ${OWNER} -m 0644 $corefile $DESTDIR/lib/cmucl/lib/ + install ${GROUP} ${OWNER} -m 0644 $corefile $DESTDIR/$CMUCLLIBVER/lib/ done install ${GROUP} ${OWNER} -m 0755 src/tools/load-foreign.csh src/tools/config \ - $DESTDIR/lib/cmucl/lib/ + $DESTDIR/$CMUCLLIBVER/lib/ install ${GROUP} ${OWNER} -m 0644 src/tools/config.lisp \ - $DESTDIR/lib/cmucl/lib/ + $DESTDIR/$CMUCLLIBVER/lib/ install ${GROUP} ${OWNER} -m 0644 src/code/default-site-init.lisp \ - $DESTDIR/lib/cmucl/lib/ + $DESTDIR/$CMUCLLIBVER/lib/ install ${GROUP} ${OWNER} -m 0644 $TARGET/lisp/lisp.nm $TARGET/lisp/lisp.map \ - $TARGET/lisp/internals.h $TARGET/lisp/internals.inc $DESTDIR/lib/cmucl/ -install ${GROUP} ${OWNER} -m 0755 src/tools/sample-wrapper $DESTDIR/lib/cmucl/ + $TARGET/lisp/internals.h $TARGET/lisp/internals.inc $DESTDIR/$CMUCLLIBVER/ +install ${GROUP} ${OWNER} -m 0755 src/tools/sample-wrapper $DESTDIR/$CMUCLLIBVER/ for f in gray-streams gray-compat simple-streams iodefs do - install ${GROUP} ${OWNER} -m 0644 $TARGET/pcl/$f-library.$FASL $DESTDIR/lib/cmucl/lib/subsystems/ + install ${GROUP} ${OWNER} -m 0644 $TARGET/pcl/$f-library.$FASL $DESTDIR/$CMUCLLIBVER/lib/subsystems/ done for f in src/pcl/simple-streams/external-formats/*.lisp src/pcl/simple-streams/external-formats/aliases src/i18n/unidata.bin do - install ${GROUP} ${OWNER} -m 0644 $f $DESTDIR/lib/cmucl/lib/ext-formats/ + install ${GROUP} ${OWNER} -m 0644 $f $DESTDIR/$CMUCLLIBVER/lib/ext-formats/ done # set -x # Create the directories for asdf and defsystem for f in asdf defsystem asdf/doc do - install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/contrib/$f + install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/contrib/$f done case `uname -s` in @@ -176,34 +193,34 @@ case `uname -s` in *) UCONTRIB="unix" ;; esac -install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/lib/cmucl/lib/contrib/unix -install ${GROUP} ${OWNER} -m 0644 $TARGET/contrib/unix/$UCONTRIB.$FASL $DESTDIR/lib/cmucl/lib/contrib/unix -install ${GROUP} ${OWNER} -m 0644 src/contrib/load-unix.lisp $DESTDIR/lib/cmucl/lib/contrib -install ${GROUP} ${OWNER} -m 0644 src/contrib/unix/${UCONTRIB}.lisp $DESTDIR/lib/cmucl/lib/contrib/unix +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/$CMUCLLIBVER/lib/contrib/unix +install ${GROUP} ${OWNER} -m 0644 $TARGET/contrib/unix/$UCONTRIB.$FASL $DESTDIR/$CMUCLLIBVER/lib/contrib/unix +install ${GROUP} ${OWNER} -m 0644 src/contrib/load-unix.lisp $DESTDIR/$CMUCLLIBVER/lib/contrib +install ${GROUP} ${OWNER} -m 0644 src/contrib/unix/${UCONTRIB}.lisp $DESTDIR/$CMUCLLIBVER/lib/contrib/unix # Copy the source files for asdf and defsystem for f in `(cd src; find contrib/asdf contrib/defsystem -type f -print | grep -v CVS)` do - install ${GROUP} ${OWNER} -m 0644 src/$f $DESTDIR/lib/cmucl/lib/$f + install ${GROUP} ${OWNER} -m 0644 src/$f $DESTDIR/$CMUCLLIBVER/lib/$f done # Install the fasl files for asdf and defsystem for f in asdf defsystem do - install ${GROUP} ${OWNER} -m 0644 $TARGET/contrib/$f/$f.$FASL $DESTDIR/lib/cmucl/lib/contrib/$f + install ${GROUP} ${OWNER} -m 0644 $TARGET/contrib/$f/$f.$FASL $DESTDIR/$CMUCLLIBVER/lib/contrib/$f done # Install the docs for asdf for f in src/contrib/asdf/doc/* do base=`basename $f` - install ${GROUP} ${OWNER} -m 0644 $f $DESTDIR/lib/cmucl/lib/contrib/asdf/doc/$base + install ${GROUP} ${OWNER} -m 0644 $f $DESTDIR/$CMUCLLIBVER/lib/contrib/asdf/doc/$base done install ${GROUP} ${OWNER} -m 0644 src/general-info/cmucl.1 \ - $DESTDIR/${MANDIR}/ + $DESTDIR/${MANDIR}/cmucl-$VERSION.1 install ${GROUP} ${OWNER} -m 0644 src/general-info/lisp.1 \ - $DESTDIR/${MANDIR}/ + $DESTDIR/${MANDIR}/lisp-$VERSION.1 install ${GROUP} ${OWNER} -m 0644 src/general-info/README $DESTDIR/${DOCDIR} if [ -f src/general-info/release-$VERSION.txt ] then ===================================== bin/make-src-dist.sh ===================================== @@ -52,12 +52,18 @@ else VERSION="`date '+%Y-%m-%d-%H:%M:%S'`" fi +DESTDIR=${INSTALL_DIR:-release-$$} + echo Creating source distribution GTAR_OPTIONS="--exclude=.git --exclude='*.pot.~*~'" +install -d ${GROUP} ${OWNER} -m 0755 $DESTDIR/share/cmucl/$VERSION/ +install ${GROUP} ${OWNER} -m 0755 bin/run-unit-tests.sh $DESTDIR/bin +${GTAR} ${GTAR_OPTIONS} -cf - src tests | (cd $DESTDIR/share/cmucl/$VERSION; ${GTAR} xf -) if [ -z "$INSTALL_DIR" ]; then # echo " Compressing with $ZIP" - ${GTAR} ${GTAR_OPTIONS} ${COMPRESS} -cf cmucl-src-$VERSION.tar.$COMPRESS_EXT bin src tests + ls $DESTDIR/share/cmucl/$VERSION/ + ${GTAR} ${GTAR_OPTIONS} ${COMPRESS} -C $DESTDIR -cf cmucl-src-$VERSION.tar.$COMPRESS_EXT share/cmucl/$VERSION/src else # Install in the specified directory - ${GTAR} ${GTAR_OPTIONS} -cf - bin src tests | (cd $INSTALL_DIR; ${GTAR:-tar} xf -) + ${GTAR} ${GTAR_OPTIONS} -cf - src tests | (cd $DESTDIR/share/cmucl/$VERSION; ${GTAR:-tar} xf -) fi ===================================== bin/run-unit-tests.sh ===================================== @@ -6,7 +6,8 @@ # then just those tests are run. usage() { - echo "run-tests.sh [?] [-l lisp] [tests]" + echo "run-tests.sh [?] [-d test-dir] [-l lisp] [tests]" + echo " -d test-dir Directory containing the unit test files" echo " -l lisp Lisp to use for the tests; defaults to lisp" echo " -? This help message" echo "" @@ -23,10 +24,11 @@ usage() { } LISP=lisp -while getopts "h?l:" arg +while getopts "h?l:d:" arg do case $arg in l) LISP=$OPTARG ;; + d) TESTDIR=$OPTARG ;; \?) usage ;; esac done @@ -47,14 +49,21 @@ function cleanup { trap cleanup EXIT +if [ -n "${TESTDIR}" ]; then + TESTDIRARG=" :test-directory \"$TESTDIR/\"" +else + TESTDIR="tests/" + TESTDIRARG="" +fi # Compile up the C file that is used for testing alien funcalls to # functions that return integer types of different lengths. We use # gcc since clang isn't always available. -(cd tests; gcc -m32 -O3 -c test-return.c) +(cd "$TESTDIR"; gcc -m32 -O3 -c test-return.c) if [ $# -eq 0 ]; then + # Test directory arg for run-all-tests if a non-default # No args so run all the tests - $LISP -nositeinit -noinit -load tests/run-tests.lisp -eval '(cmucl-test-runner:run-all-tests)' + $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(cmucl-test-runner:run-all-tests ${TESTDIRARG})" else # Run selected files. Convert each file name to uppercase and append "-TESTS" result="" @@ -63,6 +72,6 @@ else new=`echo $f | tr '[a-z]' '[A-Z]'` result="$result "\"$new-TESTS\" done - $LISP -nositeinit -noinit -load tests/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" + $LISP -nositeinit -noinit -load "$TESTDIR"/run-tests.lisp -eval "(progn (cmucl-test-runner:load-test-files) (cmucl-test-runner:run-test $result))" fi ===================================== src/code/commandline.lisp ===================================== @@ -416,5 +416,9 @@ (format t "~A~%" (lisp-implementation-version)) (ext:quit)) +;; the switches "-version" and "--version" are never actually called +;; from lisp because main() handles it and returns before the lisp +;; initial function is ever run. It's here so that -help will print +;; it out so the user knows about it. (defswitch "version" #'version-switch-demon - "Prints the cmucl version and exits") + "Prints the cmucl version and exits, without loading the lisp core.") ===================================== src/code/default-site-init.lisp ===================================== @@ -32,13 +32,22 @@ ;;; bin/ ;;; lib/ ;;; cmucl/ -;;; lib/ -;;; lisp*.coore -;;; man/ -;;; src/ +;;; <version>/ +;;; lib/ +;;; share/ +;;; cmucl/ +;;; <version>/ +;;; src/ +;;; tests/ +;;; man/ +;;; man1/ ;;; ;;; If your sources are located somewhere else, change this ;;; accordingly. -(setf (search-list "target:") - '("library:../src/")) +(push (pathname + (concatenate 'string + "library:../../../../share/cmucl/" + lisp::*lisp-implementation-version* + "/src/")) + (search-list "target:")) ===================================== src/compiler/arm/parms.lisp ===================================== @@ -343,11 +343,11 @@ :key-or-value lisp::*unidata-path* + lisp::*lisp-implementation-version* ;; Some spare static symbols. Useful for adding another static ;; symbol without having to do a cross-compile. Just rename one ;; of these to the desired name. - spare-9 spare-8 spare-7 spare-6 ===================================== src/compiler/ppc/parms.lisp ===================================== @@ -295,9 +295,9 @@ :key-and-value :key-or-value + lisp::*lisp-implementation-version* ;; Spare symbols. Rename these when you need to add some static ;; symbols and don't want to do a cross-compile. - sparc-9 spare-8 spare-7 spare-6 ===================================== src/compiler/sparc/parms.lisp ===================================== @@ -358,11 +358,11 @@ *fp-constant-0f0* lisp::*unidata-path* + lisp::*lisp-implementation-version* ;; Some spare static symbols. Useful for adding another static ;; symbol without having to do a cross-compile. Just rename one ;; of these to the desired name. - spare-9 spare-8 spare-7 spare-6 ===================================== src/compiler/x86/parms.lisp ===================================== @@ -380,9 +380,9 @@ :key-or-value lisp::*unidata-path* + lisp::*lisp-implementation-version* ;; Spare symbols. Rename these when you need to add some static ;; symbols and don't want to do a cross-compile. - spare-9 spare-8 spare-7 spare-6 ===================================== src/general-info/release-21f.md ===================================== @@ -27,6 +27,8 @@ public domain. * The RNG has changed from an old version of xoroshiro128+ to xoroshiro128**. This means sequences of random numbers will be different from before. See ~~#276~~. + * The layout of the distribution has changed. Version numbers are + added to files and directories. For the exact layout, see !261. * ANSI compliance fixes: * Bug fixes: * Gitlab tickets: @@ -112,6 +114,8 @@ public domain. * ~~#360~~ Adding site-init file * ~~#361~~ Add herald item to mention where to report issues * ~~#362~~ Simplify "library:" search-list + * ~~#363~~ Version numbers added to files and directories. The + distribution layout has changed. * ~~#364~~ Add interface to `mkdtemp` and `mkstemp` * ~~#367~~ Add stream:string-count-octets to count octets in a string * ~~#369~~ Improve docstring for `unix::unix-setlocale` ===================================== src/i18n/locale/cmucl-bsd-os.pot ===================================== @@ -15,10 +15,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/code/bsd-os.lisp -msgid "Unix system call getrusage failed: ~A." -msgstr "" - #: src/code/signal.lisp msgid "Emt instruction" msgstr "" ===================================== src/i18n/locale/cmucl-unix.pot ===================================== @@ -1419,8 +1419,8 @@ msgstr "" #: src/code/unix.lisp msgid "" -"Set all the categories of the locale from the values of the\n" -" environment variables using setlocale(LC_ALL, \"\").\n" +"Set all the categories of the locale according to the values of\n" +" the environment variables by calling setlocale(LC_ALL, \"\").\n" "\n" " Returns 0 on success and -1 if setlocale failed." msgstr "" @@ -1436,3 +1436,20 @@ msgstr "" msgid "Get the codeset from the locale" msgstr "" +#: src/code/unix.lisp +msgid "" +"Generates a unique temporary file name from TEMPLATE, and creates\n" +" and opens the file. On success, the corresponding file descriptor\n" +" and name of the file is returned.\n" +"\n" +" The last six characters of the template must be \"XXXXXX\"." +msgstr "" + +#: src/code/unix.lisp +msgid "" +"Generate a uniquely named temporary directory from Template,\n" +" which must have \"XXXXXX\" as the last six characters. The\n" +" directory is created with permissions 0700. The name of the\n" +" directory is returned." +msgstr "" + ===================================== src/i18n/locale/cmucl.pot ===================================== @@ -6060,7 +6060,7 @@ msgstr "" #: src/code/commandline.lisp msgid "" "Evaluate the specified Lisp expression during the start up\n" -" sequence. the value of the form will not be printed unless it is\n" +" sequence. The value of the form will not be printed unless it is\n" " wrapped in a form that does output." msgstr "" @@ -6182,7 +6182,7 @@ msgstr "" #: src/code/commandline.lisp msgid "" "Causes Lisp to start up silently, disabling printing of the herald\n" -" and causing most unnecessary noise, like GC messages,load messages,\n" +" and causing most unnecessary noise, like GC messages, load messages,\n" " etc. to be suppressed." msgstr "" @@ -6197,7 +6197,7 @@ msgid "Specify the unidata.bin file to be used." msgstr "" #: src/code/commandline.lisp -msgid "~&Usage: ~A <options>~2%" +msgid "~&Usage: ~A <options> [-- [app-args]*]~2%" msgstr "" #: src/code/commandline.lisp @@ -6205,7 +6205,7 @@ msgid "Print out the command line options and exit" msgstr "" #: src/code/commandline.lisp -msgid "Prints the cmucl version and exits" +msgid "Prints the cmucl version and exits, without loading the lisp core." msgstr "" #: src/code/env-access.lisp ===================================== src/lisp/lisp.c ===================================== @@ -42,6 +42,12 @@ #include <time.h> #endif +#include "cmucl-version.h" + +#ifndef CMUCL_VERSION +#error CMUCL_VERSION not defined! +#endif + /* SIGINT handler that invokes the monitor. */ @@ -89,10 +95,11 @@ alloc_str_list(const char *list[]) } /* Default paths for CMUCLLIB */ + +static char cmucl_version[] = CMUCL_VERSION; + static char *cmucllib_search_list[] = { - "./.", - "./../lib/cmucl/lib", - "./../lib", + "./../lib/cmucl/" CMUCL_VERSION "/lib", NULL }; @@ -335,7 +342,7 @@ search_core(const char *lib, const char *default_core) return buf; } else { if (debug_lisp_search) { - fprintf(stderr, "Found it, but we can't read it!\n"); + fprintf(stderr, "Does not exist, or can't read it if it does!\n"); } } } while (*lib++ == ':'); @@ -719,7 +726,15 @@ main(int argc, const char *argv[], const char *envp[]) debug_lisp_search = TRUE; } else if (match_option(arg, "unidata")) { unidata = *++argptr; - } + } else if ((strcmp(arg, "-version") == 0) || + (strcmp(arg, "--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); @@ -946,6 +961,10 @@ main(int argc, const char *argv[], const char *envp[]) } #endif +#ifdef LISP_IMPLEMENTATION_VERSION + SetSymbolValue(LISP_IMPLEMENTATION_VERSION, alloc_string(cmucl_version)); +#endif + /* * Pick off sigint until the lisp system gets far enough along to * install it's own. ===================================== src/tools/worldload.lisp ===================================== @@ -31,12 +31,6 @@ ;(setf lisp::*enable-dynamic-space-code* t) -;;; Get some data on this core. -;;; -(write-string "What is the current lisp-implementation-version? ") -(force-output) -(set '*lisp-implementation-version* (read-line)) - ;;; Load the rest of the reader (maybe byte-compiled.) (maybe-byte-load "target:code/sharpm") (maybe-byte-load "target:code/backq") View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/1ca3b1f23e327bfa2b0b3ee... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/1ca3b1f23e327bfa2b0b3ee... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)