aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cmd/mbf/main.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go
index 372c0acd..5904d9df 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()