1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: MIT OR Apache-2.0
// Copyright (c) 2026 Noyalib. All rights reserved.
//! Build script: detect whether `rustc` is a nightly toolchain and
//! expose that as a `cfg(noyalib_nightly)` flag for the rest of
//! the crate. Used to gate `nightly-simd` so a user passing
//! `--all-features` on stable does not get a hard compile error
//! from the unstable `feature(portable_simd)` attribute.
//!
//! # Contract
//!
//! A build script runs on the machine of anyone who compiles this
//! crate, before any of its code does, with the full privileges of the
//! build. That makes it a supply-chain surface in its own right, so
//! what this one may do is stated rather than left to inspection.
//!
//! It **does**:
//!
//! - declare two `cfg` names via `cargo:rustc-check-cfg`;
//! - run `$RUSTC --version` and read its stdout, to detect nightly;
//! - read the `NOYALIB_COVERAGE` environment variable.
//!
//! It **must never**:
//!
//! - access the network;
//! - read or write any file, inside the source tree or outside it;
//! - generate code, or emit anything that ends up compiled;
//! - depend on another crate — it has no `[build-dependencies]`, and
//! adding one should be treated as a change worth reviewing on its
//! own.
//!
//! `ci.yml` asserts the network/filesystem half of that by grepping
//! this file; if the assertion and this comment ever disagree, the
//! assertion wins and one of them is a bug.