Commit 156e96d1
156e96d1885aMerged
NHH <[email protected]> · 6 months ago · 10 files · +7 added · ~3 modified
Description
feat(gem): add Spinelfile + path-gem loadpath resolution (Phase 0)
spinel-gem reads a Spinelfile (path: gems only) and writes a
Spinelfile.loadpaths sidecar. spinel_parse learns --loadpaths=FILE
and searches those dirs before <exe_dir>/lib. The driver walks up
from the source file to discover the sidecar, so require "foo"
in any nested .rb finds the gem.
Also fixes a latent bug where a top-of-file plain require was
silently dropped after the first splice rebuilt the buffer -- the
bootstrap clause only fired when result == source, then never again.
Tests: 11 unit + 6 E2E + 1 parser regression; new make test-gems.
Details
- Commit
- 156e96d1885a
- Parent
- f78c5792301d
MakefilemodifiedView file
COMPILER_HELPERS_STAMP := build/stamps/compiler_helpers.rb.stampPARSE_STAMP := build/stamps/spinel_parse.c.stamp.PHONY: all parse bootstrap codegen rbs_extract test retest clean-test-results regen-expected bench optcarrot clean install uninstall deps.PHONY: all parse bootstrap codegen rbs_extract test retest test-gems clean-test-results regen-expected bench optcarrot clean install uninstall deps# `make all` includes spinel_rbs_extract when vendor/rbs has been# fetched (via `make deps`). Without vendor/rbs the extractor isretest: clean-test-results @$(MAKE) --no-print-directory test# spinel-gem POC tests: unit tests for the Spinelfile DSL + shell-driven# end-to-end scenarios (basic resolution, walk-up discovery, negative,# dedup, invalid config). Depends on the parser binary being current so# the E2E flow exercises the loadpath sidecar plumbing for real.test-gems: spinel_parse$(EXE) @sh test_gem/run_all.sh# The .ok target is the test's stamp; mtime tracking gives per-test# caching for free. Order-only spinel_parse$(EXE) / spinel_analyze$(EXE)# / spinel_codegen$(EXE) stop a bootstrap relink from invalidating every test.spinelmodifiedView file
Loading diff…
spinel-gemaddedView file
Loading diff…
spinel_gem.rbaddedView file
Loading diff…
spinel_parse.cmodifiedView file
Loading diff…
test/require_top_of_file.rbaddedView file
Loading diff…
test/require_top_of_file.rb.expectedaddedView file
Loading diff…
test_gem/run_all.shaddedView file
Loading diff…
test_gem/run_e2e.shaddedView file
Loading diff…
test_gem/spinelfile_test.rbaddedView file
Loading diff…