diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4c9dc4d..387839f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -40,12 +40,15 @@ jobs: run: | mkdir -p ${DYLAN} make install + ls -l ${DYLAN}/bin/ + ldd ${DYLAN}/bin/deft - name: Exercise deft env: DYLAN_CATALOG: ext/pacman-catalog DYLAN: dylan-root run: | + find ${DYLAN} -print exe="$(realpath ${DYLAN}/bin/deft)" export DYLAN_CATALOG="$(realpath ${DYLAN_CATALOG})" ${exe} new library --force-package abc strings@1.1 @@ -55,3 +58,11 @@ jobs: ${exe} list ${exe} build abc-test-suite _build/bin/abc-test-suite + + - name: Run test suite using submodules + env: + DYLAN_CATALOG: ext/pacman-catalog + DYLAN: dylan-root + run: | + mkdir -p ${DYLAN} + make test-submodules diff --git a/Makefile b/Makefile index cde1aa6..d69aa39 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,40 @@ # Low-tech Makefile to build and install deft. DYLAN ?= $${HOME}/dylan -install_dir = $(DYLAN)/install/deft -install_bin = $(install_dir)/bin -install_lib = $(install_dir)/lib -link_target = $(install_bin)/deft-app -link_source = $(DYLAN)/bin/dylan git_version := "$(shell git describe --tags --always --match 'v*')" -.PHONY: build build-with-version clean install install-debug really-install remove-deft-artifacts test dist distclean +.PHONY: build build-with-version clean install install-debug really-install remove-deft-artifacts test test-submodules dist distclean build: remove-deft-artifacts - OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify deft-app + OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build deft-app # Hack to add the version to the binary with git tag info. Don't want this to # be the normal build because it causes unnecessary rebuilds. build-with-version: remove-deft-artifacts file="sources/commands/utils.dylan"; \ - orig=$$(mktemp); \ + saved=$$(mktemp); \ temp=$$(mktemp); \ - cp -p $${file} $${orig}; \ + cp -p $${file} $${saved}; \ cat $${file} | sed "s,/.__./.*/.__./,/*__*/ \"${git_version}\" /*__*/,g" > $${temp}; \ mv $${temp} $${file}; \ OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \ - dylan-compiler -build -unify deft-app; \ - cp -p $${orig} $${file} + dylan-compiler -build deft-app; \ + cp -p $${saved} $${file} # Until the install-deft GitHub Action is no longer referring to deft-app # we also create a link named deft-app. really-install: mkdir -p $(DYLAN)/bin - cp _build/sbin/deft-app $(DYLAN)/bin/deft - ln -f $(DYLAN)/bin/deft $(DYLAN)/bin/deft-app - ln -f $(DYLAN)/bin/deft $(DYLAN)/bin/dylan + mkdir -p $(DYLAN)/install/deft/bin + mkdir -p $(DYLAN)/install/deft/lib + cp _build/bin/deft-app $(DYLAN)/install/deft/bin/deft + cp -r _build/lib/lib* $(DYLAN)/install/deft/lib/ + # For unified exe these can be hard links; for now they must be symlinks. + ln -s -f $(DYLAN)/install/deft/bin/deft $(DYLAN)/bin/deft + # For temp backward compatibility... + ln -s -f $(DYLAN)/install/deft/bin/deft $(DYLAN)/bin/deft-app + ln -s -f $(DYLAN)/install/deft/bin/deft $(DYLAN)/bin/dylan install: build-with-version really-install @@ -42,11 +43,17 @@ install-debug: build really-install # Deft needs to be buildable with submodules so that it can be built on # new platforms without having to manually install deps. -test: build +test: OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \ dylan-compiler -build deft-test-suite \ && DYLAN_CATALOG=ext/pacman-catalog _build/bin/deft-test-suite +# Deft also needs to be buildable with submodules so that it can be built on new +# platforms without having to manually install deps. +test-submodules: distclean + dylan-compiler -build deft-test-suite \ + && DYLAN_CATALOG=ext/pacman-catalog _build/bin/deft-test-suite + dist: distclean install # Sometimes I use deft to develop deft, so this makes sure to clean @@ -58,7 +65,6 @@ remove-deft-artifacts: clean: remove-deft-artifacts rm -rf _build rm -rf _test + rm -rf *~ distclean: clean - rm -rf $(install_dir) - rm -f $(link_source)