Skip to content

Commit 171dda4

Browse files
committed
[DO NOT MERGE] testing Windows CI failures
1 parent f9f439a commit 171dda4

File tree

7 files changed

+34
-8
lines changed

7 files changed

+34
-8
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
@@ -125,6 +127,8 @@ jobs:
125127
matrix:
126128
version: [16, 17, 18]
127129
steps:
130+
- name: exit early
131+
run: command-does-not-exist
128132
- name: Set up Homebrew
129133
uses: Homebrew/actions/setup-homebrew@master
130134
- name: Fix Python symlinks

.github/workflows/linux.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
container:
2121
image: golang:1.23-alpine
2222
steps:
23+
- name: exit early
24+
run: command-does-not-exist
2325
- name: Install apk dependencies
2426
# tar: needed for actions/cache@v4
2527
# git+openssh: needed for checkout (I think?)
@@ -166,6 +168,8 @@ jobs:
166168
# potential bugs.
167169
runs-on: ubuntu-latest
168170
steps:
171+
- name: exit early
172+
run: command-does-not-exist
169173
- name: Checkout
170174
uses: actions/checkout@v4
171175
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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ jobs:
3030
scoop install ninja binaryen
3131
- name: Checkout
3232
uses: actions/checkout@v4
33-
with:
34-
submodules: true
33+
#with:
34+
# submodules: true
35+
- name: submodules
36+
shell: bash
37+
run: git submodule update --init lib/mingw-w64
3538
- name: Install Go
3639
uses: actions/setup-go@v5
3740
with:
@@ -85,6 +88,11 @@ jobs:
8588
with:
8689
key: ${{ steps.cache-llvm-build.outputs.cache-primary-key }}
8790
path: llvm-build
91+
- name: Test TinyGo
92+
shell: bash
93+
run: make test GOTESTFLAGS="-short -run=TestBuild"
94+
- name: exit
95+
run: command-does-not-exist
8896
- name: Cache wasi-libc sysroot
8997
uses: actions/cache@v4
9098
id: cache-wasi-libc
@@ -99,9 +107,6 @@ jobs:
99107
scoop install [email protected]
100108
- name: make gen-device
101109
run: make -j3 gen-device
102-
- name: Test TinyGo
103-
shell: bash
104-
run: make test GOTESTFLAGS="-short"
105110
- name: Build TinyGo release tarball
106111
shell: bash
107112
run: make build/release -j4

main_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,14 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c
421421
// Build the test binary.
422422
stdout := &bytes.Buffer{}
423423
_, err = buildAndRun(pkgName, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error {
424-
return cmd.Run()
424+
t.Log("command:", cmd)
425+
err := cmd.Run()
426+
if err == nil {
427+
t.Log(" error is nil!")
428+
} else {
429+
t.Log(" error:", err)
430+
}
431+
return err
425432
})
426433
if err != nil {
427434
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)