the idea is to have testonly-esque checks
consider a project where we want to partition content (for an existing rule) into three categories:
- "open-source"; a.k.a.
oss - "proprietary"; a.k.a.
prp - "development-only"; a.k.a.
dev
the idea is to have testonly-esque checks
consider a project where we want to partition content (for an existing rule) into three categories:
ossprpdev| //! for a given `N`, how many unique shapes of `N` contiguous minos (all connected via at least one | |
| //! of the four cardinal directions) are possible? | |
| //! | |
| //! a shape is unique if no translation or rotation of a shape makes it the same as another shape | |
| use std::{collections::HashSet, fmt}; | |
| #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | |
| struct Coord<const N: usize> { | |
| x: u8, // 0 <= x < N |
see https://www.gnu.org/software/make/manual/html_node/General-Search.html
from the perspective of a recipe (i.e. automatic variables), prerequisites are "rewritten"; if they're resolved to a directory in VPATH, the prereq is prefixed with that directory
see here for .section directive flags and _type_s
https://c.godbolt.org/z/T4j9GP91n https://assembly.godbolt.org/z/TGnGMWWWd
i.e.:
see:
semantics of order-only deps:
see comment in Makefile
| #!/usr/bin/env bash | |
| a='#![feature(no_core)] #![no_std] #![no_core]' | |
| b="${a} " # same as above, with two spaces | |
| build_rmeta() { ./build/host/stage1/bin/rustc - <<< "$1" --crate-type lib --emit metadata -o "$2"; } | |
| dump_rmeta() { ./build/*-*/stage1/bin/rustc -Zls=byte_dump "$1"; } | |
| for n in a b; do | |
| build_rmeta "${!n}" $n.rmeta |
tests the we can "project" particular files out of a TreeArtifact for consumption in downstream rules
the intent is that by doing this projection:
TreeArtifact aware) can consume our artifactTreeArtifact that are projected out| 0: [.] succ(a, ): add `1` to `a` | |
| 1: [+] add(a, b): ret = a; ret = succ(ret) `b` times | |
| 2: [*] mul(a, b): ret = 0; ret = add(ret, a) `b` times | |
| 3: [^] exp(a, b): ret = 1; ret = mul(ret, a) `b` times | |
| 4: [!] tetration(a, b): ret = a; ret = exp(ret, a) `b - 1` times (special case b = 0 -> 1) | |
| 5: [@] pentation(a, b): ret = a; ret = tetration(ret, a) `b - 1` times (special case b = 0 -> 1) | |
| 6: [#] hexation(a, b): ret = a; ret = pentation(ret, a) `b - 1` times (special case b = 0 -> 1) | |
| 3 . -> 4 | |
| 3 + 4 -> 7 { ((((3 . ) . ) . ) . ) } |
| use std::{ | |
| cell::UnsafeCell, | |
| marker::PhantomData, | |
| sync::{ | |
| OnceLock, | |
| mpsc::{Receiver, Sender, channel}, | |
| }, | |
| }; | |
| // initialized from thread that can call ui stuff |