Issue #2956: A package names files from outside its directory that the packer copies in, so shared test data and a licence live once in the repository

Open and answer this issue on GitHub.

blocked · opened 2026-11-29 · updated 2026-11-29 · 0 comments

The goal

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)

The proposal

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"

The catch: development and the archive must see the same paths

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.

To build

  1. ADR-registry-1: a decision for [package.files], with the refusals above, beside D4.
  2. The manifest reader (crates/nikaia-std/src/compiler/manifest.nika): the section, its refusals, its error messages.
  3. The packer (part of the registry’s minimum, ADR-registry-1): copies each entry into the archive under its package path.
  4. nikaia test and nikaia build: a read of a package path that [package.files] names reads the file it names.
  5. base85n: the copies and the nikaia-copies job removed, replaced by the section.
  6. Tests: a .nika package whose test reads a file named in [package.files] passes both in place and packed; each refusal has a test.

Done when

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.

Back to Open Issues