Dependency and build state is kept inside .redo subdirectory in each directory related the build. Each corresponding target has its own, recreated with every rebuild, binary .dep file.
It starts with the header:
"GOREDO" || 0x01 || BuildUUID
0x01
is format’s version number. BuildUUID
is 128-bit UUID.
After the header comes concatenation of length-prefixed chunks. Length is the length of the whole chunk, including the size of the encoded length itself. It is 16-bit big-endian integer. After the length comes single byte type of the chunk:
LEN || 0x01 || target
target
is UTF-8 encoded target’s name.
LEN || 0x02 || size || inodeNum || ctimeSec || ctimeNsec || mtimeSec || mtimeNsec || hash || target
target
is UTF-8 encoded target’s name.
hash
is 256-bit BLAKE3 hash.
All other inode-related fields are 64-bit big-endian integers.
LEN || 0x03
LEN || 0x04 || hash
hash
is 256-bit BLAKE3 hash.
LEN || 0x05 || target
target
is UTF-8 encoded target’s name.
That .dep file can be converted to human-readable recfile format. For example:
Build: 80143f04-bfff-4673-950c-081d712f573d Type: ifcreate Target: foo.o.do Type: ifchange Target: default.o.do Size: 123 InodeNum: 2345 CtimeSec: 1605721341 CtimeNsec: 253305000 MtimeSec: 1645606823 MtimeNsec: 369936700 Hash: f4929732f96f11e6d4ebe94536b5edef426d00ed0146853e37a87f4295e18eda Type: always Type: stamp Hash: 5bbdf635932cb16b9127e69b6f3872577efed338f0a4ab6f2c7ca3df6ce50cc9
And its schema definition:
%rec: Build %doc: Build session %key: Build %type: Build uuid %rec: Dependency %doc: Dependency information %mandatory: Type %allowed: Target Size InodeNum CtimeSec CtimeNsec MtimeSec MtimeNsec Hash %unique: Type Target Size InodeNum CtimeSec CtimeNsec MtimeSec MtimeNsec Hash %type: Type enum ifcreate ifchange always stamp %type: Size int %type: InodeNum int %type: CtimeSec int %type: CtimeNsec int %type: MtimeSec int %type: MtimeNsec int %type: Hash regexp /[0-9a-f]{64}/