diff --git a/.circleci/config.yml b/.circleci/config.yml index fbdc52c0..3114194f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,6 +95,14 @@ commands: key: wasi-libc-sysroot-systemclang-v6 paths: - lib/wasi-libc/sysroot + - when: + condition: <> + steps: + - run: + # Do this before gen-device so that it doesn't check the + # formatting of generated files. + name: Check Go code formatting + command: make fmt-check - run: make gen-device -j4 - run: make smoketest XTENSA=0 - save_cache: @@ -102,12 +110,6 @@ commands: paths: - ~/.cache/go-build - /go/pkg/mod - - when: - condition: <> - steps: - - run: - name: Check Go code formatting - command: make fmt-check jobs: test-llvm13-go116: diff --git a/Makefile b/Makefile index f2d0bf92..a98fec6a 100644 --- a/Makefile +++ b/Makefile @@ -150,7 +150,7 @@ endif clean: @rm -rf build -FMT_PATHS = ./*.go builder cgo compiler interp loader src/device/arm src/examples src/machine src/os src/reflect src/runtime src/sync src/syscall src/testing src/internal/reflectlite transform +FMT_PATHS = ./*.go builder cgo/*.go compiler interp loader src transform fmt: @gofmt -l -w $(FMT_PATHS) fmt-check: diff --git a/src/crypto/rand/rand_arc4random.go b/src/crypto/rand/rand_arc4random.go index 9d28e63f..8bfcbe87 100644 --- a/src/crypto/rand/rand_arc4random.go +++ b/src/crypto/rand/rand_arc4random.go @@ -1,3 +1,4 @@ +//go:build darwin || tinygo.wasm // +build darwin tinygo.wasm // This implementation of crypto/rand uses the arc4random_buf function diff --git a/src/crypto/rand/rand_urandom.go b/src/crypto/rand/rand_urandom.go index 64388de7..78d1a9e9 100644 --- a/src/crypto/rand/rand_urandom.go +++ b/src/crypto/rand/rand_urandom.go @@ -1,3 +1,4 @@ +//go:build linux && !baremetal && !wasi // +build linux,!baremetal,!wasi // This implementation of crypto/rand uses the /dev/urandom pseudo-file to diff --git a/src/device/nxp/mimxrt1062_mpu.go b/src/device/nxp/mimxrt1062_mpu.go index 9f3b5a20..91c867db 100644 --- a/src/device/nxp/mimxrt1062_mpu.go +++ b/src/device/nxp/mimxrt1062_mpu.go @@ -193,12 +193,12 @@ func enableIcache(enable bool) { arm.Asm("dsb 0xF") arm.Asm("isb 0xF") } else { - arm.Asm("dsb 0xF") - arm.Asm("isb 0xF") + arm.Asm("dsb 0xF") + arm.Asm("isb 0xF") SystemControl.CCR.ClearBits(SCB_CCR_IC_Msk) SystemControl.ICIALLU.Set(0) - arm.Asm("dsb 0xF") - arm.Asm("isb 0xF") + arm.Asm("dsb 0xF") + arm.Asm("isb 0xF") } } } diff --git a/src/internal/fuzz/fuzz.go b/src/internal/fuzz/fuzz.go index ee6e0544..cd525076 100644 --- a/src/internal/fuzz/fuzz.go +++ b/src/internal/fuzz/fuzz.go @@ -115,7 +115,7 @@ func CheckCorpus(vals []any, types []reflect.Type) error { return errors.New("not implemented") } -func ResetCoverage() {} +func ResetCoverage() {} func SnapshotCoverage() {} // RunFuzzWorker is called in a worker process to communicate with the diff --git a/src/internal/task/task_none.go b/src/internal/task/task_none.go index 40420f02..19dbee62 100644 --- a/src/internal/task/task_none.go +++ b/src/internal/task/task_none.go @@ -1,3 +1,4 @@ +//go:build scheduler.none // +build scheduler.none package task diff --git a/src/internal/task/task_stack_386.go b/src/internal/task/task_stack_386.go index c0f06659..10744757 100644 --- a/src/internal/task/task_stack_386.go +++ b/src/internal/task/task_stack_386.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && 386 // +build scheduler.tasks,386 package task diff --git a/src/internal/task/task_stack_amd64.go b/src/internal/task/task_stack_amd64.go index f8d55781..b3918931 100644 --- a/src/internal/task/task_stack_amd64.go +++ b/src/internal/task/task_stack_amd64.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && amd64 && !windows // +build scheduler.tasks,amd64,!windows package task diff --git a/src/internal/task/task_stack_amd64_windows.go b/src/internal/task/task_stack_amd64_windows.go index e5ee47eb..41ddbe6c 100644 --- a/src/internal/task/task_stack_amd64_windows.go +++ b/src/internal/task/task_stack_amd64_windows.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && amd64 && windows // +build scheduler.tasks,amd64,windows package task diff --git a/src/internal/task/task_stack_arm.go b/src/internal/task/task_stack_arm.go index 5934f028..18982e87 100644 --- a/src/internal/task/task_stack_arm.go +++ b/src/internal/task/task_stack_arm.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && arm && !cortexm && !avr && !xtensa && !tinygo.riscv // +build scheduler.tasks,arm,!cortexm,!avr,!xtensa,!tinygo.riscv package task diff --git a/src/internal/task/task_stack_arm64.go b/src/internal/task/task_stack_arm64.go index d65c30c4..e4fd09b2 100644 --- a/src/internal/task/task_stack_arm64.go +++ b/src/internal/task/task_stack_arm64.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && arm64 // +build scheduler.tasks,arm64 package task diff --git a/src/internal/task/task_stack_avr.go b/src/internal/task/task_stack_avr.go index 655280ac..96b7034d 100644 --- a/src/internal/task/task_stack_avr.go +++ b/src/internal/task/task_stack_avr.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && avr // +build scheduler.tasks,avr package task diff --git a/src/internal/task/task_stack_cortexm.go b/src/internal/task/task_stack_cortexm.go index 1d996979..f6168880 100644 --- a/src/internal/task/task_stack_cortexm.go +++ b/src/internal/task/task_stack_cortexm.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && cortexm // +build scheduler.tasks,cortexm package task diff --git a/src/internal/task/task_stack_esp32.go b/src/internal/task/task_stack_esp32.go index ee1046b0..a7668844 100644 --- a/src/internal/task/task_stack_esp32.go +++ b/src/internal/task/task_stack_esp32.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && esp32 // +build scheduler.tasks,esp32 package task diff --git a/src/internal/task/task_stack_esp8266.go b/src/internal/task/task_stack_esp8266.go index 5c9442f5..4a01a6ff 100644 --- a/src/internal/task/task_stack_esp8266.go +++ b/src/internal/task/task_stack_esp8266.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && esp8266 // +build scheduler.tasks,esp8266 package task diff --git a/src/internal/task/task_stack_tinygoriscv.go b/src/internal/task/task_stack_tinygoriscv.go index 6f20eebf..36ef742e 100644 --- a/src/internal/task/task_stack_tinygoriscv.go +++ b/src/internal/task/task_stack_tinygoriscv.go @@ -1,3 +1,4 @@ +//go:build scheduler.tasks && tinygo.riscv // +build scheduler.tasks,tinygo.riscv package task diff --git a/src/net/interface_tinygo.go b/src/net/interface_tinygo.go index fbf7ee98..30eea3f4 100644 --- a/src/net/interface_tinygo.go +++ b/src/net/interface_tinygo.go @@ -1,3 +1,4 @@ +//go:build tinygo // +build tinygo package net