Repository navigation
build: make the published package installable and runnable - #887
Merged
Merged
Conversation
This was referenced Sep 18, 2026
swapnilpaliwal-sd
force-pushed
the
fix/886-package-installable
branch
from
September 18, 2026 05:22
95b8f9e to
39c4169
Compare
`npm install` of the packed tarball produced an install that could not run. Four causes, each fatal on its own, none visible from a source checkout. - files: absent, so npm fell back to the ignore rules and honoured a workspace's own .gitignore. parser/.gitignore ignores dist/, so the built parser was dropped while parser/src/test-data shipped. Installed clean, failed on first use for every language. - bin: absent, so nothing put axiomcode on PATH. - bin/axiomcode: the root walk started at dirname "$0", which under a node_modules/.bin symlink is .bin/. It climbed the user's project, found a package.json with no graph/ beside it and returned "/", reporting `parser not built at //parser/dist/index.js` and advising a build that an installed copy cannot run. Resolve the link first, and fail clearly when the marker is never found. - dependencies: absent. The parser ships here as parser/dist but is a workspace and is never published, so nothing installed what it requires and first use died on `Cannot find module 'typescript'`. Adding files also stops the corpora shipping: 81 MB to 3.1 MB packed, 428 MB to 13.6 MB unpacked. All engine rules still ship. graph/test/tools/package-contents-test.sh reads the pack manifest and asserts the fields and the contents; it fails on each of the four defects above. Wired into the java preflight. Verified on a clean VM with no souffle, gcc, make or cmake, asserted absent before and after the node install: installing only the tarballs and running four public OSS projects, one per language, all four complete and write graph.sqlite (java 11s, typescript 7s, python 25s, javascript 7s). The native parser dependencies installed from prebuilt binaries with no node-gyp runs. Fixes #886
swapnilpaliwal-sd
force-pushed
the
fix/886-package-installable
branch
from
September 18, 2026 05:31
39c4169 to
865be69
Compare
swapnilpaliwal-sd
added a commit
that referenced
this pull request
Sep 18, 2026
…478) (#903) Reverts f6ba1c2. The engine binaries work is not ready to ship, so it goes back to a pull request and #454 reopens with it. Not a plain revert, because two changes landed on top of it and both have to keep working: - #897 pinned the collation inside write_program, which #478 introduced. Reverting removes that function and would take the guard with it, and the restored executor has the same defect: its #include lines come from unguarded globs, so the cache key follows the user's locale. The guard is re-applied to the restored program generation, and engine-id-locale-test.sh now accepts either shape of the executor so it keeps measuring rather than failing for the wrong reason. Its --emit-program checks skip here, since that flag belongs to #478, and they report the skip rather than passing silently. - #887 added bin, files and dependencies, which are independent of the engine work and stay. optionalDependencies goes with the feature: nothing resolves a packaged engine any more, so those entries would name packages the executor never looks for. What comes back: the executor compiles with a local souffle and caches the binary, exactly as before #478. engine.conf, packaging/ and the two engine tests go with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #886.
npm installof the packed tarball produced an install that could not run. Four causes, each fatal on its own, none visible from a source checkout, where the parser is built, the CLI is invoked by path and the dependencies are present because a workspace install put them there.Changes
fileslisted explicitly. Without it npm falls back to the ignore rules and honours a workspace's own.gitignore:parser/.gitignoreignoresdist/, so the built parser was dropped from the tarball whileparser/src/test-datashipped. Listing what ships inverts the default, so a new build output is included unless excluded rather than silently lost.binadded, soaxiomcodeis on PATH after install.bin/axiomcoderesolves$0through symlinks before the root walk. npm installs abinentry as a link innode_modules/.bin, so the walk started in.bin/, climbed the user's project, found apackage.jsonwith nograph/beside it and returned/. The run then failed withparser not built at //parser/dist/index.jsand advised a build an installed copy cannot run. It now also fails with a clear message when the marker is never found.dependencieshoisted from the parser workspace. The parser ships here asparser/distbut is never published, so nothing installed what it requires; first use died onCannot find module 'typescript'.Size
filesalso stops the corpora shipping: 81 MB to 3.1 MB packed, 428 MB to 13.6 MB unpacked. All engine rules still ship.Test
graph/test/tools/package-contents-test.shreads the pack manifest, so it costs a second and needs no network. It asserts the manifest fields, that the rules and CLI ship, that the corpora do not, and that built outputs are not excluded. Against the manifest before this change it fails on all four defects, includingdoes NOT ship parser/dist/and the 3326 corpus files. Wired into the java preflight.Build outputs are asserted only when present on disk, so an unbuilt checkout skips rather than fails, and the skip is printed rather than silent.
Verification
A clean cloud VM with no souffle, gcc, make or cmake, asserted absent before and after the node install. Installing only the two tarballs and running against four public OSS projects, one per language:
Every run reports
using packaged engine, so the engine came from the package and nothing was compiled. The native parser dependencies installed from prebuilt binaries with zero node-gyp invocations, so the no-compiler promise holds for the parser as well as the engine.Compatibility
Nothing here changes how a source checkout behaves. The root walk is unchanged when
$0is not a symlink, which is every existing invocation (bin/axiomcode,npm run, the suites).files,binanddependenciesaffect the tarball only. The hoisted dependencies duplicateparser/package.json, which the new test asserts stays in step.Independent of #478 and lands separately: #478 makes the engine installable, and these four defects sit in front of it. With them in place the engine is resolved correctly and the run still fails, because the parser half of the package is not installable. Both are needed before a release.