Skip to content

v1.4.0: Pin forge identity by repository ID; accurate libc and architecture for Linux artifacts

Choose a tag to compare

@github-actions github-actions released this 27 Sep 14:43
· 198 commits to main since this release
87479df

packslip verify and the library can now pin a GitHub or GitLab project by its repository ID, not just its name, so renamed repositories keep verifying and a recreated name is rejected. packslip create also stops recording static Linux builds as gnu and recognizes more architecture spellings. It now refuses Linux and BSD artifacts whose architecture it can't work out, which may require changes to existing release jobs (see Breaking Changes).

Added

  • Forge identity pinned by repository ID. Until now a project's name was its identity: a consumer that asked for github.com/jdx/rtx rejected releases after the repository was renamed to jdx/mise. A name-based pin would also accept releases from a new repository created under an old name. Fulcio certificates from GitHub Actions and GitLab CI record the forge's IDs for the repository and its owner. The repository ID stays the same through a rename or transfer. The owner ID changes on a transfer. (#135, @jdx)
    • packslip verify prints these IDs for keyless bundles, and --json adds a source_repository object:

      ok: github.com/jdx/hk 2.3.0 published … signed by … (sigstore-oidc) …
        repository https://github.com/jdx/hk (id 922514152), owner https://github.com/jdx (id 216188)
      
    • New library APIs verify_forge and verify_forge_release_list check a verified release against the consumer's stored ForgePin. Without a pin, they check it against the repository ID the forge resolves the requested name to. There are four outcomes:

      • Same repository: accepted.
      • Same repository ID under a new name: accepted as Continuity::Renamed, including releases signed before the rename.
      • Same repository ID with a different owner: rejected with IdentityError::Transferred unless the consumer calls accepting_transfer(true).
      • Different repository ID: rejected with IdentityError::DifferentRepository.
      use packslip::forge::{Continuity, Expected, ForgePin};
      
      let expected = Expected::new("github.com/jdx/hk")
          .pinned(stored_pin.as_ref())
          .resolved(api_repository_id.as_deref())
          .accepting_transfer(user_said_yes);
      let accepted = packslip::verify_forge(&bundle, &expected, options, &artifacts)?;

      Also added: sigstore::SourceRepository, sigstore::source_repository, and the forge module (ForgePin, Expected, Continuity, Check, IdentityError, check, policy). All additions are backward compatible, and cargo-semver-checks reports no breaking change against 1.3.0.

    • The specification has a new Forge identity section and updated consumer rules for renames, transfers, and monorepo subpaths. It also documents the limits:

      • Trust on first use when there is no pin.
      • Without a pinned owner ID, an owner rename looks like a transfer.
      • Certificates issued before Fulcio recorded the IDs are checked by name only.
  • any is accepted for arch and libc, both on the command line and in the manifest, to leave a field out on purpose (#134, @jdx):
    dist/mytool.tar.gz:linux/any          # a Linux build for every architecture
    dist/mytool.tar.gz:linux/x86_64/any   # a Linux x86_64 build that loads no C library
    

Fixed

  • Static Linux builds are no longer marked libc: gnu. Before, every Linux artifact without musl in its name was recorded as gnu. That included fully static binaries such as Go builds with CGO_ENABLED=0, so musl hosts like Alpine found no match. When the name doesn't say musl or gnu, create now reads the libc from the --bin executables. (#134, @jdx)

    • If every executable is static, libc is omitted.
    • If an executable is loaded by ld-musl or links libc.musl-*, libc is musl.
    • Otherwise libc is gnu, as before. This also applies when there are no executables to read, for example with no --bin or with --no-libs.

    Values given in the manifest or on the command line still take precedence, followed by what the name says.

  • More architecture names are recognized (#134, @jdx):

    • goreleaser's 386 and ia32 are recorded as i686. Before, they were recorded with no arch, which means "any architecture", so an armv7 or riscv64 host could be given an x86 binary. The match only applies to a separate word, so the 386 in a version like 1.386.0 is ignored.
    • A plain arm is armv6, the default for both goreleaser and Rust.
    • ppc64el is powerpc64le.
    • win64 is x86_64 when nothing else in the name gives an architecture.
    • MIPS and big-endian POWER are recorded with Rust's spelling (mips, mipsel, mips64, mips64el, powerpc64).

Breaking Changes

  • packslip create now fails for a Linux, BSD, or Android artifact whose architecture it can't infer from the name, for example tool-linux.AppImage. It used to record these as fitting every architecture. This affects any release job that runs create on such files.
    • Exempt: .noarch.rpm and _all.deb packages, macOS and Windows artifacts, and portable artifacts (:any, portable = true).
    • To fix it, give the architecture explicitly, or use any if the build really runs everywhere:
      $ packslip create ... tool_linux.tar.gz
      Error: artifact "tool_linux.tar.gz" is for linux, but nothing in the name says which architecture; give it as PATH:linux/x86_64 or arch = "x86_64" in the manifest, with any in place of x86_64 if the build runs on every architecture
      
  • Library: packslip::create::infer_platform now returns a libc only when the name says one, and never for an OS other than Linux. The gnu fallback now happens in create. New APIs: create::ANY, Error::UnknownArch, and linkage::{Libc, elf_libc}.

The CLI, library, and Action share one semver version, and this release bumps it to 1.4.0. The packslip format itself is unchanged and stays at version 1. The forge identity rules are consumer rules, not a schema change.

Full Changelog: v1.3.0...v1.4.0