Skip to content

Commit a766aca

Browse files
committed
add NoCompatibility option
Signed-off-by: sivchari <shibuuuu5@gmail.com>
1 parent 9be956f commit a766aca

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

builder/config.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
3333
if err != nil {
3434
return nil, err
3535
}
36-
if gorootMajor != 1 || gorootMinor < minorMin || gorootMinor > minorMax {
37-
// Note: when this gets updated, also update the Go compatibility matrix:
38-
// https://github.com/tinygo-org/tinygo-site/blob/dev/content/docs/reference/go-compat-matrix.md
39-
return nil, fmt.Errorf("requires go version 1.%d through 1.%d, got go%d.%d", minorMin, minorMax, gorootMajor, gorootMinor)
36+
37+
if !options.NoCompatibility {
38+
if gorootMajor != 1 || gorootMinor < minorMin || gorootMinor > minorMax {
39+
// Note: when this gets updated, also update the Go compatibility matrix:
40+
// https://github.com/tinygo-org/tinygo-site/blob/dev/content/docs/reference/go-compat-matrix.md
41+
return nil, fmt.Errorf("requires go version 1.%d through 1.%d, got go%d.%d", minorMin, minorMax, gorootMajor, gorootMinor)
42+
}
4043
}
4144

4245
// Check that the Go toolchain version isn't too new, if we haven't been

compileopts/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type Options struct {
5959
WITPackage string // pass through to wasm-tools component embed invocation
6060
WITWorld string // pass through to wasm-tools component embed -w option
6161
ExtLDFlags []string
62+
NoCompatibility bool // disable go version compatibility check
6263
}
6364

6465
// Verify performs a validation on the given options, raising an error if options are not valid.

0 commit comments

Comments
 (0)