Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • asdf/asdf
  • darabi/asdf
  • alendvai/asdf
  • dkochmanski/asdf
  • etimmons/asdf
  • adunn/asdf
  • mevenson/asdf
  • skatrevich/asdf
  • rmartinez/asdf
  • phousel/asdf
  • jmoringen/asdf
  • dverna/asdf
  • hishimaru/asdf
  • pbourguignon/asdf
  • arbv/asdf
  • vsedach/asdf
  • kpoeck/asdf
  • msimmons/asdf
  • loliveira/asdf
  • gpalter/asdf
  • eschulte/asdf
  • yitzchak/asdf
  • AlbertoEAF/asdf
  • drmeister/asdf
  • mathrick/asdf
  • NicoSimoski/asdf
26 results
Select Git revision
Show changes
Commits on Source (2801)
(:source-registry-cache
"asdf.asd"
"uiop/asdf-driver.asd"
"uiop/uiop.asd"
"tools/asdf-tools.asd")
* export-subst
\ No newline at end of file
ext export-ignore
* export-subst
?
??
???
build
asdf.lisp
doc/cmucl/
doc/asdf/
doc/asdf.aux
doc/asdf.cp
......@@ -16,13 +16,27 @@ doc/asdf.log
doc/asdf.pdf
doc/asdf.pg
doc/asdf.toc
doc/asdf.tps
doc/asdf.tp
doc/asdf.tps
doc/asdf.vr
doc/asdf.vrs
doc/asdf.t2d/
doc/asdf.dvi
doc/version.texinfo
doc/*.log
*.tmp
uiop/doc/uiop.html
uiop/doc/uiop.info
uiop/doc/uiop.pdf
uiop/doc/uiop.texinfo
LICENSE
README.html
tmp/
man/
lib/
*.dribble
*.fas[bcl]
*.fas
......@@ -35,17 +49,31 @@ tmp/
*.ufasl
*.vbin
*.~*~
*.sse2f
test/try-reloading-dependency.asd
test/fileMissing.lisp
test/hello-world-example
test/test-include.asd
test/test-multiple-too.asd
build-stamp
# Although there is no debian subdir/ in this repo any more, the
# presence of these lines helps the debian package maintainers, so
# please leave them here.
debian/cl-asdf.debhelper.log
debian/cl-asdf.postinst.debhelper
debian/cl-asdf.prerm.debhelper
debian/cl-asdf.substvars
debian/cl-asdf/
debian/files
debian/patches/
.pc
/.DS_Store
.DS_Store
core
# Hack: ignore the GNUmakefile here, so you can ln -s Makefile-lisp-scripting GNUmakefile
GNUmakefile
[submodule "ext/fare-utils"]
path = ext/fare-utils
url = https://gitlab.common-lisp.net/frideau/fare-utils.git
[submodule "ext/fare-quasiquote"]
path = ext/fare-quasiquote
url = https://gitlab.common-lisp.net/frideau/fare-quasiquote.git
[submodule "ext/fare-mop"]
path = ext/fare-mop
url = https://gitlab.common-lisp.net/frideau/fare-mop.git
[submodule "ext/closer-closer-mop"]
path = ext/closer-closer-mop
url = https://github.com/pcostanza/closer-mop.git
[submodule "ext/alexandria"]
path = ext/alexandria
url = https://gitlab.common-lisp.net/alexandria/alexandria.git
[submodule "ext/optima"]
path = ext/optima
url = https://github.com/m2ym/optima.git
[submodule "ext/named-readtables"]
path = ext/named-readtables
url = https://github.com/melisgl/named-readtables.git
[submodule "ext/inferior-shell"]
path = ext/inferior-shell
url = https://gitlab.common-lisp.net/qitab/inferior-shell.git
[submodule "ext/lisp-invocation"]
path = ext/lisp-invocation
url = https://gitlab.common-lisp.net/qitab/lisp-invocation.git
[submodule "ext/cl-ppcre"]
path = ext/cl-ppcre
url = https://github.com/edicl/cl-ppcre
[submodule "ext/asdf-encodings"]
path = ext/asdf-encodings
url = https://gitlab.common-lisp.net/asdf/asdf-encodings.git
[submodule "ext/cl-scripting"]
path = ext/cl-scripting
url = https://github.com/fare/cl-scripting.git
[submodule "ext/cl-launch"]
path = ext/cl-launch
url = https://gitlab.common-lisp.net/xcvb/cl-launch.git
system := "asdf"
# Configuring this Makefile for your personal use:
# Set environment variable ASDF_TEST_LISPS to a space-separated list of values
# (see "defaultlisps" below, for an example).
# If you have a special way to find libraries that are used in the build and
# test process, you may bind ASDF_DEVEL_SOURCE_REGISTRY to a source registry to
# use (using the environment variable syntax), or bind it to "override" to use
# your normal CL source registry. Otherwise, it will use local copies of
# everything.
system := "asdf"
webhome_private := common-lisp.net:/project/asdf/public_html/
webhome_public := "http://common-lisp.net/project/asdf/"
clnet_home := "/project/asdf/public_html/"
sourceDirectory := $(shell pwd)
sourceDirectory := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
#### Common Lisp implementations available for testing.
## export ASDF_TEST_LISPS to override the default list of such implementations,
## or specify a lisps= argument at the make command-line
defaultLisps = ccl clisp sbcl ecl ecl_bytecodes cmucl abcl scl allegro lispworks allegromodern gcl xcl mkcl
ifdef ASDF_TEST_LISPS
lisps ?= ${ASDF_TEST_LISPS}
else
lisps ?= ccl clisp sbcl ecl ecl_bytecodes cmucl abcl scl allegro lispworks allegromodern xcl gcl
lisps ?= ${defaultLisps}
endif
ifdef ASDF_UPGRADE_TEST_LISPS
ulisps ?= ${ASDF_UPGRADE_TEST_LISPS}
else
ifdef ASDF_TEST_LISPS
ulisps ?= ${ASDF_TEST_LISPS}
else
ulisps ?= ${defaultLisps}
endif
endif
export ASDF_OUTPUT_TRANSLATIONS := (:output-translations (t ("${sourceDirectory}/build/fasls" :implementation)) :ignore-inherited-configuration)
export CL_SOURCE_REGISTRY := (:source-registry (:tree "${sourceDirectory}") :ignore-inherited-configuration)
version := $(shell cat "version.lisp-expr")
#$(info $$version is [${version}])
version := $(patsubst "%",%,$(version))
#$(info $$version is [${version}])
fullversion := $(shell git describe --tags --match "[0-9][.][0-9]*" 2> /dev/null || echo $(version))
## grep for #+/#- features in the test/ directory to see plenty of disabled tests on some platforms
## NOT SUPPORTED BY OUR AUTOMATED TESTS:
## cormancl genera lispworks-personal-edition rmcl
## Some are manually tested once in a while.
ifdef ASDF_TEST_SYSTEMS
s ?= ${ASDF_TEST_SYSTEMS}
endif
ifdef ASDF_DEVEL_SOURCE_REGISTRY
ifeq ($(ASDF_DEVEL_SOURCE_REGISTRY), override)
# do nothing... Use the user's CL_SOURCE_REGISTRY
else
export CL_SOURCE_REGISTRY = ${ASDF_DEVEL_SOURCE_REGISTRY}
endif
else # no ASDF_DEVEL_SOURCE_REGISTRY
export CL_SOURCE_REGISTRY = ${sourceDirectory}/:${sourceDirectory}/uiop/:${sourceDirectory}/ext//
endif
#$(error "CL_SOURCE_REGISTRY is ${CL_SOURCE_REGISTRY}")
sys := $(shell uname -s)
ifneq (,$(findstring CYGWIN,$(sys)))
CL_SOURCE_REGISTRY := $(shell cygpath -pw "${CL_SOURCE_REGISTRY}")
endif
## MAJOR FAIL: gclcvs -- COMPILER BUG! Upstream fixed it, but upstream fails to compile.
## NOT SUPPORTED BY OUR TESTS: cormancl genera lispworks-personal-edition mkcl rmcl. Manually tested once in a while.
CP ?= cp
lisp ?= sbcl
l ?= sbcl
UPCASE_L = $(shell echo '$(l)' | tr '[:lower:]' '[:upper:]')
ABCL ?= abcl
ALLEGRO ?= alisp
......@@ -32,55 +80,104 @@ SBCL ?= sbcl
SCL ?= scl
XCL ?= xcl
# website, tag, install
default: test
install: archive-copy
archive:
${SBCL} --userinit /dev/null --sysinit /dev/null --load bin/make-helper.lisp \
--eval "(rewrite-license)" --eval "(quit)"
bin/make-tarball
archive-copy: archive build/asdf.lisp
git checkout release
bin/rsync-cp build/asdf*.tar.gz $(webhome_private)/archives
bin/link-tarball $(clnet_home)
bin/rsync-cp build/asdf.lisp $(webhome_private)
${MAKE} push
git checkout master
driver_lisp := header.lisp package.lisp compatibility.lisp utility.lisp pathname.lisp stream.lisp os.lisp image.lisp run-program.lisp lisp-build.lisp configuration.lisp driver.lisp
asdf_lisp := upgrade.lisp component.lisp system.lisp find-system.lisp find-component.lisp operation.lisp action.lisp lisp-action.lisp plan.lisp operate.lisp output-translations.lisp source-registry.lisp backward-internals.lisp defsystem.lisp bundle.lisp concatenate-source.lisp backward-interface.lisp interface.lisp footer.lisp
build/asdf.lisp: $(wildcard *.lisp)
# If you need to sudo in order to use docker, modify this.
DOCKER ?= docker
docker_tag ?= latest
DOCKER_IMAGE_ABCL ?= containers.common-lisp.net/cl-docker-images/abcl
DOCKER_IMAGE_ALLEGRO ?= containers.common-lisp.net/cl-docker-images/allegro
DOCKER_IMAGE_ALLEGROMODERN ?= containers.common-lisp.net/cl-docker-images/allegro
DOCKER_IMAGE_CCL ?= containers.common-lisp.net/cl-docker-images/ccl
DOCKER_IMAGE_CLISP ?= containers.common-lisp.net/cl-docker-images/clisp
DOCKER_IMAGE_CMUCL ?= containers.common-lisp.net/cl-docker-images/cmucl
DOCKER_IMAGE_ECL ?= containers.common-lisp.net/cl-docker-images/ecl
DOCKER_IMAGE_ECL_BYTECODES ?= containers.common-lisp.net/cl-docker-images/ecl
DOCKER_IMAGE_SBCL ?= containers.common-lisp.net/cl-docker-images/sbcl
header_lisp := header.lisp
driver_lisp := uiop/package.lisp uiop/common-lisp.lisp uiop/utility.lisp uiop/version.lisp uiop/os.lisp uiop/pathname.lisp uiop/filesystem.lisp uiop/stream.lisp uiop/image.lisp uiop/lisp-build.lisp uiop/launch-program.lisp uiop/run-program.lisp uiop/configuration.lisp uiop/backward-driver.lisp uiop/driver.lisp
defsystem_lisp := upgrade.lisp session.lisp component.lisp operation.lisp system.lisp system-registry.lisp action.lisp lisp-action.lisp find-component.lisp forcing.lisp plan.lisp operate.lisp find-system.lisp parse-defsystem.lisp bundle.lisp concatenate-source.lisp package-inferred-system.lisp output-translations.lisp source-registry.lisp backward-internals.lisp backward-interface.lisp interface.lisp user.lisp footer.lisp
all_lisp := $(header_lisp) $(driver_lisp) $(defsystem_lisp)
print-% : ; @echo $* = $($*)
# Making ASDF itself should be our first, default, target:
build/asdf.lisp: $(all_lisp)
mkdir -p build
cat $(driver_lisp) $(asdf_lisp) > $@
rm -f $@
cat $(all_lisp) > $@
ext:
git submodule update --init
noext:
git submodule deinit .
# This quickly locates such mistakes as unbalanced parentheses:
load: build/asdf.lisp
./test/run-tests.sh -t $l $(all_lisp)
install: archive
bump: bump-version
git commit -a -m "Bump version to $$(eval a=$$(cat version.lisp-expr) ; echo $$a)"
temp=$$(cat version.lisp-expr); temp="$${temp%\"}"; temp="$${temp#\"}"; git tag $$temp
bump-version: build/asdf.lisp
./bin/bump-version ${v}
driver-files:
@echo $(driver_lisp)
defsystem-files:
@echo $(defsystem_lisp)
# FIXME: needs rewrite
#archive: build/asdf.lisp
# ./bin/asdf-builder make-and-publish-archive
archive: build/asdf.lisp
$(eval UIOPDIR := "uiop-$(version)")
mkdir -p build/$(UIOPDIR) # UIOP tarball
${CP} -pHux uiop/README.md uiop/uiop.asd uiop/asdf-driver.asd ${driver_lisp} uiop/contrib/debug.lisp build/$(UIOPDIR)
tar zcf "build/uiop-${version}.tar.gz" -C build $(UIOPDIR)
rm -r build/$(UIOPDIR)
$(eval ASDFDIR := "asdf-$(version)")
mkdir -p build/$(ASDFDIR) # asdf-defsystem tarball
${CP} -pHux build/asdf.lisp asdf.asd version.lisp-expr header.lisp README.md ${defsystem_lisp} build/$(ASDFDIR)
tar zcf "build/asdf-defsystem-${version}.tar.gz" -C build $(ASDFDIR)
rm -r build/$(ASDFDIR)
git archive --worktree-attributes --prefix="asdf-$(version)/" --format=tar -o "build/asdf-${version}.tar" ${version} #asdf-all tarball
gzip "build/asdf-${version}.tar"
${CP} "build/asdf.lisp" "build/asdf-${version}.lisp"
publish-archive:
rsync --times --chmod=a+rX,ug+w "build/uiop-${version}.tar.gz" "build/asdf-defsystem-${version}.tar.gz" \
"build/asdf-${version}.tar.gz" "build/asdf-${version}.lisp" common-lisp.net:/project/asdf/public_html/archives/
ssh common-lisp.net "cd /project/asdf/public_html/archives/; ln -sf uiop-${version}.tar.gz uiop.tar.gz; ln -sf asdf-defsystem-${version}.tar.gz asdf-defsystem.tar.gz; ln -sf asdf-${version}.tar.gz asdf.tar.gz; ln -sf asdf-${version}.lisp asdf.lisp"
### Count lines separately for asdf-driver and asdf itself:
wc:
@wc $(driver_lisp) | sort -n ; echo ; \
wc $(asdf_lisp) | sort -n ; \
wc $(header_lisp) $(defsystem_lisp) | sort -n ; \
echo ; \
wc $(driver_lisp) $(asdf_lisp) | tail -n 1
wc-driver:
wc $(driver_lisp)
wc-asdf:
wc $(asdf_lisp)
wc $(header_lisp) $(driver_lisp) $(defsystem_lisp) | tail -n 1
push:
git status
git push --tags cl.net release master
git push --tags github release master
git fetch
git status
doc:
${MAKE} -C doc
# if you don't have the toolchain to build docs installed...
#doc: ;
website:
${MAKE} -C doc website
${MAKE} -C uiop/doc website
clean_dirs = $(sourceDirectory)
clean_extensions = fasl dfsl cfsl fasl fas lib dx32fsl lx64fsl lx32fsl ufasl o bak x86f vbin amd64f sparcf sparc64f hpf hp64f
......@@ -88,67 +185,114 @@ clean_extensions = fasl dfsl cfsl fasl fas lib dx32fsl lx64fsl lx32fsl ufasl o b
clean:
@for dir in $(clean_dirs); do \
if test -d $$dir; then \
echo Cleaning $$dir; \
echo Cleaning $$dir; \
for ext in $(clean_extensions); do \
find $$dir \( -name "*.$$ext" \) \
-and -not -path \""*/.git/*"\" \
-and -not -path \""*/_darcs/*"\" \
-and -not -path \""*/tags/*"\" -print -delete; \
-and -not -path \""*/.git/*"\" \
-and -not -path \""*/_darcs/*"\" \
-and -not -path \""*/tags/*"\" -delete; \
done; \
fi; \
echo "Cleaned $$dir"; \
done
rm -rf build/ LICENSE test/try-reloading-dependency.asd
echo "Done with cleaning loop."
rm -rf build/ LICENSE test/try-reloading-dependency.asd test/hello-world-example asdf.lisp
rm -rf test/hello-world-example.exe test/mkcl_*.dll # needed only on MS-Windows
${MAKE} -C doc clean
${MAKE} -C uiop/doc clean
mrproper: clean
rm -rf .pc/ build-stamp debian/patches/ debian/debhelper.log debian/cl-asdf/ # debian crap
mrproper:
git clean -xfd
test-upgrade: build/asdf.lisp
./test/run-tests.sh -u ${lisp}
test-upgrade: build/asdf.lisp show-version
./test/run-tests.sh -u ${l}
u: test-upgrade
test-clean-load: build/asdf.lisp
./test/run-tests.sh -c ${lisp}
test-clean-load: build/asdf.lisp show-version
./test/run-tests.sh -c ${l}
test-lisp: build/asdf.lisp
@cd test; ${MAKE} clean;./run-tests.sh ${lisp} ${test-glob}
show-version:
@echo "Building and testing asdf $(fullversion)"
test: test-lisp test-clean-load doc
# test-glob has been replaced by t, and lisp by l, easier to type
test-lisp: build/asdf.lisp show-version
@cd test; ./run-tests.sh ${l} ${t}
test-all-lisps:
@for lisp in ${lisps} ; do \
${MAKE} test-lisp test-upgrade lisp=$$lisp || exit 1 ; \
done
t: test-lisp
# test upgrade is a very long run... This does just the regression tests
test-all-noupgrade:
@for lisp in ${lisps} ; do \
${MAKE} test-lisp lisp=$$lisp || exit 1 ; \
done
# Useful for reproducing test failures with Docker. Allegro does not like it if
# the user we're running as has no entry in /etc/passwd. So we make a user
# first and then execute the command as that user.
test-docker-repl:
@${DOCKER} run --rm -i -t -e I_AGREE_TO_ALLEGRO_EXPRESS_LICENSE=yes -v $(sourceDirectory):$(sourceDirectory) -w $(sourceDirectory)/test $(DOCKER_IMAGE_$(UPCASE_L)):${docker_tag} bash -c "adduser --uid $(shell id -u) --gecos 'ASDF tester' --disabled-password --no-create-home user && su user -c \"$($(UPCASE_L))\""
# Allegro does not like it if the user we're running as has no entry in
# /etc/passwd. So we make a user first and then execute the command as that
# user.
test-docker-lisp: build/asdf.lisp show-version
${DOCKER} run --rm -i -t -e I_AGREE_TO_ALLEGRO_EXPRESS_LICENSE=yes -v $(sourceDirectory):$(sourceDirectory) -w $(sourceDirectory) $(DOCKER_IMAGE_$(UPCASE_L)):${docker_tag} bash -c "adduser --uid $(shell id -u) --gecos 'ASDF tester' --disabled-password --no-create-home user && su user -c \"make test-lisp l=$(l) t=$(t)\""
td: test-docker-lisp
test: test-lisp test-clean-load test-load-systems
test-load-systems: build/asdf.lisp show-version
./test/run-tests.sh -l ${l} ${s}
test-all-lisps: test-load-systems test-all-clean-load test-all-lisp test-all-upgrade
test-all-clean-load:
@for lisp in ${lisps} ; do ${MAKE} test-clean-load l=$$lisp || exit 1 ; done
test-all-lisp:
@for lisp in ${lisps} ; do ${MAKE} test-lisp l=$$lisp t=${t}|| exit 1 ; done
test-all-upgrade:
@for lisp in ${lisps} ; do \
${MAKE} test-upgrade lisp=$$lisp || exit 1 ; \
done
@for lisp in ${ulisps} ; do ${MAKE} test-upgrade l=$$lisp || exit 1 ; done
test-all-no-upgrade: doc test-load-systems test-all-clean-load test-all-lisp
test-all: test-all-no-upgrade test-all-upgrade
test-all-lisp-no-stop:
@for lisp in ${lisps} ; do ${MAKE} test-lisp l=$$lisp ; done ; :
test-all-upgrade-no-stop:
@for lisp in ${ulisps} ; do ${MAKE} test-upgrade l=$$lisp ; done ; :
test-all: test-forward-references doc test-all-lisps
test-all-no-upgrade-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop
make --quiet check-all-test-results
# Note that the debian git at git://git.debian.org/git/pkg-common-lisp/cl-asdf.git is stale,
# as we currently build directly from upstream at git://common-lisp.net/projects/asdf/asdf.git
debian-package: mrproper
: $${RELEASE:="$$(git tag -l '2.[0-9][0-9]' | tail -n 1)"} ; \
git-buildpackage --git-debian-branch=release --git-upstream-branch=$$RELEASE --git-tag --git-retag --git-ignore-branch
test-all-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop test-all-upgrade-no-stop
make --quiet check-all-results
# Replace SBCL's ASDF with the current one. -- Not recommended now that SBCL has ASDF2.
# for casual users, just use (asdf:load-system :asdf)
replace-sbcl-asdf: build/asdf.lisp
${SBCL} --eval '(compile-file "$<" :output-file (format nil "~Aasdf/asdf.fasl" (sb-int:sbcl-homedir-pathname)))' --eval '(quit)'
check-all-test-results:
@A="`grep -L '[5-9][0-9] passing and 0 failing' build/results/*-test.text`" ; \
if [ -n "$$A" ] ; then \
echo "Unexpected test failures on these implementations:" ; \
echo "$$A" ; \
exit 1 ; \
fi
check-all-upgrade-results:
@A="`grep -L 'Upgrade test succeeded for ' build/results/*-upgrade.text`" ; \
if [ -n "$$A" ] ; then \
echo "Unexpected upgrade failures on these implementations:" ; \
echo "$$A" ; \
exit 1 ; \
fi
check-all-results:
@r=0 ; \
make --quiet check-all-test-results || r=1 ; \
make --quiet check-all-upgrade-results || r=1 ; \
exit $r
extract: extract-all-tagged-asdf
extract-all-tagged-asdf: build/asdf.lisp
./test/run-tests.sh -H
# Replace CCL's ASDF with the current one. -- Not recommended now that CCL has ASDF2.
# for casual users, just use (asdf:load-system :asdf)
replace-ccl-asdf: build/asdf.lisp
${CCL} --eval '(progn(compile-file "$<" :output-file (compile-file-pathname (format nil "~Atools/asdf.lisp" (ccl::ccl-directory))))(quit))'
WRONGFUL_TAGS := 1.37 1.1720 README RELEASE STABLE
# Delete wrongful tags from local repository
fix-local-git-tags:
for i in ${WRONGFUL_TAGS} ; do git tag -d $$i ; done
......@@ -169,18 +313,36 @@ TODO:
release: TODO test-all test-on-other-machines-too debian-changelog debian-package send-mail-to-mailing-lists
.PHONY: install archive archive-copy push doc website clean mrproper \
.PHONY: install archive push doc website clean mrproper show-version \
test-forward-references test test-lisp test-upgrade test-forward-references \
test-all test-all-lisps test-all-noupgrade \
test-all test-all-lisps test-all-no-upgrade \
debian-package release \
replace-sbcl-asdf replace-ccl-asdf \
fix-local-git-tags fix-remote-git-tags wc wc-driver wc-asdf
fix-local-git-tags fix-remote-git-tags wc wc-driver wc-asdf \
list-source-registry \
ext noext
# debug the source registry that will be used to execute commands from this Makefile.
#list-source-registry:
# ${sourceDirectory}/bin/asdf-builder re '(uiop:writeln (sort (alexandria:hash-table-alist asdf::*source-registry*) `string< :key `car))'
# RELEASE checklist:
# RELEASE or PUSH checklist:
# make test-all
# ./bin/bump-version 2.27
# edit debian/changelog
# make release-push archive-copy website debian-package
# make test-load-systems s=fare-all
# make bump v=3.0
# edit debian/changelog # RELEASE only...
# git commit
# git tag 3.0 # for example ...
# make debian-package
# git push
# git push origin 3.0 # for example...
# everything from here for RELEASE only
# make release-push archive website debian-package
# dput mentors ../*.changes
# send debian mentors request
# send announcement to asdf-announce, asdf-devel, etc.
# Move all fixed bugs from Fix Committed -> Fix Released on launchpad
#
## Users don't release as above, only maintainers do.
## Users, all you need to do is: make
## Vendors, you may want to test your implementation with: make test l=sbcl
# -*- Makefile -*- This minimal Makefile delegates most work to the asdf-tools script
#
# End-Users, all you need to do is:
# make -f Makefile-lisp-scripting
#
# Vendors, you may want to test your implementation with:
# make -f Makefile-lisp-scripting test l=sbcl
# BUT you first need have installed the development-time external dependencies of ASDF;
# this will be done automatically if you are using quicklisp;
# you can do it manually with your favorite tools (e.g. clbuild or git);
# or you can do it using `git submodule update` which is also available as:
# make -f Makefile-lisp-scripting ext
# To undo the `git submodule update` you can use: `make noext`
#
# Other targets are for maintainer use only. If you want a list of all of the targets, use
# make -f Makefile-lisp-scripting help
#
### Default fall back rule: delegate to asdf-tools.
# Note that the l= L= etc. are the only way I (Faré) have found to
# pass arguments from the Makefile to the underlying script:
# l= overrides $ASDF_TEST_LISPS to specify which lisp implementations to use
# L= overrides $ASDF_UPGRADE_TEST_LISPS (defaults to the former) to lisps during upgrade
# s= overrides $ASDF_TEST_SYSTEMS to specify systems with which to test ASDF
# t= overrides $ASDF_TESTS to specify test script patterns to use (default to *.script)
# u= overrides $ASDF_UPGRADE_TEST_TAGS to specify versions to upgrade from (e.g. 3.0.3 or REQUIRE)
# U= overrides $ASDF_UPGRADE_TEST_METHODS to specify upgrade methods
# v= overrides the default next version for bump-version or bump.
# see in tools/test-environment.lisp for details.
# Note that because of how make and the shell quote arguments,
# thou shalt not use the single-quote character in any of the short x= parameters
# (but you may use them in the long variant in the exported environment variable).
# To have a list of commands, see make help or ./tools/asdf-tools help
# Note that when you call ./tools/asdf-tools directly,
# you may have to use positional parameters instead (unless you use env as below), as in
# ./tools/asdf-tools bump 3.2.1
# instead of
# make -f Makefile-lisp-scripting bump v=3.2.1
# or
# ./make-asdf.sh v=3.2.1 bump
# or
# ./tools/asdf-tools env v=3.2.1 bump
# or
# v=3.2.1 ./tools/asdf-tools bump
ifeq ($(OS),Windows_NT)
MAKE_SCRIPT := cmd /c make-asdf.bat
else
MAKE_SCRIPT := ./make-asdf.sh
endif
all ext noext driver_files defsystem_files build_asdf build_asdf_tools: force
${MAKE_SCRIPT} $@
build/asdf.lisp: build_asdf
build/asdf-tools build/asdf-tools.exe: build_asdf_tools
.PHONY: force all ext noext driver_files defsystem_files build_asdf build_asdf_tools
# The text below was automaticaly generated by
# make -f Makefile-lisp-scripting --silent makefile-targets
# then manually inserted here to provide for completion:
.PHONY: archive build-asdf build-asdf-tools bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc ext-clear ext-init ext-reset ext-update extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands show-version t test test-all test-all-basic test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website
archive build-asdf build-asdf-tools bump bump-version check-all-results check-all-scripts-results check-all-upgrade-results clean debian-package doc ext-clear ext-init ext-reset ext-update extract extract-all-tagged-asdf extract-tagged-asdf fix-local-git-tags fix-remote-git-tags git-all-committed-p help install install-asdf link-archive load make-and-publish-archive make-archive makefile-targets merge-master-into-release publish-archive publish-debian-package push re show-commands show-version t test test-all test-all-basic test-all-clean-load test-all-no-stop test-all-no-upgrade test-all-no-upgrade-no-stop test-all-scripts test-all-scripts-no-stop test-all-upgrade test-all-upgrade-no-stop test-ascii test-basic test-clean-load test-load-systems test-scripts test-upgrade u wc website: force
${MAKE_SCRIPT} l='$l' L='$L' u='$u' U='$U' v='$v' s='$s' t='$t' $@
ASDF: another system definition facility
========================================
If you want to use ASDF, read our manual:
http://common-lisp.net/project/asdf/asdf.html
The first few sections, Loading ASDF, Configuring ASDF and Using ASDF,
will get you started as a simple user.
If you want to define your own systems, further read the section
Defining systems with defsystem.
More information and additional links can be found on ASDF's
home page at:
http://common-lisp.net/project/asdf/
last updated Wednesday; May 5, 2010
ASDF: Another System Definition Facility
========================================
For general information about ASDF, consult the web page:
<https://common-lisp.net/project/asdf/>
For some reference documentation, read the manual:
<https://common-lisp.net/project/asdf/asdf.html>
For a guide on how to use it, read our "best practices" document:
<https://github.com/fare/asdf/blob/master/doc/best_practices.md>
Below is a guide for ASDF developers. It is not meant for ASDF users.
[TOC]
Building ASDF
-------------
First, make sure ASDF is checked out under a path registered to the source-registry,
if that isn't the case yet (see the [manual](http://common-lisp.net/project/asdf/asdf.html)).
One place would be:
~/.local/share/common-lisp/source/asdf/
or, assuming your implementation provides ASDF 3.1 or later:
~/common-lisp/asdf/
If you cloned our git repository rather than extracted a tarball,
bootstrap a copy of `build/asdf.lisp` with:
make
Building the documentation
--------------------------
The manual is also in the [doc/](doc/) subdirectory, and can be prepared with:
make -C doc
Testing ASDF
------------
Before you may run tests, you need a few CL libraries.
The simplest way to get them is as follows, but read below:
make ext
_NOTA BENE_: You may also need to run `make ext` again
after you `git pull` or switch branch, to update the `ext/` directory.
This unhappily is not automatic.
If for some reason tests fail, particularly due to an error
compiling, loading or running a library, then run `make ext` and try again.
The above `make` target uses `git submodule update --init` to download
all these libraries using git. If you don't otherwise maintain your
own set of carefully controlled CL libraries, that's what you want to use.
However, it is only available if you have a git checkout of ASDF;
not if you used a tarball.
If you use a tarball or otherwise do maintain your own set
of carefully controlled CL libraries then you will want to use whichever tools
you use (e.g. `quicklisp`, `clbuild`, or your own scripts around `git`)
to download these libraries:
`alexandria`, `asdf-encodings`, `cl-launch`, `closer-mop`, `cl-ppcre`,
`cl-scripting`, `fare-mop`, `fare-quasiquote`, `fare-utils`, `inferior-shell`,
`lisp-invocation`, `named-readtables`, `optima`.
If you are a CL developer, you may already have them, or may want
to use your own tools to download a version of them you control.
If you use [Quicklisp](https://www.quicklisp.org/), you may let
Quicklisp download those you don't have.
In these cases, you may NOT want to use the git submodules from `make ext`;
you may undo a `make ext` with `make noext`.
Otherwise, if you want to let ASDF download known-working versions
of its dependencies, you can do it with `make ext`.
Once you have all the required libraries and the asdf-tools script can find
a suitable Common Lisp implementation, you may run all the tests
on a given Common Lisp implementation `$L`, with your favorite installed system `$S`, using:
make t u l=$L s=$S
To run only the regression test scripts, try simply:
make l=$L test-scripts
Lisp Scripting test system
--------------------------
ASDF by default uses a shell script in `./test/run-tests.sh` to run the scripts
that orchestrate its tests.
An alternate build and test system is available
that uses Common Lisp as a scripting language.
It is disabled by default because
the new maintainer is having trouble with it in some of his environments.
It worked fine for the previous maintainer in his environments,
and may be particularly useful on Windows if and when
the shell-based test system fails or is not available.
Its source code is in [tools/](tools/) and
you can invoke it without going through GNU make,
using the script [make-asdf.sh](make-asdf.sh),
or, on Windows, [make-asdf.bat](make-asdf.bat).
To use this alternate test system, pass to `make` the extra arguments `-f Makefile-lisp-scripting`
as in for instance:
make -f Makefile-lisp-scripting t l=sbcl
Or you can make that your local default (assuming GNU make) using:
echo "include Makefile-lisp-scripting" > GNUmakefile
These Lisp tools by default use Clozure Common Lisp (CCL) to build and run a binary
`build/asdf-tools` that will orchestrate the tests.
By defining and exporting the variable `LISP` to be one of `ccl`, `sbcl` or `allegro`, you
can have it use an alternate Common Lisp implementation instead.
Install CCL (respectively SBCL or Allegro) and make sure an executable called
`ccl` (respectively `sbcl` or `alisp`) is in your `PATH`,
or that you export a variable `CCL` (respectively `SBCL` or `ALLEGRO`)
that points to the executable.
To use a further Common Lisp implementation, suitably edit the script
[`tools/asdf-tools`](tools/asdf-tools),
or, on Windows, the batch file [`tools/asdf-tools.bat`](tools/asdf-tools.bat).
(Note that we recommend SBCL 1.3.13 or later when on Windows.)
Note that the executable `build/asdf-tools` is built
the first time you test ASDF.
When you update ASDF, via e.g. `git pull` or a branch switch,
you may have to update it, with:
make -f Makefile-lisp-scripting build-asdf-tools
The reason this is not done automatically every time is because
building it depends on a working ASDF;
but when you're modifying ASDF and testing it, you cannot rely on a working ASDF:
indeed, a developer may not only make mistakes, but may deliberately
introduce or re-introduce bugs at some place to test code in another place.
Contributing to ASDF
--------------------
Bugs can be filled on ASDF by reporting them on the [Gitlab issue
tracker](https://gitlab.common-lisp.net/asdf/asdf/-/issues) or sending them to
the [asdf-devel mailing list](https://mailman.common-lisp.net/listinfo/asdf-devel).
You can contribute code to ASDF development by forking the
[repository](https://gitlab.common-lisp.net/asdf/asdf) and sending a merge
request or sending a patch to the asdf-devel mailing list.
If you fork the repository on Gitlab, note that Gitlab CI is enabled to help in
automated testing. While not exhaustive, this can help make sure you don't
inadvertantly break anything with your patch! The tests will be run any time
you submit a merge request or manually trigger a run using Gitlab's UI.
If you would like to run ASDF's upgrade tests you need to first ensure your
fork contains the tags for every released version of ASDF. If your fork is
freshly created, this will happen automatically. However, if there has been a
release since you forked, you need to update your tags. Assuming that your fork
is the `origin` remote and upstream is the `upstream` remote, you can do this
by running:
git fetch upstream --tags
git push origin --tags
Then set the varialbe `RUN_UPGRADE_TESTS` on a pipeline.
If you would like to enable test jobs that use the Lisp scripting test harness,
set the variable `ENABLE_ASDF_TOOLS` on a pipeline.
Debugging ASDF
--------------
To interactively debug ASDF, you may load it in such a way that `M-.` will work,
by installing the source code, and running:
(map () 'load (asdf:input-files :monolithic-concatenate-source-op "asdf/defsystem"))
To interactively use the `asdf-tools`, you need to either have
all its dependencies installed and configured.
If you're using them through the `ext/` directory and `make ext`,
then you may need to emulate
what the script in [tools/asdf-tools](tools/asdf-tools) does
with respect to initializing the source-registry.
Note that it also declares a system for `cl-launch/dispatch`;
you can either do something similar, or expand the source for `cl-launch` with
`make -C ext/cl-launch source` so `cl-launch.asd` will be created.
Using ASDF internals
--------------------
If you have to use or extend internal functionality not currently exported by
ASDF, please contact us and have us negotiate a proper, stable, tested interface
that you can actually rely on. Also, please *DO NOT* refer to specific
subpackages such as `asdf/find-system` from the outside of ASDF, because
functions may occasionally be moved from one internal package to the other,
without notification. They have in the past and will in the future.
Instead, when refering to symbols in ASDF, we recommend you either have
your package `:use` the package `:asdf` or `:import-from` it, or that
you shall use `asdf:` or `asdf::` as a prefix to the symbols.
And once again, please contact us if you have to use non-exported symbols.
Also, the normal way of extending ASDF is to use our class hierarchies for
`component` and `operation` and to define methods on `component-depends-on`,
`perform`, `input-files`, `output-files`.
A common mistake seems to be that some people define methods on `operate`,
which usually is not at all what they think it is.
How do I navigate this source tree?
-----------------------------------
* [asdf.asd](asdf.asd)
* The system definition for building ASDF with ASDF.
* `*.lisp`
* The source code files for `asdf/defsystem`.
See [asdf.asd](asdf.asd) for the order in which they are loaded.
All exported functions should have docstrings,
and all internal functions should have comments.
If any definition is insufficiently documented,
please tell us: that's a bug.
* [uiop/](uiop/)
* Utilities of Implementation- and OS- Portability,
the portability layer of ASDF. It has its own [README](uiop/README.md),
and exported functions should all have docstrings and other ones comment,
or once again it's a bug.
* [Makefile](Makefile)
* The classical `Makefile` used for development purposes.
Regular users only need to call `make` with the default target.
Developers will typically use the like of
`make t l=sbcl` or `make u l=ccl`.
* [bin/](bin/)
* [bump-version](bin/bump-version) --
a script to bump the version of ASDF, used by the classic `Makefile`.
Use it with e.g. `./bin/bump-version 3.4.5`
to test with the next version number before you release.
NB: ASDF's version number notably affects the behavior of ASDF
with respect to deprecated functions.
* [tools/](tools/)
* `asdf-tools`, a system to build, test and release ASDF. It includes:
* [asdf-tools](tools/asdf-tools) --
a shell script to run it as a shell command.
* [asdf-tools.bat](tools/asdf-tools.bat) --
a Windows batch file to run the above.
* [asdf-tools.asd](tools/asdf-tools.asd) --
system definition for asdf-tools
* `*.lisp` -- the source code for the `asdf-tools` system,
except for the few files below.
Check the `.asd` file for the order in which to read them.
* Also a couple scripts to help ASDF users:
* [load-asdf.lisp](tools/load-asdf.lisp) --
a working example script to load, configure and use ASDF
in a self-contained project
* [install-asdf.lisp](install-asdf.lisp) --
replace and update an implementation's ASDF
* [cl-source-registry-cache.lisp](cl-source-registry-cache.lisp) --
update a cache for the source-registry as a standalone script.
* [Makefile-lisp-scripting](Makefile-lisp-scripting),
[make-asdf.sh](make-asdf.sh) and [make-asdf.bat](make-asdf.bat)
* Minimal Makefile and scripts to invoke
the lisp scripting variants of the build system.
* [version.lisp-expr](version.lisp-expr)
* The current version. Bumped up every time the code changes, using:
make bump
* [doc/](doc/)
* Documentation for ASDF, including:
* [index.html](doc/index.html) --
the web page for <http://common-lisp.net/project/asdf/>
* [asdf.texinfo](doc/asdf.texinfo) -- our manual
* [Makefile](doc/Makefile) -- how to build the manual
* [cclan.png](doc/cclan.png) [lisp-logo120x80.png](doc/lisp-logo120x80.png)
[style.css](doc/style.css) [favicon.ico](doc/favicon.ico)
-- auxiliaries of [index.html](doc/index.html)
* [test/](test/)
* Regression test scripts (and ancillary files) for developers to check
that they don't unintentionally break any of the functionality of ASDF.
They are far from covering all of ASDF, but they are a good start.
* [script-support.lisp](test/script-support.lisp) --
the common test infrastructure used by our tests
* [run-tests.sh](test/run-tests.sh) --
the shell script used by the classic `Makefile` to run tests.
It is not used by the Lisp scripting variant of the `Makefile`.
* [contrib/](contrib/)
* A few contributed files that show case how to use ASDF
or help with debugging it or debugging programs that use it.
* [debian/](debian/)
* Files for packaging on Debian, Ubuntu, etc.
(now only present in the debian branch).
* [build/](build/)
* Where the `Makefile` and `asdf-tools` store their output files,
including:
* `asdf.lisp` -- the current one-file deliverable of ASDF
* `asdf-*.lisp` -- for upgrade test purposes, old versions
* `asdf-tools` -- the executable for asdf-tools (.exe on Windows)
* `results/` -- logs of tests that have been run
* `fasls/` -- output files while running tests
* [ext/](ext/)
* External dependencies, that can be populated with `make ext`
or equivalently with `git submodule update --init`.
Depopulate it with `make noext`
or equivalently with: `submodule deinit .`
* [README.md](README.md)
* This file.
* [TODO](TODO)
* Plenty of ideas for how to further improve ASDF
(not all of them guaranteed good ideas.)
* [gitlab-ci.yml](gitlab-ci.yml)
* A YAML file describing jobs for Gitlab CI to run.
This diff is collapsed.
This diff is collapsed.
;;; -*- mode: lisp -*-
(defsystem :asdf-driver
:licence "MIT"
:description "Basic general-purpose utilities used by ASDF"
:long-description "Basic general-purpose utilities that is in such a need
that you can't portably construct a complete program without using them."
#+asdf2.27 :version #+asdf2.27 (:read-file-form "version.lisp-expr")
:components
((:file "header")
(:file "package")
(:file "compatibility" :depends-on ("package"))
(:file "utility" :depends-on ("compatibility"))
(:file "pathname" :depends-on ("utility"))
(:file "stream" :depends-on ("pathname"))
(:file "os" :depends-on ("stream"))
(:file "image" :depends-on ("os"))
(:file "run-program" :depends-on ("os"))
(:file "lisp-build" :depends-on ("image"))
(:file "configuration" :depends-on ("image"))
(:file "driver" :depends-on ("lisp-build" "run-program" "configuration"))))
......@@ -3,30 +3,104 @@
;;; ;;;
;;; Free Software available under an MIT-style license. ;;;
;;; ;;;
;;; Copyright (c) 2001-2012 Daniel Barlow and contributors ;;;
;;; Copyright (c) 2001-2019 Daniel Barlow and contributors ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :asdf)
(defsystem :asdf
;; We can't rely on it being defined in uiop.asd, since that file isn't loaded.
(defun call-without-redefinition-warnings (thunk)
(handler-bind (((or
#+allegro simple-warning
#+clozure ccl:compiler-warning
#+cmucl kernel:simple-style-warning
#-(or allegro clozure cmucl) warning)
#'muffle-warning))
(funcall thunk)))
;; Note that it's polite to sort the defsystem forms in dependency order,
;; and compulsory to sort them in defsystem-depends-on order.
#+asdf3
(defsystem "asdf/prelude"
:version (:read-file-form "version.lisp-expr")
:around-compile call-without-redefinition-warnings ;; we need be the same as uiop
:encoding :utf-8
:components ((:file "header")))
#+asdf3
(defsystem "asdf/driver"
;; Since ASDF 3.3, asdf.asd can't afford to depend on reading uiop.asd,
;; which would cause circularity, since everything depends on reading asdf.asd.
;; Therefore, we can't "just" :depends-on ("uiop") like we used to do, and instead
;; we transclude the list of uiop component into this secondary system.
:pathname "uiop"
:around-compile call-without-redefinition-warnings ;; we need be the same as uiop
:components #.(getf (read-file-form (subpathname *load-pathname* "uiop/uiop.asd") :at 2) :components))
#+asdf3
(defsystem "asdf/defsystem"
:licence "MIT"
:description "The defsystem part of ASDF"
:long-name "Another System Definition Facility"
:description "The portable defsystem for Common Lisp"
:long-description "ASDF/DEFSYSTEM is the de facto standard DEFSYSTEM facility for Common Lisp,
a successor to Dan Barlow's ASDF and Francois-Rene Rideau's ASDF2.
For bootstrap purposes, it comes bundled with UIOP in a single file, asdf.lisp."
:homepage "http://common-lisp.net/projects/asdf/"
:bug-tracker "https://launchpad.net/asdf/"
:mailto "asdf-devel@common-lisp.net"
:source-control (:git "git://common-lisp.net/projects/asdf/asdf.git")
:version (:read-file-form "version.lisp-expr")
:build-operation monolithic-concatenate-source-op
:build-pathname "build/asdf" ;; our target
:around-compile call-without-redefinition-warnings ;; we need be the same as uiop
:depends-on ("asdf/prelude" "asdf/driver")
:encoding :utf-8
:components
((:file "upgrade")
(:file "session" :depends-on ("upgrade"))
(:file "component" :depends-on ("session"))
(:file "operation" :depends-on ("session"))
(:file "system" :depends-on ("component"))
(:file "system-registry" :depends-on ("system"))
(:file "action" :depends-on ("session" "system" "operation"))
(:file "lisp-action" :depends-on ("action"))
(:file "find-component" :depends-on ("component"))
(:file "forcing" :depends-on ("operation" "system-registry"))
(:file "plan" :depends-on ("lisp-action" "find-component" "forcing"))
(:file "operate" :depends-on ("plan"))
(:file "find-system" :depends-on ("system-registry" "operate"))
(:file "parse-defsystem" :depends-on ("system-registry" "lisp-action" "operate"
"find-system"))
(:file "bundle" :depends-on ("lisp-action" "parse-defsystem"))
(:file "concatenate-source" :depends-on ("bundle"))
(:file "package-inferred-system" :depends-on ("parse-defsystem"))
(:file "output-translations" :depends-on ("operate"))
(:file "source-registry" :depends-on ("find-system"))
(:file "backward-internals" :depends-on ("find-system" "parse-defsystem"))
(:file "backward-interface" :depends-on ("output-translations"))
(:file "interface" :depends-on
("parse-defsystem" "concatenate-source"
"output-translations" "source-registry" "package-inferred-system"
"backward-interface" "backward-internals"))
(:file "user" :depends-on ("interface"))
(:file "footer" :depends-on ("user"))))
(defsystem "asdf"
:author ("Daniel Barlow")
:maintainer ("Francois-Rene Rideau")
:maintainer ("Robert Goldman")
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.26.88" ;; to be automatically updated by bin/bump-revision
:version "3.3.7.3" ;; to be automatically updated by make bump-version
:depends-on ()
:components ((:module "build" :components ((:file "asdf"))))
:in-order-to (#+asdf2.27 (compile-op (monolithic-load-concatenated-source-op generate-asdf))))
#-asdf2.27
(defmethod perform :before
((o compile-op)
(c (eql (first (module-components
(first (module-components (find-system :asdf))))))))
(declare (ignorable o))
(perform (make-instance 'load-source-op) c))
#+(and clisp (not asdf2.27))
(rename-package :asdf :asdf-utilities)
. #-asdf3 () #+asdf3
(:encoding :utf-8
:class #+asdf3.1 package-inferred-system #-asdf3.1 system
;; For most purposes, asdf itself specially counts as a builtin system.
;; If you want to link it or do something forbidden to builtin systems,
;; specify separate dependencies on uiop (aka asdf/driver) and asdf/defsystem.
:builtin-system-p t
:in-order-to ((prepare-op (monolithic-concatenate-source-op "asdf/defsystem")))))
;;;; -------------------------------------------------------------------------
;;; Backward-compatible interfaces
(asdf/package:define-package :asdf/backward-interface
(uiop/package:define-package :asdf/backward-interface
(:recycle :asdf/backward-interface :asdf)
(:use :common-lisp :asdf/utility :asdf/pathname :asdf/os :asdf/run-program
:asdf/upgrade :asdf/component :asdf/system :asdf/operation :asdf/action
:asdf/lisp-build :asdf/operate :asdf/output-translations)
(:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/session
:asdf/component :asdf/system :asdf/system-registry :asdf/operation :asdf/action
:asdf/lisp-action :asdf/plan :asdf/operate
:asdf/find-system :asdf/parse-defsystem :asdf/output-translations :asdf/bundle)
(:export
#:*asdf-verbose*
#:operation-error #:compile-error #:compile-failed #:compile-warned
#:error-component #:error-operation #:traverse
#:component-load-dependencies
#:enable-asdf-binary-locations-compatibility
#:merge-component-name-type
#:operation-forced
#:operation-on-failure
#:operation-on-warnings
#:operation-on-failure #:operation-on-warnings #:on-failure #:on-warnings
#:component-property
#:run-shell-command
#:system-definition-pathname))
#:system-definition-pathname #:system-registered-p #:require-system
#:explain
#+ecl #:make-build))
(in-package :asdf/backward-interface)
(defun* component-load-dependencies (component)
;; Old deprecated name for the same thing. Please update your software.
(component-sibling-dependencies component))
(defun* merge-component-name-type (name &key type defaults)
;; For backward-compatibility only, for people using internals.
;; Will be removed in a future release, e.g. 2.016.
(warn "Please don't use ASDF::MERGE-COMPONENT-NAME-TYPE. Use ASDF:COERCE-PATHNAME.")
(coerce-pathname name :type type :defaults defaults))
(defgeneric* operation-forced (operation)) ;; Used by swank.asd for swank-loader.
(defmethod operation-forced ((o operation)) (getf (operation-original-initargs o) :force))
(defgeneric* operation-on-warnings (operation))
(defgeneric* operation-on-failure (operation))
#-gcl<2.7 (defgeneric* (setf operation-on-warnings) (x operation))
#-gcl<2.7 (defgeneric* (setf operation-on-failure) (x operation))
(defmethod operation-on-warnings ((o operation))
(declare (ignorable o)) *compile-file-warnings-behaviour*)
(defmethod operation-on-failure ((o operation))
(declare (ignorable o)) *compile-file-failure-behaviour*)
(defmethod (setf operation-on-warnings) (x (o operation))
(declare (ignorable o)) (setf *compile-file-warnings-behaviour* x))
(defmethod (setf operation-on-failure) (x (o operation))
(declare (ignorable o)) (setf *compile-file-failure-behaviour* x))
(defun* system-definition-pathname (x)
;; As of 2.014.8, we mean to make this function obsolete,
;; but that won't happen until all clients have been updated.
;;(cerror "Use ASDF:SYSTEM-SOURCE-FILE instead"
"Function ASDF:SYSTEM-DEFINITION-PATHNAME is obsolete.
It used to expose ASDF internals with subtle differences with respect to
user expectations, that have been refactored away since.
We recommend you use ASDF:SYSTEM-SOURCE-FILE instead
for a mostly compatible replacement that we're supporting,
or even ASDF:SYSTEM-SOURCE-DIRECTORY or ASDF:SYSTEM-RELATIVE-PATHNAME
;; NB: the warning status of these functions may have to be distinguished later,
;; as some get removed faster than the others in client code.
(with-asdf-deprecation (:style-warning "3.2" :warning "3.4")
;; These conditions from ASDF 1 and 2 are used by many packages in Quicklisp;
;; but ASDF3 replaced them with somewhat different variants of uiop:compile-condition
;; that do not involve ASDF actions.
;; TODO: find the offenders and stop them.
(progn
(define-condition operation-error (error) ;; Bad, backward-compatible name
;; Used by SBCL, cffi-tests, clsql-mysql, clsql-uffi, qt, elephant, uffi-tests, sb-grovel
((component :reader error-component :initarg :component)
(operation :reader error-operation :initarg :operation))
(:report (lambda (c s)
(format s (compatfmt "~@<~A while invoking ~A on ~A~@:>")
(type-of c) (error-operation c) (error-component c)))))
(define-condition compile-error (operation-error) ())
(define-condition compile-failed (compile-error) ())
(define-condition compile-warned (compile-error) ()))
;; In Quicklisp 2015-05, still used by lisp-executable, staple, repl-utilities, cffi
(defun component-load-dependencies (component) ;; from ASDF 2.000 to 2.26
"DEPRECATED. Please use COMPONENT-SIDEWAY-DEPENDENCIES instead; or better,
define your operations with proper use of SIDEWAY-OPERATION, SELFWARD-OPERATION,
or define methods on PREPARE-OP, etc."
;; Old deprecated name for the same thing. Please update your software.
(component-sideway-dependencies component))
;; These old interfaces from ASDF1 have never been very meaningful
;; but are still used in obscure places.
;; In Quicklisp 2015-05, still used by cl-protobufs and clx.
(defgeneric operation-on-warnings (operation)
(:documentation "DEPRECATED. Please use UIOP:*COMPILE-FILE-WARNINGS-BEHAVIOUR* instead."))
(defgeneric operation-on-failure (operation)
(:documentation "DEPRECATED. Please use UIOP:*COMPILE-FILE-FAILURE-BEHAVIOUR* instead."))
(defgeneric (setf operation-on-warnings) (x operation)
(:documentation "DEPRECATED. Please SETF UIOP:*COMPILE-FILE-WARNINGS-BEHAVIOUR* instead."))
(defgeneric (setf operation-on-failure) (x operation)
(:documentation "DEPRECATED. Please SETF UIOP:*COMPILE-FILE-FAILURE-BEHAVIOUR* instead."))
(progn
(defmethod operation-on-warnings ((o operation))
*compile-file-warnings-behaviour*)
(defmethod operation-on-failure ((o operation))
*compile-file-failure-behaviour*)
(defmethod (setf operation-on-warnings) (x (o operation))
(setf *compile-file-warnings-behaviour* x))
(defmethod (setf operation-on-failure) (x (o operation))
(setf *compile-file-failure-behaviour* x)))
;; Quicklisp 2015-05: Still used by SLIME's swank-asdf (!), common-lisp-stat,
;; js-parser, osicat, babel, staple, weblocks, cl-png, plain-odbc, autoproject,
;; cl-blapack, com.informatimago, cells-gtk3, asdf-dependency-grovel,
;; cl-glfw, cffi, jwacs, montezuma
(defun system-definition-pathname (x)
;; As of 2.014.8, we mean to make this function obsolete,
;; but that won't happen until all clients have been updated.
"DEPRECATED. This function used to expose ASDF internals with subtle
differences with respect to user expectations, that have been refactored
away since. We recommend you use ASDF:SYSTEM-SOURCE-FILE instead for a
mostly compatible replacement that we're supporting, or even
ASDF:SYSTEM-SOURCE-DIRECTORY or ASDF:SYSTEM-RELATIVE-PATHNAME
if that's whay you mean." ;;)
(system-source-file x))
;;;; ASDF-Binary-Locations compatibility
(defun* enable-asdf-binary-locations-compatibility
(&key
(centralize-lisp-binaries nil)
(default-toplevel-directory
(subpathname (user-homedir) ".fasls/")) ;; Use ".cache/common-lisp/" instead ???
(include-per-user-information nil)
(map-all-source-files (or #+(or clisp ecl mkcl) t nil))
(source-to-target-mappings nil))
#+(or clisp ecl mkcl)
(when (null map-all-source-files)
(error "asdf:enable-asdf-binary-locations-compatibility doesn't support :map-all-source-files nil on CLISP, ECL and MKCL"))
(let* ((fasl-type (fasl-type))
(mapped-files (if map-all-source-files *wild-file*
(make-pathname :type fasl-type :defaults *wild-file*)))
(destination-directory
(if centralize-lisp-binaries
`(,default-toplevel-directory
,@(when include-per-user-information
(cdr (pathname-directory (user-homedir))))
:implementation ,*wild-inferiors*)
`(:root ,*wild-inferiors* :implementation))))
(initialize-output-translations
`(:output-translations
,@source-to-target-mappings
#+abcl (#p"jar:file:/**/*.jar!/**/*.*" (:function translate-jar-pathname))
#+abcl (#p"/___jar___file___root___/**/*.*" (,@destination-directory))
((:root ,*wild-inferiors* ,mapped-files)
(,@destination-directory ,mapped-files))
(t t)
:ignore-inherited-configuration))))
(defmethod operate :before (operation-class system &rest args &key &allow-other-keys)
(declare (ignorable operation-class system args))
(when (find-symbol* '#:output-files-for-system-and-operation :asdf nil)
(error "ASDF 2 is not compatible with ASDF-BINARY-LOCATIONS, which you are using.
(system-source-file x))
;; TRAVERSE is the function used to compute a plan in ASDF 1 and 2.
;; It was never officially exposed but some people still used it.
(defgeneric traverse (operation component &key &allow-other-keys)
(:documentation
"DEPRECATED. Use MAKE-PLAN and PLAN-ACTIONS, or REQUIRED-COMPONENTS,
or some other supported interface instead.
Generate and return a plan for performing OPERATION on COMPONENT.
The plan returned is a list of dotted-pairs. Each pair is the CONS
of ASDF operation object and a COMPONENT object. The pairs will be
processed in order by OPERATE."))
(progn
(define-convenience-action-methods traverse (operation component &key)))
(defmethod traverse ((o operation) (c component) &rest keys &key plan-class &allow-other-keys)
(plan-actions (apply 'make-plan plan-class o c keys)))
;; ASDF-Binary-Locations compatibility
;; This remains supported for legacy user, but not recommended for new users.
;; We suspect there are no more legacy users in 2016.
(defun enable-asdf-binary-locations-compatibility
(&key
(centralize-lisp-binaries nil)
(default-toplevel-directory
;; Use ".cache/common-lisp/" instead ???
(subpathname (user-homedir-pathname) ".fasls/"))
(include-per-user-information nil)
(map-all-source-files (or #+(or clasp clisp ecl mkcl) t nil))
(source-to-target-mappings nil)
(file-types `(,(compile-file-type)
"build-report"
#+clasp (compile-file-type :output-type :object)
#+ecl (compile-file-type :type :object)
#+mkcl (compile-file-type :fasl-p nil)
#+clisp "lib" #+sbcl "cfasl"
#+sbcl "sbcl-warnings" #+clozure "ccl-warnings")))
"DEPRECATED. Use asdf-output-translations instead."
#+(or clasp clisp ecl mkcl)
(when (null map-all-source-files)
(error "asdf:enable-asdf-binary-locations-compatibility doesn't support :map-all-source-files nil on CLISP, ECL and MKCL"))
(let* ((patterns (if map-all-source-files (list *wild-file*)
(loop :for type :in file-types
:collect (make-pathname :type type :defaults *wild-file*))))
(destination-directory
(if centralize-lisp-binaries
`(,default-toplevel-directory
,@(when include-per-user-information
(cdr (pathname-directory (user-homedir-pathname))))
:implementation ,*wild-inferiors*)
`(:root ,*wild-inferiors* :implementation))))
(initialize-output-translations
`(:output-translations
,@source-to-target-mappings
#+abcl (#p"jar:file:/**/*.jar!/**/*.*" (:function translate-jar-pathname))
#+abcl (#p"/___jar___file___root___/**/*.*" (,@destination-directory))
,@(loop :for pattern :in patterns
:collect `((:root ,*wild-inferiors* ,pattern)
(,@destination-directory ,pattern)))
(t t)
:ignore-inherited-configuration))))
(progn
(defmethod operate :before (operation-class system &rest args &key &allow-other-keys)
(declare (ignore operation-class system args))
(when (find-symbol* '#:output-files-for-system-and-operation :asdf nil)
(error "ASDF 2 is not compatible with ASDF-BINARY-LOCATIONS, which you are using.
ASDF 2 now achieves the same purpose with its builtin ASDF-OUTPUT-TRANSLATIONS,
which should be easier to configure. Please stop using ASDF-BINARY-LOCATIONS,
and instead use ASDF-OUTPUT-TRANSLATIONS. See the ASDF manual for details.
In case you insist on preserving your previous A-B-L configuration, but
do not know how to achieve the same effect with A-O-T, you may use function
ASDF:ENABLE-ASDF-BINARY-LOCATIONS-COMPATIBILITY as documented in the manual;
call that function where you would otherwise have loaded and configured A-B-L.")))
call that function where you would otherwise have loaded and configured A-B-L."))))
;; run-shell-command from ASDF 2, lightly fixed from ASDF 1, copied from MK-DEFSYSTEM. Die!
(defun run-shell-command (control-string &rest args)
"PLEASE DO NOT USE. This function is not just DEPRECATED, but also dysfunctional.
Please use UIOP:RUN-PROGRAM instead."
#-(and ecl os-windows)
(let ((command (apply 'format nil control-string args)))
(asdf-message "; $ ~A~%" command)
(let ((exit-code
(ignore-errors
(nth-value 2 (run-program command :force-shell t :ignore-error-status t
:output *verbose-out*)))))
(typecase exit-code
((integer 0 255) exit-code)
(t 255))))
#+(and ecl os-windows)
(not-implemented-error "run-shell-command" "for ECL on Windows."))
;; HOW do we get rid of variables??? With a symbol-macro that issues a warning?
;; In Quicklisp 2015-05, cl-protobufs still uses it, but that should be fixed in next version.
(progn
(defvar *asdf-verbose* nil)) ;; backward-compatibility with ASDF2 only. Unused.
;; Do NOT use in new code. NOT SUPPORTED.
;; NB: When this goes away, remove the slot PROPERTY in COMPONENT.
;; In Quicklisp 2014-05, it's still used by yaclml, amazon-ecs, blackthorn-engine, cl-tidy.
;; See TODO for further cleanups required before to get rid of it.
(defgeneric component-property (component property))
(defgeneric (setf component-property) (new-value component property))
(defmethod component-property ((c component) property)
(cdr (assoc property (slot-value c 'properties) :test #'equal)))
(defmethod (setf component-property) (new-value (c component) property)
(let ((a (assoc property (slot-value c 'properties) :test #'equal)))
(if a
(setf (cdr a) new-value)
(setf (slot-value c 'properties)
(acons property new-value (slot-value c 'properties)))))
new-value)
;; This method survives from ASDF 1, but really it is superseded by action-description.
(defgeneric explain (operation component)
(:documentation "Display a message describing an action.
DEPRECATED. Use ASDF:ACTION-DESCRIPTION and/or ASDF::FORMAT-ACTION instead."))
(progn
(define-convenience-action-methods explain (operation component)))
(defmethod explain ((o operation) (c component))
(asdf-message (compatfmt "~&~@<; ~@;~A~:>~%") (action-description o c))))
(with-asdf-deprecation (:style-warning "3.3")
(defun system-registered-p (name)
"DEPRECATED. Return a generalized boolean that is true if a system of given NAME was registered already.
NAME is a system designator, to be normalized by COERCE-NAME.
The value returned if true is a pair of a timestamp and a system object."
(if-let (system (registered-system name))
(cons (if-let (primary-system (registered-system (primary-system-name name)))
(component-operation-time 'define-op primary-system))
system)))
;;;; run-shell-command
;;
;; WARNING! The function below is dysfunctional and deprecated.
;; Please use asdf/run-program:run-program/ instead.
(defun require-system (system &rest keys &key &allow-other-keys)
"Ensure the specified SYSTEM is loaded, passing the KEYS to OPERATE, but do not update the
system or its dependencies if it has already been loaded."
(declare (ignore keys))
(unless (component-loaded-p system)
(load-system system))))
(defun* run-shell-command (control-string &rest args)
"Interpolate ARGS into CONTROL-STRING as if by FORMAT, and
synchronously execute the result using a Bourne-compatible shell, with
output to *VERBOSE-OUT*. Returns the shell's exit code."
(let ((command (apply 'format nil control-string args)))
(asdf-message "; $ ~A~%" command)
(run-program/ command :force-shell t :ignore-error-status t :output *verbose-out*)))
;;; This function is for backward compatibility with ECL only.
#+ecl
(with-asdf-deprecation (:style-warning "3.2" :warning "9999")
(defun make-build (system &rest args
&key (monolithic nil) (type :fasl) (move-here nil move-here-p)
prologue-code epilogue-code no-uiop
prefix-lisp-object-files postfix-lisp-object-files extra-object-files
&allow-other-keys)
(let* ((operation (asdf/bundle::select-bundle-operation type monolithic))
(move-here-path (if (and move-here
(typep move-here '(or pathname string)))
(ensure-pathname move-here :namestring :lisp :ensure-directory t)
(system-relative-pathname system "asdf-output/")))
(extra-build-args (remove-plist-keys
'(:monolithic :type :move-here
:prologue-code :epilogue-code :no-uiop
:prefix-lisp-object-files :postfix-lisp-object-files
:extra-object-files)
args))
(build-system (if (subtypep operation 'image-op)
(eval `(defsystem "asdf.make-build"
:class program-system
:source-file nil
:pathname ,(system-source-directory system)
:build-operation ,operation
:build-pathname ,(subpathname move-here-path
(file-namestring (first (output-files operation system))))
:depends-on (,(coerce-name system))
:prologue-code ,prologue-code
:epilogue-code ,epilogue-code
:no-uiop ,no-uiop
:prefix-lisp-object-files ,prefix-lisp-object-files
:postfix-lisp-object-files ,postfix-lisp-object-files
:extra-object-files ,extra-object-files
:extra-build-args ,extra-build-args))
system))
(files (output-files operation build-system)))
(operate operation build-system)
(if (or move-here
(and (null move-here-p) (member operation '(program-op image-op))))
(loop :with dest-path = (resolve-symlinks* (ensure-directories-exist move-here-path))
:for f :in files
:for new-f = (make-pathname :name (pathname-name f)
:type (pathname-type f)
:defaults dest-path)
:do (rename-file-overwriting-target f new-f)
:collect new-f)
files))))
;;;; -------------------------------------------------------------------------
;;; Internal hacks for backward-compatibility
;;; Internal hacks for backward-compatibility
(asdf/package:define-package :asdf/backward-internals
(uiop/package:define-package :asdf/backward-internals
(:recycle :asdf/backward-internals :asdf)
(:use :common-lisp :asdf/utility :asdf/pathname
:asdf/upgrade :asdf/system :asdf/component :asdf/find-system :asdf/action)
(:export ;; for internal use
#:%refresh-component-inline-methods
#:%resolve-if-component-dep-fails))
(:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/find-system)
(:export #:load-sysdef))
(in-package :asdf/backward-internals)
;;;; Backward compatibility with "inline methods"
(defparameter +asdf-methods+
'(perform-with-restarts perform explain output-files operation-done-p))
(defun* %remove-component-inline-methods (component)
(dolist (name +asdf-methods+)
(map ()
;; this is inefficient as most of the stored
;; methods will not be for this particular gf
;; But this is hardly performance-critical
#'(lambda (m)
(remove-method (symbol-function name) m))
(component-inline-methods component)))
;; clear methods, then add the new ones
(component-inline-methods component) nil)
(defun* %define-component-inline-methods (ret rest)
(dolist (name +asdf-methods+)
(let ((keyword (intern (symbol-name name) :keyword)))
(loop :for data = rest :then (cddr data)
:for key = (first data)
:for value = (second data)
:while data
:when (eq key keyword) :do
(destructuring-bind (op qual (o c) &body body) value
(pushnew
(eval `(defmethod ,name ,qual ((,o ,op) (,c (eql ,ret)))
,@body))
(component-inline-methods ret)))))))
(defun* %refresh-component-inline-methods (component rest)
(%remove-component-inline-methods component)
(%define-component-inline-methods component rest))
;;;; PARTIAL SUPPORT for the :if-component-dep-fails component attribute
;; and the companion asdf:feature pseudo-dependency.
;; This won't recurse into dependencies to accumulate feature conditions.
;; Therefore it will accept the SB-ROTATE-BYTE of an old SBCL
;; (older than 1.1.2.20-fe6da9f) but won't suffice to load an old nibbles.
(defun* %resolve-if-component-dep-fails (if-component-dep-fails component)
(asdf-message "The system definition for ~S uses deprecated ~
ASDF option :IF-COMPONENT-DEP-DAILS. ~
Starting with ASDF 2.27, please use :IF-FEATURE instead"
(coerce-name (component-system component)))
;; This only supports the pattern of use of the "feature" seen in the wild
(check-type component parent-component)
(check-type if-component-dep-fails (member :fail :ignore :try-next))
(unless (eq if-component-dep-fails :fail)
(loop :with o = (make-instance 'compile-op)
:for c :in (component-children component) :do
(loop :for (feature? feature) :in (component-depends-on o c)
:when (eq feature? 'feature) :do
(setf (component-if-feature c) feature)))))
(with-asdf-deprecation (:style-warning "3.2" :warning "3.4")
(defun load-sysdef (name pathname)
(declare (ignore name pathname))
;; Needed for backward compatibility with swank-asdf from SLIME 2015-12-01 or older.
(error "Use asdf:load-asd instead of asdf::load-sysdef")))
#!/bin/sh
# write the highest tag to standard output
# exit code is 1 if it cannot be found
tag=`git describe --tags --match '[0-9].[0-9][0-9]'`
if [ "$tag" == "" ]; then
exit 1
fi
echo $tag
exit 0
#!/bin/sh
":" ; exec sbcl --script "$0" "$@" ; exit # -*- Lisp -*-
;;; Really runs on any decent Common Lisp implementation
(require :asdf)
(in-package :asdf)
(upgrade-asdf)
(load-systems :cl-ppcre :xcvb-utils)
(in-package :xcvb-utils)
(asdf-debug)
(resume-image)
(defun afile (x)
(asdf:system-relative-pathname :asdf x))
(defparameter *version-file*
(afile "version.lisp-expr"))
(defparameter *old-version* nil)
(defparameter *new-version* nil)
(defun next-version (v)
(let ((pv (parse-version v)))
(incf (third pv))
(unparse-version pv)))
(defun version-from-file ()
(safe-read-first-file-form *version-file*))
(defun versions-from-argv (argv)
(ecase (length argv)
((2) (values (second argv) (first argv)))
((1) (values (version-from-file) (first argv)))
((0) (let ((old (version-from-file)))
(values old (next-version old))))))
(multiple-value-setq (*old-version* *new-version*)
(versions-from-argv *command-line-arguments*))
(format t "Bumping ASDF version from ~A to ~A~%" *old-version* *new-version*)
(deftype byte-vector () '(array (unsigned-byte 8) (*)))
(defun maybe-replace-file (file transformer
&key (reader 'read-file-string)
(writer nil) (comparator 'equalp)
(external-format *utf-8-external-format*))
(let* ((old-contents (funcall reader file))
(new-contents (funcall transformer old-contents)))
(if (funcall comparator old-contents new-contents)
(format t "No changes for file ~A~%" file)
(let ((written-contents
(if writer
(with-output (s ())
(funcall writer s new-contents))
new-contents)))
(check-type written-contents (or string (byte-vector)))
(clobber-file-with-vector file written-contents :external-format external-format)))))
(defun version-transform (text)
(flet ((v1 (ver) (format nil "~S" ver))
(v2 (ver) (format nil "This is ASDF ~A:" ver))
(f (fun text)
(cl-ppcre:regex-replace-all
(funcall fun *old-version*) text (funcall fun *new-version*))))
(f #'v2 (f #'v1 text))))
(defparameter *versioned-files*
'("version.lisp-expr" "asdf.asd" "header.lisp" "build/asdf.lisp" "upgrade.lisp"))
(defun transform-file (x)
(format t "Transforming file ~A~%" x)
(maybe-replace-file (afile x) #'version-transform))
(map () 'transform-file *versioned-files*)
#! /usr/bin/env perl
use FindBin;
use Getopt::Long;
our $old;
our $new;
our $usage = 0;
&GetOptions("help"=>\$usage,
"usage"=>\$usage);
if ($usage) {
print "$0 [old-version] [new-version]\n";
print "\tIf only one argument, treat it as the new version argument.\n";
print "\tIf two arguments treat the first as old version number and second as new.\n";
print "\n\tBumps the version numbers in all the relevant files.\n";
exit 0;
}
our $asdf_dir = $FindBin::RealBin . "/../";
our $file = $asdf_dir . "version.lisp-expr";
our @transform_ref =
(
[ "version.lisp-expr", "\"", "\"" ],
[ "uiop/version.lisp", "(defparameter *uiop-version* \"", "\")" ],
[ "asdf.asd", " :version \"", "\" ;; to be automatically updated by make bump-version" ],
[ "header.lisp", "This is ASDF ", ": Another System Definition Facility." ],
[ "upgrade.lisp", "(asdf-version \"", "\")" ],
[ "doc/asdf.texinfo", "Manual for Version ", "" ], );
if ($#ARGV == 1) {
$old = $ARGV[0];
$new = $ARGV[1];
} elsif ($#ARGV == 0) {
$new = $ARGV[0];
$old = read_asdf_version();
} else {
$old = read_asdf_version();
$new = bump_asdf_version($old);
}
print STDERR "Bumping from $old to $new\n";
transform_files();
sub read_asdf_version {
open(FILE, $file);
my $str = <FILE>;
chomp $str;
print STDERR "Read version string $str from $file\n";
close FILE;
$str =~ s/"//g;
return $str;
}
sub bump_asdf_version {
my $oldver = shift;
my @fields = split/\./, $oldver;
$fields[$#fields]++;
return join('.', @fields);
}
sub transform_files {
foreach my $entryptr (@transform_ref) {
my @entry = @{$entryptr};
my $file = $entry[0];
print STDERR "Modifying file $file\n";
print STDERR "Prefix is $entry[1], suffix is $entry[2]\n";
my $regex = "(" . quotemeta($entry[1]) . ")" . "((\\d+\\.)+\\d+)" . "(" . quotemeta($entry[2]) .")";
my $filename = $asdf_dir . $file;
my $data = read_text($filename);
my $count = ($data =~ s/$regex/$1$new$4/g);
if ($count == 0) {
die "Unable to replace $regex with $1$new$4";
}
# print STDERR "Writing $data to $filename\n";
write_text($filename, $data);
}
}
# can't reliably find File::Slurper, or File::Slurp, so do it
# old school.
sub read_text ($) {
my $fn = shift;
local $/ = undef;
open READFILE, $fn or die "Couldn't open file: $fn";
binmode READFILE;
my $string = <READFILE>;
close READFILE;
return $string;
}
sub write_text ($$) {
my $fn = shift;
my $data = shift;
open WRITEFILE, "> $fn" or die "Couldn't open $fn for writing.";
print WRITEFILE $data;
close WRITEFILE;
return 1;
}
#!/bin/sh
if [ -n $1 ]; then
clnet_home="$1"
else
echo "Remote directory must be specified."
exit 2
fi
if [ -n "$2" ]; then
user="${2}@"
else
echo "Remote username not specified"
echo "Assuming remote user is same as local"
echo "and/or you configured your .ssh/config with:"
echo "Host common-lisp.net"
echo " User = foo"
fi
tarball=`ls tmp/asdf*.tar.gz`
tarball=`basename $tarball`
latest="asdf.tar.gz"
echo "Link $tarball to $latest"
ssh ${user}common-lisp.net "rm -f $clnet_home$latest; \
ln -s $clnet_home/archives/$tarball $clnet_home$latest"
(in-package #:common-lisp-user)
#+(or)
(build-web-page "/repository/git/asdf/test/results/" "/tmp/x.html" :if-exists :supersede)
(defvar *make-helper-home* *load-truename*)
;;; metatilities-base
;;; because sometimes copy and paste is just too easy
(eval-when (:compile-toplevel :load-toplevel :execute)
(defmacro generate-time-part-function (part-name position)
(let ((function-name (intern (concatenate 'string
(symbol-name 'time) "-" (symbol-name part-name)))))
`(eval-when (:compile-toplevel :load-toplevel :execute)
(export ',function-name)
(defun ,function-name
(&optional (universal-time (get-universal-time))
(time-zone nil))
,(format nil "Returns the ~(~A~) part of the given time." part-name)
(nth-value ,position (apply #'decode-universal-time universal-time time-zone))))))
(generate-time-part-function second 0)
(generate-time-part-function minute 1)
(generate-time-part-function hour 2)
(generate-time-part-function date 3)
(generate-time-part-function month 4)
(generate-time-part-function year 5)
(generate-time-part-function day-of-week 6)
(generate-time-part-function daylight-savings-time-p 7))
;;; format-date
(defparameter +days-per-month+
'(31 28 31 30 31 30 31 31 30 31 30 31))
(defun days-in-month (month &optional leap-year?)
"Returns the number of days in the specified month. The month should be
between 1 and 12."
(+ (nth (1- month) +days-per-month+) (if (and (= month 2) leap-year?) 1 0)))
(defun leap-year-p (year)
"Returns t if the specified year is a leap year. I.e. if the year
is divisible by four but not by 100 or if it is divisible by 400."
(or (and (= (mod year 4) 0) ; logand is faster but less perspicuous
(not (= (mod year 100) 0)))
(= (mod year 400) 0)))
(defun day-of-year (date)
"Returns the day of the year [1 to 366] of the specified date [which must be \(CL\) universal time format.]"
(let ((leap-year? (leap-year-p (time-year date))))
(+ (loop for month from 1 to (1- (time-month date)) sum
(days-in-month month leap-year?))
(time-date date))))
(defconstant +longer-format-index+ 0)
(defconstant +shorter-format-index+ 1)
(defparameter +month-output-list+
'(("January" "February" "March" "April" "May" "June" "July" "August" "September"
"October" "November" "December")
("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec")))
(defparameter +dow-output-list
'(("Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday")
("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")))
(defun day->string (day-of-the-week &optional (format :long))
"Returns the name of `day-of-the-week`. The parameter should be a number between 0 and 6 where 0 represents Sunday and 6 repressents Saturday. The optional format argument can be either :long or :short. In the latter case, the return string will be of length three; in the former it will be the complete name of the appropriate day."
(check-type day-of-the-week (mod 7))
(check-type format (member :long :short))
(nth day-of-the-week
(case format
(:long (nth +longer-format-index+ +dow-output-list))
(:short (nth +shorter-format-index+ +dow-output-list)))))
(defun month->string (month &optional (format :long))
"Returns the name \(in English\) of the month. Format can be :long or :short."
(check-type month (integer 1 12))
(check-type format (member :long :short))
(nth (1- month)
(case format
(:long (nth +longer-format-index+ +month-output-list+))
(:short (nth +shorter-format-index+ +month-output-list+)))))
(defun format-date (format date &optional stream time-zone)
"Formats universal dates using the same format specifiers as NSDateFormatter. The format is:
%% - A '%' character
%a - Abbreviated weekday name
%A - Full weekday name
%b - Abbreviated month name
%B - Full month name
%c - Shorthand for \"%X %x\", the locale format for date and time
%d - Day of the month as a decimal number [01-31]
%e - Same as %d but does not print the leading 0 for days 1 through 9
[unlike strftime[], does not print a leading space]
%F - Milliseconds as a decimal number [000-999]
%H - Hour based on a 24-hour clock as a decimal number [00-23]
%I - Hour based on a 12-hour clock as a decimal number [01-12]
%j - Day of the year as a decimal number [001-366]
%m - Month as a decimal number [01-12]
%M - Minute as a decimal number [00-59]
%p - AM/PM designation for the locale
%S - Second as a decimal number [00-59]
%w - Weekday as a decimal number [0-6], where Sunday is 0
%x - Date using the date representation for the locale, including
the time zone [produces different results from strftime[]]
%X - Time using the time representation for the locale [produces
different results from strftime[]]
%y - Year without century [00-99]
%Y - Year with century [such as 1990]
%Z - Time zone name [such as Pacific Daylight Time;
produces different results from strftime[]]
%z - Time zone offset in hours and minutes from GMT [HHMM]
None of %c, %F, %p, %x, %X, %Z, %z are implemented."
(declare (ignore time-zone))
(let ((format-length (length format)))
(format
stream "~{~A~}"
(loop for index = 0 then (1+ index)
while (< index format-length) collect
(let ((char (aref format index)))
(cond
((char= #\% char)
(setf char (aref format (incf index)))
(cond
;; %% - A '%' character
((char= char #\%) #\%)
;; %a - Abbreviated weekday name
((char= char #\a) (day->string (time-day-of-week date) :short))
;; %A - Full weekday name
((char= char #\A) (day->string (time-day-of-week date) :long))
;; %b - Abbreviated month name
((char= char #\b) (month->string (time-month date) :short))
;; %B - Full month name
((char= char #\B) (month->string (time-month date) :long))
;; %d - Day of the month as a decimal number [01-31]
((char= char #\d) (format nil "~2,'0D" (time-date date)))
;; %e - Same as %d but does not print the leading 0 for days 1 through 9
;; Unlike strftime, does not print a leading space
((char= char #\e) (format nil "~D" (time-date date)))
;; %H - Hour based on a 24-hour clock as a decimal number [00-23]
((char= char #\H) (format nil "~2,'0D" (time-hour date)))
;; %I - Hour based on a 12-hour clock as a decimal number [01-12]
((char= char #\I) (format nil "~2,'0D" (1+ (mod (time-hour date) 12))))
;; %j - Day of the year as a decimal number [001-366]
((char= char #\j) (format nil "~3,'0D" (day-of-year date)))
;; %m - Month as a decimal number [01-12]
((char= char #\m) (format nil "~2,'0D" (time-month date)))
;; %M - Minute as a decimal number [00-59]
((char= char #\M) (format nil "~2,'0D" (time-minute date)))
;; %S - Second as a decimal number [00-59]
((char= char #\S) (format nil "~2,'0D" (time-second date)))
;; %w - Weekday as a decimal number [0-6], where Sunday is 0
((char= char #\w) (format nil "~D" (time-day-of-week date)))
;; %y - Year without century [00-99]
((char= char #\y)
(let ((year-string (format nil "~,2A" (time-year date))))
(subseq year-string (- (length year-string) 2))))
;; %Y - Year with century [such as 1990]
((char= char #\Y) (format nil "~D" (time-year date)))
(t
(error "Ouch - unknown formatter '%~c" char))))
(t char)))))))
;;; metatilites-base
(defun extract-summary (pathname stream)
(with-open-file (in pathname :direction :input
:if-does-not-exist :error)
(let ((start nil))
(loop for line = (read-line in nil :eof)
until (eq line :eof) do
(when (and (> (length line) 5) (string-equal "-#---" (subseq line 0 5)))
(setf start t))
(when start
(format stream "~&~a~%" line))))))
(defun html-header (stream title style-sheet)
(format stream "~&<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
(format stream "~&<html>~&<head>")
(when title
(format stream "~&<title>~a</title>" title))
(when style-sheet
(unless (search ".css" style-sheet)
(setf style-sheet (concatenate 'string style-sheet ".css")))
(format stream "~&<link type='text/css' href='~a' rel='stylesheet' />"
style-sheet))
(format stream "~&</head>~&<body>"))
(defun html-footer (stream)
(format stream "<div id=\"footer\">")
(format stream "~&generated on ~a"
(format-date "%B %d, %Y" (get-universal-time)))
(format stream "</div>")
(format stream "~&</body></html>"))
(defun build-web-page (input-directory output-file &key (if-exists :error)
(title "ASDF test report") (style-sheet "styles.css"))
(with-open-file (stream output-file
:direction :output
:if-exists if-exists
:if-does-not-exist :create)
(html-header stream title style-sheet)
(format stream "~&~%<h1>ASDF Test results</h1>~%")
(dolist (pathname (directory
(merge-pathnames (make-pathname :name :wild :type "text")
input-directory)))
(print pathname)
(format stream "~&~%<h2>~a</h2>~%" (pathname-name pathname))
(format stream "~&<pre>~%")
(extract-summary pathname stream)
(format stream "~&</pre>~%"))
(html-footer stream)
))
(defun extract-license (input-pathname output-pathname)
(with-open-file (in input-pathname :direction :input
:if-does-not-exist :error)
(with-open-file (out output-pathname
:direction :output
:if-does-not-exist :create
:if-exists :error)
(let* ((state nil)
(flag ";;; -- LICENSE")
(flag-length (length flag)))
(loop for line = (read-line in nil :eof)
until (eq line :eof) do
(when (and (> (length line) flag-length)
(string-equal flag (subseq line 0 flag-length)))
(if (eq state :running)
(return)
(setf state :starting)))
(when (eq state :running)
(format out "~&~a~%" (subseq line (min (length line) 4))))
(when (eq state :starting)
(setf state :running)))))))
(defun rewrite-license ()
(let* ((*default-pathname-defaults*
(make-pathname :name nil :type nil :defaults *make-helper-home*))
(output (merge-pathnames (make-pathname :name "LICENSE"
:directory '(:relative :up)))))
(when (probe-file output)
(delete-file output))
(extract-license
(merge-pathnames (make-pathname :name "asdf" :type "lisp"
:directory '(:relative :up)))
output)))
(defun write-test-web-pages ()
(let* ((*default-pathname-defaults*
(make-pathname :name nil :type nil :defaults *make-helper-home*))
(source (merge-pathnames
(make-pathname
:directory '(:relative :up "test" "results"))))
(output (merge-pathnames (make-pathname
:directory '(:relative :up "website" "output")
:name "test-results"
:type "html"))))
(print (list source output))
(build-web-page source output :if-exists :supersede)))
#!/bin/sh
# create tarball and tagged asdf.lisp file in tmp/ using the most recent
# annotated tag
tag=`git describe --tags --match '[0-9].[0-9][0-9]'`
if [ "$tag" == "" ]; then
echo "Unable to find most recent tag, exiting"
exit 1
fi
if [ -d "tmp" ]; then
rm -r tmp
fi
mkdir tmp
archive_file="tmp/asdf-$tag.tar.gz"
echo "Create tmp/asdf.tar.gz with tag $tag"
git archive $tag --prefix="asdf/" --format=tar | \
gzip > $archive_file
#!/bin/sh
# --extended-attributes \
rsync \
--archive \
--rsh=ssh \
--compress \
--partial \
--include "*/" --include "*" \
--progress \
-v \
$*