zig/lib
Andrew Kelley d6a88ed74d introduce package id and redo hash format again
Introduces the `id` field to `build.zig.zon`.

Together with name, this represents a globally unique package
identifier. This field should be initialized with a 16-bit random number
when the package is first created, and then *never change*. This allows
Zig to unambiguously detect when one package is an updated version of
another.

When forking a Zig project, this id should be regenerated with a new
random number if the upstream project is still maintained. Otherwise,
the fork is *hostile*, attempting to take control over the original
project's identity.

`0x0000` is invalid because it obviously means a random number wasn't
used.

`0xffff` is reserved to represent "naked" packages.

Tracking issue #14288

Additionally:

* Fix bad path in error messages regarding build.zig.zon file.
* Manifest validates that `name` and `version` field of build.zig.zon
  are maximum 32 bytes.
* Introduce error for root package to not switch to enum literal for
  name.
* Introduce error for root package to omit `id`.
* Update init template to generate `id`
* Update init template to populate `minimum_zig_version`.
* New package hash format changes:
  - name and version limited to 32 bytes via error rather than truncation
  - truncate sha256 to 192 bits rather than 40 bits
  - include the package id

This means that, given only the package hashes for a complete dependency
tree, it is possible to perform version selection and know the final
size on disk, without doing any fetching whatsoever. This prevents
wasted bandwidth since package versions not selected do not need to be
fetched.
2025-02-26 11:42:03 -08:00
..
compiler build: add spirv to test matrix 2025-02-24 19:12:38 +01:00
compiler_rt compiler-rt: Add tests from llvm/llvm-project#119449. 2025-02-25 19:31:00 +01:00
docs zig build fmt 2025-02-22 17:09:20 -08:00
fuzzer/web Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
include zig cc: Remove headers related to GPU offload. 2024-12-16 04:36:57 +01:00
init introduce package id and redo hash format again 2025-02-26 11:42:03 -08:00
libc Merge pull request #22999 from alexrp/mingw-update 2025-02-25 12:54:55 +01:00
libcxx libcxx: Update to LLVM 19.1.0. 2024-09-19 18:20:22 -07:00
libcxxabi libcxxabi: Update to LLVM 19. 2024-09-19 18:20:21 -07:00
libunwind libunwind: Fix compilation for the x32 ABI. 2024-11-18 17:43:54 +01:00
std std.ArrayList: delete unit test 2025-02-26 11:42:03 -08:00
tsan tsan: Update to LLVM 19.1.0. 2024-09-24 23:58:21 -07:00
c.zig c: Include Os.Tag.other in the list of freestanding OSs. 2024-11-08 14:56:55 +01:00
compiler_rt.zig x86_64: rewrite scalar and vector int @divTrunc 2025-02-15 03:45:21 -05:00
fuzzer.zig fix -fsanitize-coverage-trace-pc-guard and fuzzer support for C compile units 2025-02-21 06:06:26 +01:00
ubsan_rt.zig ubsan: update wording 2025-02-25 11:22:33 -08:00
zig.h cbe: Implement support for -fno-builtin and @disableIntrinsics(). 2025-02-23 04:08:58 +01:00