Skip to content

Progress on getting self-hosted compiler broker/worker system going. #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ example.deps: PHONY SAVI

# Generate Savi and Crystal source code from CapnProto definitions.
gen.capnp: PHONY self-hosted.deps $(BUILD)/capnpc-savi $(BUILD)/capnpc-crystal
capnp compile \
-I"$(shell find self-hosted/deps/github:jemc-savi/CapnProto/* -name src | sort -r -V | head -n 1)/" \
self-hosted/src/SaviProto/SaviProto.Artifact.capnp --output=- \
| $(BUILD)/capnpc-savi > self-hosted/src/SaviProto/SaviProto.Artifact.capnp.savi
capnp compile \
-I"$(shell find self-hosted/deps/github:jemc-savi/CapnProto/* -name src | sort -r -V | head -n 1)/" \
self-hosted/src/SaviProto/SaviProto.AST.capnp --output=- \
Expand All @@ -111,20 +115,30 @@ gen.capnp: PHONY self-hosted.deps $(BUILD)/capnpc-savi $(BUILD)/capnpc-crystal
-I"$(shell find self-hosted/deps/github:jemc-savi/CapnProto/* -name src | sort -r -V | head -n 1)/" \
self-hosted/src/SaviProto/SaviProto.AST.capnp --output=- \
| $(BUILD)/capnpc-crystal > self-hosted/src/SaviProto/SaviProto.AST.capnp.cr
capnp compile \
-I"$(shell find self-hosted/deps/github:jemc-savi/CapnProto/* -name src | sort -r -V | head -n 1)/" \
self-hosted/src/SaviProto/SaviProto.Artifact.capnp --output=- \
| $(BUILD)/capnpc-crystal > self-hosted/src/SaviProto/SaviProto.Artifact.capnp.cr
capnp compile \
-I"$(shell find self-hosted/deps/github:jemc-savi/CapnProto/* -name src | sort -r -V | head -n 1)/" \
self-hosted/src/SaviProto/SaviProto.Source.capnp --output=- \
| $(BUILD)/capnpc-crystal > self-hosted/src/SaviProto/SaviProto.Source.capnp.cr
gen.capnp.check: gen.capnp
git diff --exit-code self-hosted/src/SaviProto

# Update deps for the Self-hosted Savi subprograms.
# Update deps for the Self-hosted Savi compiler subprograms.
self-hosted.deps: PHONY SAVI
echo && $(SAVI) deps update --cd self-hosted --for savi-lang-broker
echo && $(SAVI) deps update --cd self-hosted --for savi-lang-plumber
echo && $(SAVI) deps update --cd self-hosted --for savi-lang-parse

# Create the self-hosted Savi parse subprogram.
self-hosted/bin/savi-lang-parse: $(SAVI) $(shell find self-hosted/src/savi-lang-parse self-hosted/src/SaviProto -name '*.savi')
echo && $(SAVI) --cd self-hosted savi-lang-parse --print-perf --backtrace
# Create the self-hosted Savi compiler subprograms.
self-hosted/bin/savi-lang-broker: $(SAVI) $(shell find self-hosted/src/savi-lang-broker self-hosted/src/SaviWorker self-hosted/src/SaviProto -name '*.savi')
echo && $(SAVI) build --cd self-hosted savi-lang-broker --print-perf --backtrace
self-hosted/bin/savi-lang-plumber: $(SAVI) $(shell find self-hosted/src/savi-lang-plumber self-hosted/src/SaviWorker self-hosted/src/SaviProto -name '*.savi')
echo && $(SAVI) build --cd self-hosted savi-lang-plumber --print-perf --backtrace
self-hosted/bin/savi-lang-parse: $(SAVI) $(shell find self-hosted/src/savi-lang-parse self-hosted/src/SaviWorker self-hosted/src/SaviProto -name '*.savi')
echo && $(SAVI) build --cd self-hosted savi-lang-parse --print-perf --backtrace

# Run spec scripts for self-hosted Savi subprograms.
spec.self-hosted: PHONY self-hosted/bin/$(name)
Expand Down
72 changes: 59 additions & 13 deletions self-hosted/manifest.savi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
:manifest bin "savi-lang-parse"
:sources "src/savi-lang-parse/*.savi"
:sources "src/SaviProto/*.savi"
:manifest lib SaviWorker
:sources "src/SaviWorker/*.savi"
:sources "src/SaviProto/SaviProto.Source.capnp.savi"
:sources "src/SaviProto/SaviProto.Artifact.capnp.savi"
:sources "src/SaviProto/SaviProto.Artifact.Path.savi"

:dependency CapnProto v0
:from "github:jemc-savi/CapnProto"
Expand All @@ -9,25 +11,69 @@
:dependency Map v0
:from "github:savi-lang/Map"

:dependency PEG v0
:from "github:savi-lang/PEG"

:dependency Time v0
:from "github:savi-lang/Time"

:dependency StdIn v0
:from "github:savi-lang/StdIn"
:depends on ByteStream
:depends on IO
:depends on OSError
:dependency Timer v0
:from "github:savi-lang/Timer"
:depends on Time

:dependency CLI v0
:from "github:savi-lang/CLI"
:depends on Map

:dependency Logger v0
:from "github:savi-lang/Logger"
:depends on Time

:dependency ByteStream v0
:from "github:savi-lang/ByteStream"

:dependency IO v0
:from "github:savi-lang/IO"
:depends on ByteStream
:depends on OSError

:transitive dependency ByteStream v0
:from "github:savi-lang/ByteStream"
:dependency TCP v0
:from "github:savi-lang/TCP"
:depends on ByteStream
:depends on IO
:depends on OSError
:depends on IPAddress

:dependency StdIn v0
:from "github:savi-lang/StdIn"
:depends on ByteStream
:depends on IO
:depends on OSError

:transitive dependency OSError v0
:from "github:savi-lang/OSError"

:transitive dependency IPAddress v0
:from "github:savi-lang/IPAddress"

:dependency File v0
:from "github:savi-lang/File"
:depends on OSError
:depends on Time
:depends on IO
:depends on ByteStream
:depends on Map

:manifest bin "savi-lang-broker"
:sources "src/savi-lang-broker/*.savi"
:copies SaviWorker

:manifest bin "savi-lang-plumber"
:sources "src/savi-lang-plumber/*.savi"
:sources "src/SaviProto/SaviProto.AST.capnp.savi"
:copies SaviWorker

:manifest bin "savi-lang-parse"
:sources "src/savi-lang-parse/*.savi"
:sources "src/SaviProto/SaviProto.AST.capnp.savi"
:copies SaviWorker

:dependency PEG v0
:from "github:savi-lang/PEG"
2 changes: 1 addition & 1 deletion self-hosted/spec/savi-lang-parse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ cd -- "$(dirname -- "$0")"
set -e

find savi-lang-parse -name '*.savi' | xargs -I '{}' \
sh -c 'cat {} | ../bin/savi-lang-parse > {}.ast.yaml'
sh -c 'cat {} | ../bin/savi-lang-parse --test-mode > {}.ast.yaml'

git diff --exit-code savi-lang-parse
Loading
Loading