From 1c49c75f95855a6b75689f1962dc918ed67c2ccc Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 19 Jan 2026 04:40:44 +0900 Subject: [PATCH] cmd/mbf: toolchain 3-stage non-determinism check This unfortunately fails right now. Requires further investigation. Signed-off-by: Ophestra --- cmd/mbf/main.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 372c0ac..5904d9d 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -15,6 +15,7 @@ import ( "hakurei.app/container" "hakurei.app/container/check" "hakurei.app/internal/pkg" + "hakurei.app/internal/rosa" "hakurei.app/message" ) @@ -104,6 +105,36 @@ func main() { ) } + c.NewCommand( + "stage3", + "Check for toolchain 3-stage non-determinism", + func(args []string) (err error) { + _, _, _, stage2 := (rosa.Std - 1).NewLLVM() + _, _, _, stage3 := rosa.Std.NewLLVM() + var ( + pathname *check.Absolute + checksum [2]pkg.Checksum + ) + + if pathname, checksum[0], err = cache.Cure(stage2); err != nil { + return err + } + log.Println("stage2:", pathname) + if pathname, checksum[1], err = cache.Cure(stage3); err != nil { + return err + } + log.Println("stage3:", pathname) + + if checksum[0] != checksum[1] { + err = &pkg.ChecksumMismatchError{ + Got: checksum[0], + Want: checksum[1], + } + } + return + }, + ) + c.MustParse(os.Args[1:], func(err error) { if cache != nil { cache.Close()