Skip to content
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

Reflect refactor caused non-deterministic builds #3504

Closed
aykevl opened this issue Mar 2, 2023 · 2 comments
Closed

Reflect refactor caused non-deterministic builds #3504

aykevl opened this issue Mar 2, 2023 · 2 comments
Labels
bug Something isn't working core

Comments

@aykevl
Copy link
Member

aykevl commented Mar 2, 2023

I found that TinyGo does not produce deterministic results anymore:

$ tinygo build -o test.hex -target=cortex-m-qemu ./testdata/calls.go && md5sum test.hex
e1bd69209b6fe86f1360befbd7c47d94  test.hex

$ tinygo build -o test.hex -target=cortex-m-qemu ./testdata/calls.go && md5sum test.hex
05b7cbd854f460a1bf3564b280ffea16  test.hex

I bisected this to 4e84531, which is the reflect refactor.

@aykevl
Copy link
Member Author

aykevl commented Mar 2, 2023

Smaller reproducer:

package main

type Thing struct {
	name string
}

func (t Thing) Foo() {
}

type Printer interface {
	Foo()
}

func main() {
	var t Printer = &Thing{"foo"}
	defer t.Foo()
}

aykevl added a commit that referenced this issue Mar 2, 2023
This non-determinism was introduced in
#2640. Non-determinism in the
compiler is a bug because it makes it harder to find whether a compiler
change actually affected the binary.

Fixes #3504
deadprogram pushed a commit that referenced this issue Mar 2, 2023
This non-determinism was introduced in
#2640. Non-determinism in the
compiler is a bug because it makes it harder to find whether a compiler
change actually affected the binary.

Fixes #3504
@deadprogram deadprogram added bug Something isn't working next-release Will be part of next release core labels Mar 2, 2023
@aykevl
Copy link
Member Author

aykevl commented Mar 6, 2023

This was introduced and fixed during the current release cycle, so closing.

@aykevl aykevl closed this as completed Mar 6, 2023
conejoninja pushed a commit to conejoninja/tinygo that referenced this issue Mar 22, 2023
This non-determinism was introduced in
tinygo-org#2640. Non-determinism in the
compiler is a bug because it makes it harder to find whether a compiler
change actually affected the binary.

Fixes tinygo-org#3504
deadprogram pushed a commit that referenced this issue Mar 28, 2023
This non-determinism was introduced in
#2640. Non-determinism in the
compiler is a bug because it makes it harder to find whether a compiler
change actually affected the binary.

Fixes #3504
@deadprogram deadprogram removed the next-release Will be part of next release label May 22, 2023
LiuJiazheng pushed a commit to LiuJiazheng/tinygo that referenced this issue Aug 20, 2023
This non-determinism was introduced in
tinygo-org#2640. Non-determinism in the
compiler is a bug because it makes it harder to find whether a compiler
change actually affected the binary.

Fixes tinygo-org#3504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

2 participants