-
Notifications
You must be signed in to change notification settings - Fork 951
all: add Go 1.24 support #4732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: add Go 1.24 support #4732
Conversation
Looks like the official image for Go 1.24 is not yet available on https://hub.docker.com/_/golang/tags |
Yeah you're right, I hope they add it in a day or so. |
Perhaps we can use the 1.24rc3 one for now? |
Size difference with the dev branch: Binary size differenceflash ram before after diff before after diff 16656 16656 0 0.00% 4180 4180 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/adafruit4650 61472 61472 0 0.00% 6188 6188 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go 9604 9604 0 0.00% 4748 4748 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go 13584 13584 0 0.00% 6788 6788 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx 8824 8824 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go 11848 11848 0 0.00% 6580 6580 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go 9920 9920 0 0.00% 4760 4760 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go 8376 8376 0 0.00% 2320 2320 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go 8164 8164 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go 7468 7468 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go 70692 70692 0 0.00% 3656 3656 0 0.00% tinygo build -size short -o ./build/test.hex -target=pinetime ./examples/bma42x/main.go 63988 63988 0 0.00% 6196 6196 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go 27804 27804 0 0.00% 4780 4780 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go 64048 64048 0 0.00% 6228 6228 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go 12248 12248 0 0.00% 4812 4812 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bmp388/main.go 8364 8364 0 0.00% 3352 3352 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/sram/main.go 22300 22300 0 0.00% 3556 3556 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go 69720 69720 0 0.00% 6376 6376 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/main.go 4628 4628 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go 69980 69980 0 0.00% 6980 6980 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi 66724 66724 0 0.00% 9020 9020 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi 7232 7232 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go 67668 67668 0 0.00% 6360 6360 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go 68220 68220 0 0.00% 6504 6504 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go 8012 8012 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go 5840 5840 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go 5792 5792 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go 10568 10568 0 0.00% 4748 4748 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go 14748 14748 0 0.00% 6580 6580 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go 16160 16160 0 0.00% 2360 2360 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go 10276 10276 0 0.00% 6924 6924 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic 10784 10784 0 0.00% 4876 4876 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic 29644 29644 0 0.00% 38084 38084 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing 10300 10300 0 0.00% 6916 6916 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll 10872 10872 0 0.00% 4868 4868 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll 263492 263492 0 0.00% 46752 46752 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow 11772 11772 0 0.00% 4780 4780 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go 14112 14112 0 0.00% 6580 6580 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go 26500 26500 0 0.00% 2328 2328 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go 12484 12484 0 0.00% 4788 4788 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go 10760 10760 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go 9940 9940 0 0.00% 4780 4780 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go 10380 10380 0 0.00% 4788 4788 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go 9924 9924 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go 68600 68600 0 0.00% 6196 6196 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go 8276 8276 0 0.00% 4748 4748 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go 8184 8184 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go 75472 75472 0 0.00% 7448 7448 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go 12236 12236 0 0.00% 3360 3360 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go 6236 6236 0 0.00% 3288 3288 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go 5264 5264 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go 10528 10528 0 0.00% 3336 3336 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/seesaw 2841 2841 0 0.00% 558 558 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo 13752 13752 0 0.00% 3408 3408 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/sgp30 8212 8212 0 0.00% 6788 6788 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go 57480 57480 0 0.00% 3688 3688 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go 57448 57448 0 0.00% 3696 3696 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go 57444 57444 0 0.00% 3688 3688 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go 6704 6704 0 0.00% 2288 2288 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1306/i2c_128x32/main.go 6152 6152 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1306/spi_128x64/main.go 5844 5844 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go 6764 6764 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go 6692 6692 0 0.00% 2280 2280 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go 17544 17544 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go 10712 10712 0 0.00% 4540 4540 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone 10208 10208 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go 10820 10820 0 0.00% 3348 3348 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/touch/capacitive 9648 9648 0 0.00% 6788 6788 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go 12548 12548 0 0.00% 6984 6984 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go 15372 15372 0 0.00% 4748 4748 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go 13852 13852 0 0.00% 4748 4748 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go 24708 24708 0 0.00% 13720 13720 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go 6488 6488 0 0.00% 2320 2320 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go 6152 6152 0 0.00% 2312 2312 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go 6400 6400 0 0.00% 2320 2320 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go 26044 26044 0 0.00% 16420 16420 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/waveshare-epd/epd2in66b/main.go 6988 6988 0 0.00% 4780 4780 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812 5768 5768 0 0.00% 9522 9522 0 0.00% '-xesppie' is not a recognized feature for this target (ignoring feature) 62744 62744 0 0.00% 5948 5948 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go 1581 1581 0 0.00% 598 598 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812 1056 1056 0 0.00% 180 180 0 0.00% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812 32256 32256 0 0.00% 4780 4780 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go 27128 27152 24 0.09% 3640 3640 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go 26992 27016 24 0.09% 5620 5620 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go 2041030 2041078 48 0.00% 472522 472522 0 0.00% |
A very good idea. |
FWIW, it looks like the official |
I'm investigating a weird CGo problem now. |
The CGo regression is a result of this commit: golang/go@5bd442a |
Filed an upstream bug: golang/go#71777 |
Added a workaround for the CGo issue. This will regress our nice CGo error messages, but I don't see a good alternative. Previous error message:
Error message with the workaround:
|
f3fa0be
to
58e94f9
Compare
# Assume this will go away before Go2, so only check minor version. | ||
ifeq ($(filter $(shell $(GO) env GOVERSION | cut -f 2 -d.), 16 17 18), ) | ||
TEST_PACKAGES_FAST += crypto/internal/nistec/fiat | ||
else | ||
TEST_PACKAGES_FAST += crypto/elliptic/internal/fiat | ||
endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed these, since they're an internal package and the name keeps changing. In Go 1.24, the name seems to have changed to crypto/internal/fips140/nistec/fiat.
# text/template
/usr/local/go/src/text/template/exec.go:405:22: val.Seq undefined (type reflect.Value has no field or method Seq)
/usr/local/go/src/text/template/exec.go:454:17: val.Type().CanSeq undefined (type reflect.Type has no field or method CanSeq)
/usr/local/go/src/text/template/exec.go:460:23: val.Seq undefined (type reflect.Value has no field or method Seq)
/usr/local/go/src/text/template/exec.go:471:17: val.Type().CanSeq2 undefined (type reflect.Type has no field or method CanSeq2)
/usr/local/go/src/text/template/exec.go:473:26: val.Seq2 undefined (type reflect.Value has no field or method Seq2) I can peek at this. |
Fixed two issues (I hope), now one that looks scary:
|
Perhaps the "important" part of the error is this?
That function is defined here: How does |
@deadprogram it's not, that's a separate issue. I just tracked it down to an interp bug (that I think I have a fix for). |
See: #4742 |
I think #4736 is broken, perhaps it would be best to revert this PR for now? |
Broken on Go 1.24 I assume you mean? It passed all of the CI tests at the time, which was part of why I merged it. |
I can confirm that https://cs.opensource.google/go/go/+/5e82cba9bdf45d81da549477d172f6b5e23106d4 is what is triggering the Windows test failures. Looking deeper now into the root cause. |
Broken in general (not just 1.24). I tried a trivial example, and it crashed. See my comments on that PR. |
I removed the os/user test since it's not currently working (looks like they added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, that was not easy! Great work all around on this one.
@aykevl can you resolve merge conflict since I merged the revert into dev? I probably should have done it in the opposite order, oh well. |
This mangles CGo identifier names to something like "_Cgo_foo" instead of using literal identifiers like "C.foo". This works around golang/go#71777. I don't like this solution, but I hope we'll find a better solution in the future. In that case we can revert this commit.
This also moves flash padding code to a single place, since it was copied 5 times. This change is necessary in Go 1.24 to avoid an import cycle.
We can't use the bytes package in Go 1.24 since it would result in an import cycle. Therefore, use bytealg.Index instead. (I'm not sure this code is correct - just searching for a range of bytes seems brittle. But at least this commit shouldn't change the code).
Not entirely sure what they're for, but the Go runtime also stores this information per goroutine so let's go with that.
This function is needed starting with Go 1.24.
We should really be using syscall.Fchdir here, but this is a fix to get Go 1.24 working.
This method was added in Go 1.24.
This fixes lots of broken tests in stdlib packages in Go 1.24.
@aykevl never mind I resolved merge conflict. Now just waiting for CI to run... |
Now merging! Thanks everyone. |
We will need to address #4759 before release. |
@deadprogram see #4761 |
Since it's merged and blocked on #4759. Is it possible to build tinygo from source? nvm I found it at BUILDING.md that's not referenced in the README.md. |
@gandarez please take a look here: https://tinygo.org/docs/guides/build/ |
Not entirely finished, but let's see how far we get with just a few adjustments.