Open and answer this issue on GitHub.
blocked · opened 2026-11-29 · updated 2026-11-29 · 0 comments
A package that lies in a subdirectory of a larger repository takes files from elsewhere in that repository into its archive, without a second copy in the repository and without symlinks.
Found while preparing the first package for the registry, base85n (repository keywan-ghadami/base85n, its nikaia/ directory, branch nikaia): its tests read the shared test vectors at the repository’s root (testvectors/vectors.tsv, testvectors/adversarial_vectors.tsv), and its licence is the root’s LICENSE. The other implementations there (rust/) reach them through symlinks.
Needs #1429 (the registry and its archive format, ADR-registry-1, still decision)
core.symlinks is on; a directory copied or fetched alone (cp -r, a ZIP download, a partial clone of the subdirectory) has broken links; a packer that follows links has to be strict about where they may point (inside the repository, regular files, no chains), and it runs on foreign packages in the registry’s CI; and the archive’s hash would depend on files outside the package, which ADR-registry-1 D4 (“anything outside the package is refused”) rules out.base85n does now, commit “nikaia/: own copies of the vectors and the licence, checked by CI”): two copies of 400 KB and a CI job, nikaia-copies, that compares them with cmp. It works, but each package in such a repository repeats it.The manifest names each file from outside, and where it lies in the package:
[package.files]
"testvectors/vectors.tsv" = "../testvectors/vectors.tsv"
"testvectors/adversarial_vectors.tsv" = "../testvectors/adversarial_vectors.tsv"
"LICENSE" = "../LICENSE"
In the archive the file lies at testvectors/vectors.tsv; in the repository nothing lies at nikaia/testvectors/. A test that reads the package path passes only in the archive, and one that reads ../testvectors/ only in the repository. So every tool that reads the package’s files applies the same mapping: the packer, nikaia test, nikaia build, and reading files while building. That is a feature of the compiler, not only of the packer.
[package.files], with the refusals above, beside D4.crates/nikaia-std/src/compiler/manifest.nika): the section, its refusals, its error messages.nikaia test and nikaia build: a read of a package path that [package.files] names reads the file it names.base85n: the copies and the nikaia-copies job removed, replaced by the section..nika package whose test reads a file named in [package.files] passes both in place and packed; each refusal has a test.base85n’s nikaia/ holds no copy of the vectors or the licence, its tests pass in the repository and from the packed archive, and the archive’s hash is the same as with the copies.