Skip to content

Commit c3e89e2

Browse files
committed
cleanup: remove submodules and simplify the Makefile
It's easy to forget to keep the submodules up-to-date with dylan-package.json and not really worth the continuing trouble. If we need to build Deft on a new platform it's just not that hard to checkout the dependencies and make the registry. * 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). * Removed the source controlled registry files, which were for building with submodules. * Removed the hack to add the Git version info to `$deft-version`; that will be handled with Git filters in a subsequent commit.
1 parent 534328e commit c3e89e2

27 files changed

+45
-93
lines changed

.github/workflows/build-and-test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,11 @@ jobs:
5555
${exe} list
5656
${exe} build abc-test-suite
5757
_build/bin/abc-test-suite
58+
59+
- name: Run test suite using submodules
60+
env:
61+
DYLAN_CATALOG: ext/pacman-catalog
62+
DYLAN: dylan-root
63+
run: |
64+
mkdir -p ${DYLAN}
65+
make test-submodules

.gitmodules

-24
Original file line numberDiff line numberDiff line change
@@ -1,24 +0,0 @@
1-
[submodule "ext/sphinx-extensions"]
2-
path = ext/sphinx-extensions
3-
url = https://github.com/dylan-lang/sphinx-extensions.git
4-
[submodule "ext/command-line-parser"]
5-
path = ext/command-line-parser
6-
url = https://github.com/dylan-lang/command-line-parser
7-
[submodule "ext/json"]
8-
path = ext/json
9-
url = https://github.com/dylan-lang/json
10-
[submodule "ext/logging"]
11-
path = ext/logging
12-
url = https://github.com/dylan-lang/logging
13-
[submodule "ext/regular-expressions"]
14-
path = ext/regular-expressions
15-
url = https://github.com/dylan-lang/regular-expressions
16-
[submodule "ext/uncommon-dylan"]
17-
path = ext/uncommon-dylan
18-
url = https://github.com/cgay/uncommon-dylan
19-
[submodule "ext/testworks"]
20-
path = ext/testworks
21-
url = https://github.com/dylan-lang/testworks
22-
[submodule "ext/pacman-catalog"]
23-
path = ext/pacman-catalog
24-
url = https://github.com/dylan-lang/pacman-catalog

Makefile

+33-42
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,55 @@
11
# Low-tech Makefile to build and install deft.
22

33
DYLAN ?= $${HOME}/dylan
4-
install_dir = $(DYLAN)/install/deft
5-
install_bin = $(install_dir)/bin
6-
install_lib = $(install_dir)/lib
7-
link_target = $(install_bin)/deft-app
8-
link_source = $(DYLAN)/bin/dylan
94

10-
git_version := "$(shell git describe --tags --always --match 'v*')"
5+
.PHONY: build clean install remove-deft-artifacts test dist distclean
116

12-
.PHONY: build build-with-version clean install install-debug really-install remove-deft-artifacts test dist distclean
7+
git_version := $(shell git describe --tags --always --match 'v*')
138

14-
build: remove-deft-artifacts
15-
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify deft-app
16-
17-
# Hack to add the version to the binary with git tag info. Don't want this to
18-
# be the normal build because it causes unnecessary rebuilds.
19-
build-with-version: remove-deft-artifacts
9+
# Hack to add the version to the binary with Git tag info. During development I (cgay)
10+
# just build with "deft build" so the unnecessary rebuilds that this would cause aren't
11+
# an issue.
12+
build:
13+
dylan update
2014
file="sources/commands/utils.dylan"; \
2115
orig=$$(mktemp); \
2216
temp=$$(mktemp); \
2317
cp -p $${file} $${orig}; \
24-
cat $${file} | sed "s,/.__./.*/.__./,/*__*/ \"${git_version}\" /*__*/,g" > $${temp}; \
18+
cat $${file} | sed "s,/.__./.*/.__./,/*__*/ \"${git_version}\ built on $$(date -Iseconds)\" /*__*/,g" > $${temp}; \
2519
mv $${temp} $${file}; \
26-
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \
27-
dylan-compiler -build -unify deft-app; \
20+
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build deft-app; \
2821
cp -p $${orig} $${file}
2922

30-
# Until the install-deft GitHub Action is no longer referring to deft-app
31-
# we also create a link named deft-app.
32-
really-install:
23+
install: build
3324
mkdir -p $(DYLAN)/bin
34-
cp _build/sbin/deft-app $(DYLAN)/bin/deft
35-
ln -f $(DYLAN)/bin/deft $(DYLAN)/bin/deft-app
36-
ln -f $(DYLAN)/bin/deft $(DYLAN)/bin/dylan
37-
38-
install: build-with-version really-install
39-
40-
# Build and install without the version hacking above.
41-
install-debug: build really-install
42-
43-
# Deft needs to be buildable with submodules so that it can be built on
44-
# new platforms without having to manually install deps.
45-
test: build
46-
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \
47-
dylan-compiler -build deft-test-suite \
48-
&& DYLAN_CATALOG=ext/pacman-catalog _build/bin/deft-test-suite
25+
mkdir -p $(DYLAN)/install/deft/bin
26+
mkdir -p $(DYLAN)/install/deft/lib
27+
cp _build/bin/deft-app $(DYLAN)/install/deft/bin/deft
28+
cp -r _build/lib/lib* $(DYLAN)/install/deft/lib/
29+
# For unified exe these could be hard links but for now they must be symlinks so
30+
# that the relative paths to ../lib are correct. With --unify I ran into the
31+
# "libunwind.so not found" bug.
32+
ln -s -f $$(realpath $(DYLAN)/install/deft/bin/deft) $(DYLAN)/bin/deft
33+
# For temp backward compatibility...
34+
ln -s -f $$(realpath $(DYLAN)/install/deft/bin/deft) $(DYLAN)/bin/deft-app
35+
ln -s -f $$(realpath $(DYLAN)/install/deft/bin/deft) $(DYLAN)/bin/dylan
36+
37+
test:
38+
dylan update
39+
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build deft-test-suite \
40+
&& _build/bin/deft-test-suite
4941

5042
dist: distclean install
5143

52-
# Sometimes I use deft to develop deft, so this makes sure to clean
53-
# up its artifacts.
54-
remove-deft-artifacts:
44+
clean:
5545
rm -rf _packages
56-
find registry -not -path '*/generic/*' -type f -exec rm {} \;
57-
58-
clean: remove-deft-artifacts
46+
rm -rf registry
5947
rm -rf _build
6048
rm -rf _test
49+
rm -rf *~
6150

6251
distclean: clean
63-
rm -rf $(install_dir)
64-
rm -f $(link_source)
52+
rm -rf $(DYLAN)/install/deft
53+
rm $(DYLAN)/bin/deft
54+
rm $(DYLAN)/bin/deft-app
55+
rm $(DYLAN)/bin/dylan

dylan-package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "deft",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"license": "MIT",
5-
"category": "language-tools",
5+
"category": "development tools",
66
"contact": "[email protected]",
77
"description": "Manage Dylan workspaces, packages, and registries",
88
"keywords": ["workspace", "package"],
99
"dependencies": [
1010
11-
"json@1.0",
12-
"logging@2.1",
11+
"json@1.1",
12+
"logging@2.2",
1313
1414
1515
],

ext/command-line-parser

-1
This file was deleted.

ext/json

-1
This file was deleted.

ext/logging

-1
This file was deleted.

ext/pacman-catalog

-1
This file was deleted.

ext/regular-expressions

-1
This file was deleted.

ext/sphinx-extensions

-1
This file was deleted.

ext/testworks

-1
This file was deleted.

ext/uncommon-dylan

-1
This file was deleted.

registry/generic/command-line-parser

-1
This file was deleted.

registry/generic/command-line-parser-test-suite

-1
This file was deleted.

registry/generic/command-line-parser-test-suite-app

-1
This file was deleted.

registry/generic/deft

-1
This file was deleted.

registry/generic/deft-app

-1
This file was deleted.

registry/generic/deft-test-suite

-1
This file was deleted.

registry/generic/json

-1
This file was deleted.

registry/generic/json-test-suite

-1
This file was deleted.

registry/generic/logging

-1
This file was deleted.

registry/generic/logging-test-suite

-1
This file was deleted.

registry/generic/regular-expressions

-1
This file was deleted.

registry/generic/regular-expressions-test-suite

-1
This file was deleted.

registry/generic/testworks

-1
This file was deleted.

registry/generic/uncommon-dylan

-1
This file was deleted.

registry/generic/uncommon-dylan-tests

-1
This file was deleted.

0 commit comments

Comments
 (0)