Skip to content

Commit eb7071b

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

File tree

8 files changed

+66
-26
lines changed

8 files changed

+66
-26
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: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,27 @@ jobs:
2323
minimum-size: 8GB
2424
maximum-size: 24GB
2525
disk-root: "C:"
26-
- uses: brechtm/setup-scoop@v2
27-
with:
28-
scoop_update: 'false'
29-
- name: Install Dependencies
30-
shell: bash
31-
run: |
32-
scoop install ninja binaryen
26+
#- uses: brechtm/setup-scoop@v2
27+
# with:
28+
# scoop_update: 'false'
29+
#- name: Install Dependencies
30+
# shell: bash
31+
# run: |
32+
# 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
4041
run: ./.github/workflows/tinygo-extract-version.sh | tee -a "$GITHUB_OUTPUT"
41-
- name: Install Go
42-
uses: actions/setup-go@v5
43-
with:
44-
go-version: '1.23'
45-
cache: true
42+
#- name: Install Go
43+
# uses: actions/setup-go@v5
44+
# with:
45+
# go-version: '1.23'
46+
# cache: true
4647
- name: Restore cached LLVM source
4748
uses: actions/cache/restore@v4
4849
id: cache-llvm-source
@@ -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: 4 additions & 4 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
@@ -292,8 +292,8 @@ endif
292292
tinygo: ## Build the TinyGo compiler
293293
@if [ ! -f "$(LLVM_BUILDDIR)/bin/llvm-config" ]; then echo "Fetch and build LLVM first by running:"; echo " $(MAKE) llvm-source"; echo " $(MAKE) $(LLVM_BUILDDIR)"; exit 1; fi
294294
CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOENVFLAGS) $(GO) build -buildmode exe -o build/tinygo$(EXE) -tags "byollvm osusergo" .
295-
test: wasi-libc check-nodejs-version
296-
CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test $(GOTESTFLAGS) -timeout=1h -buildmode exe -tags "byollvm osusergo" $(GOTESTPKGS)
295+
test: #wasi-libc check-nodejs-version
296+
CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test $(GOTESTFLAGS) -timeout=1h -buildmode exe -tags "byollvm osusergo" .
297297

298298
# Standard library packages that pass tests on darwin, linux, wasi, and windows, but take over a minute in wasi
299299
TEST_PACKAGES_SLOW = \

main_test.go

Lines changed: 26 additions & 3 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"
@@ -16,6 +17,7 @@ import (
1617
"regexp"
1718
"runtime"
1819
"slices"
20+
"strconv"
1921
"strings"
2022
"sync"
2123
"testing"
@@ -115,10 +117,17 @@ func TestBuild(t *testing.T) {
115117
return
116118
}
117119

118-
t.Run("Host", func(t *testing.T) {
120+
t.Run("Debugging", func(t *testing.T) {
119121
t.Parallel()
120-
runPlatTests(optionsFromTarget("", sema), tests, t)
122+
for i := 0; i < 100; i++ {
123+
options := optionsFromTarget("", sema)
124+
t.Run(strconv.Itoa(i), func(t *testing.T) {
125+
t.Parallel()
126+
runTest("alias.go", options, t, nil, nil)
127+
})
128+
}
121129
})
130+
return
122131

123132
// Test a few build options.
124133
t.Run("build-options", func(t *testing.T) {
@@ -422,7 +431,21 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c
422431
// Build the test binary.
423432
stdout := &bytes.Buffer{}
424433
_, err = buildAndRun(pkgName, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error {
425-
return cmd.Run()
434+
data, err := os.ReadFile(result.Executable)
435+
if err != nil {
436+
t.Fatal("failed to read executable:", err)
437+
}
438+
hash := sha256.Sum256(data)
439+
t.Logf("executable hash and size: %d %x", len(data), hash)
440+
441+
t.Log("command:", cmd)
442+
err = cmd.Run()
443+
if err == nil {
444+
t.Log(" error is nil!")
445+
} else {
446+
t.Log(" error:", err)
447+
}
448+
return err
426449
})
427450
if err != nil {
428451
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)