Skip to content

Commit

Permalink
build: Add test-submodules "make" target, don't -unify
Browse files Browse the repository at this point in the history
Ran into trouble with unified exe not finding libunwind.so so I've reverted back to the
non-unified build and install regime until we have a new release with housel's fix for
libunwind (likely 2025.1).
  • Loading branch information
cgay committed Dec 30, 2024
1 parent ed236ed commit ad42aad
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
Expand All @@ -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
40 changes: 23 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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)

0 comments on commit ad42aad

Please sign in to comment.