Skip to content

Commit 525413b

Browse files
committed
[DO NOT MERGE] testing Windows CI failures
1 parent d51ef25 commit 525413b

File tree

8 files changed

+46
-11
lines changed

8 files changed

+46
-11
lines changed

.github/workflows/build-macos.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
goarch: arm64
2727
runs-on: ${{ matrix.os }}
2828
steps:
29+
- name: exit early
30+
run: command-does-not-exist
2931
- name: Install Dependencies
3032
run: |
3133
HOMEBREW_NO_AUTO_UPDATE=1 brew install qemu binaryen
@@ -128,6 +130,8 @@ jobs:
128130
matrix:
129131
version: [16, 17, 18]
130132
steps:
133+
- name: exit early
134+
run: command-does-not-exist
131135
- name: Set up Homebrew
132136
uses: Homebrew/actions/setup-homebrew@master
133137
- name: Fix Python symlinks

.github/workflows/linux.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
outputs:
2323
version: ${{ steps.version.outputs.version }}
2424
steps:
25+
- name: exit early
26+
run: command-does-not-exist
2527
- name: Install apk dependencies
2628
# tar: needed for actions/cache@v4
2729
# git+openssh: needed for checkout (I think?)
@@ -171,6 +173,8 @@ jobs:
171173
# potential bugs.
172174
runs-on: ubuntu-latest
173175
steps:
176+
- name: exit early
177+
run: command-does-not-exist
174178
- name: Checkout
175179
uses: actions/checkout@v4
176180
with:

.github/workflows/nix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
nix-test:
1616
runs-on: ubuntu-latest
1717
steps:
18+
- name: exit early
19+
run: command-does-not-exist
1820
- name: Uninstall system LLVM
1921
# Hack to work around issue where we still include system headers for
2022
# some reason.

.github/workflows/sizediff.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
permissions:
1616
pull-requests: write
1717
steps:
18+
- name: exit early
19+
run: command-does-not-exist
1820
# Prepare, install tools
1921
- name: Add GOBIN to $PATH
2022
run: |

.github/workflows/windows.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ jobs:
3232
scoop install ninja binaryen
3333
- name: Checkout
3434
uses: actions/checkout@v4
35-
with:
36-
submodules: true
35+
- name: submodules
36+
shell: bash
37+
run: git submodule update --init lib/mingw-w64
3738
- name: Extract TinyGo version
3839
id: version
3940
shell: bash
@@ -91,6 +92,11 @@ jobs:
9192
with:
9293
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
9394
path: llvm-build
95+
- name: Test TinyGo
96+
shell: bash
97+
run: make test GOTESTFLAGS="-short -run=TestBuild -v"
98+
- name: exit
99+
run: command-does-not-exist
94100
- name: Cache wasi-libc sysroot
95101
uses: actions/cache@v4
96102
id: cache-wasi-libc
@@ -105,9 +111,6 @@ jobs:
105111
scoop install [email protected]
106112
- name: make gen-device
107113
run: make -j3 gen-device
108-
- name: Test TinyGo
109-
shell: bash
110-
run: make test GOTESTFLAGS="-short"
111114
- name: Build TinyGo release tarball
112115
shell: bash
113116
run: make build/release -j4

GNUmakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ gen-device: gen-device-stm32
191191
endif
192192

193193
gen-device-avr:
194-
@if [ ! -e lib/avr/README.md ]; then echo "Submodules have not been downloaded. Please download them using:\n git submodule update --init"; exit 1; fi
194+
#@if [ ! -e lib/avr/README.md ]; then echo "Submodules have not been downloaded. Please download them using:\n git submodule update --init"; exit 1; fi
195195
$(GO) build -o ./build/gen-device-avr ./tools/gen-device-avr/
196196
./build/gen-device-avr lib/avr/packs/atmega src/device/avr/
197197
./build/gen-device-avr lib/avr/packs/tiny src/device/avr/
@@ -263,7 +263,7 @@ endif
263263
.PHONY: wasi-libc
264264
wasi-libc: lib/wasi-libc/sysroot/lib/wasm32-wasi/libc.a
265265
lib/wasi-libc/sysroot/lib/wasm32-wasi/libc.a:
266-
@if [ ! -e lib/wasi-libc/Makefile ]; then echo "Submodules have not been downloaded. Please download them using:\n git submodule update --init"; exit 1; fi
266+
#@if [ ! -e lib/wasi-libc/Makefile ]; then echo "Submodules have not been downloaded. Please download them using:\n git submodule update --init"; exit 1; fi
267267
cd lib/wasi-libc && $(MAKE) -j4 EXTRA_CFLAGS="-O2 -g -DNDEBUG -mnontrapping-fptoint -msign-ext" MALLOC_IMPL=none CC="$(CLANG)" AR=$(LLVM_AR) NM=$(LLVM_NM)
268268

269269
# Generate WASI syscall bindings

main_test.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"bufio"
88
"bytes"
99
"context"
10+
"crypto/sha256"
1011
"errors"
1112
"flag"
1213
"io"
@@ -117,8 +118,11 @@ func TestBuild(t *testing.T) {
117118

118119
t.Run("Host", func(t *testing.T) {
119120
t.Parallel()
120-
runPlatTests(optionsFromTarget("", sema), tests, t)
121+
for i := 0; i < 100; i++ {
122+
runPlatTests(optionsFromTarget("", sema), []string{"alias.go"}, t)
123+
}
121124
})
125+
return
122126

123127
// Test a few build options.
124128
t.Run("build-options", func(t *testing.T) {
@@ -422,7 +426,21 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c
422426
// Build the test binary.
423427
stdout := &bytes.Buffer{}
424428
_, err = buildAndRun(pkgName, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error {
425-
return cmd.Run()
429+
data, err := os.ReadFile(result.Executable)
430+
if err != nil {
431+
t.Fatal("failed to read executable:", err)
432+
}
433+
hash := sha256.Sum256(data)
434+
t.Logf("executable hash and size: %d %x", len(data), hash)
435+
436+
t.Log("command:", cmd)
437+
err = cmd.Run()
438+
if err == nil {
439+
t.Log(" error is nil!")
440+
} else {
441+
t.Log(" error:", err)
442+
}
443+
return err
426444
})
427445
if err != nil {
428446
w := &bytes.Buffer{}

src/runtime/runtime_windows.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func mainCRTStartup() int {
5353
runMain()
5454

5555
// For libc compatibility.
56-
return 0
56+
return 33
5757
}
5858

5959
// Must be a separate function to get the correct stack pointer.
@@ -92,7 +92,9 @@ func os_runtime_args() []string {
9292
}
9393

9494
func putchar(c byte) {
95-
libc_putchar(int(c))
95+
if libc_putchar(int(c)) != 0 {
96+
libc_exit(42)
97+
}
9698
}
9799

98100
var heapSize uintptr = 128 * 1024 // small amount to start

0 commit comments

Comments
 (0)