Skip to content

Bootstrap does not provide digest; pkgtools/digest is circular on base-64-lts 25.4.0 #427

Open

Description

@knoguchi

Summary

On base-64-lts 25.4.0, building a package from a trunk pkgsrc tree after ./bootstrap --unprivileged ends in a circular dependency on digest:

=> Bootstrap dependency digest>=20211023: NOT found
=> Verifying reinstall for ../../pkgtools/digest
===> Installing dependencies for digest-20220214
...
ERROR: [bsd.pkg.mk] Circular dependency detected

Mechanism (from the tree)

  • mk/fetch/bsd.fetch-vars.mk:117 and mk/checksum/bsd.checksum-vars.mk:22 declare USE_TOOLS+= digest:bootstrap, so digest is expected from the bootstrap.
  • bootstrap/bootstrap never builds or installs digest (no reference to it; the bootstrap prefix ends up with only bmake, bsdinstall, and the pkg_* tools).
  • mk/tools/digest.mk:57-69 falls back to TOOLS_DEPENDS.digest = digest>=20211023:../../pkgtools/digest when no usable system digest is found, and pkgtools/digest itself needs digest to build.
  • The base-system /usr/bin/digest on SmartOS rejects -V and -a BLAKE2s, so pkgsrc treats it as version 20010301 and does not use it.

Environment

  • Image: base-64-lts 25.4.0, with /usr/bin/digest present (digest -a sha512 works; digest -V and -a BLAKE2s are rejected).
  • Binary repo for the other tools: https://pkgsrc.smartos.org/packages/SmartOS/trunk/x86_64/All.

Steps to reproduce

  1. On a fresh 25.4.0 zone, cd <trunk tree>/bootstrap && ./bootstrap --prefix=<P> --workdir=<W> --unprivileged. Exits 0.
  2. Build any package that uses USE_TOOLS with digest:bootstrap (for example pkgtools/digest itself) from the same tree with PATH=<P>/bin:<P>/sbin:/usr/bin:/usr/sbin:/sbin. Result: Circular dependency detected.

Workaround that works (untrusted first pass, then rebuild)

  • Build pkgtools/digest with bmake build using only the system tools: produces digest-20220214, which runs and reports -V 20220214.
  • Rebuild it cleanly with that binary's output: the two binaries are identical (same SHA512).
  • Passing TOOLS_PLATFORM.digest=<that binary> to the package build removes the circular dependency.
  • The build then stops at devel/nbpatch with fatal error: tzfile.h: No such file or directory, which is libnbcompat-20251029 binary sets HAVE_TZFILE_H 1 on base-64-lts 25.4.0; devel/nbpatch fails #426.

Expected

The bootstrap should provide digest (the tree says it's a :bootstrap tool), or digest.mk should be able to use a working system digest without a -V check.

Notes

Activity

  1. added a commit that references this issue on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions