pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.73k stars 211 forks source link

internal/tracker/seen_test.go test fails on i686 #760

Closed flyn-org closed 2 years ago

flyn-org commented 2 years ago

Describe the bug I am trying to package go-toml for Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=2031226). Go-toml's internal/tracker/seen_test.go fails on i686 with the following message:

github.com/pelletier/go-toml/v2/internal/testsuite
?       github.com/pelletier/go-toml/v2/internal/testsuite  [no test files]
github.com/pelletier/go-toml/v2/internal/tracker
--- FAIL: TestEntrySize (0.00s)
    seen_test.go:14: 
            Error Trace:    seen_test.go:14
            Error:          "48" is not less than or equal to "24"
            Test:           TestEntrySize
FAIL
exit status 1
FAIL    github.com/pelletier/go-toml/v2/internal/tracker    0.004s

This test uses unsafe.Sizeof to determine the size of a type. Is it possible that this size is smaller than expected on 32-bit platforms? Pointers there will consume 32 bits, rather than 64 bits.

To Reproduce Build go-toml on Fedora i686. A full log of this is available at https://kojipkgs.fedoraproject.org//work/tasks/4983/86184983/build.log.

Expected behavior A clear and concise description of what you expected to happen, if other than "should work".

Versions

Additional context

pelletier commented 2 years ago

Thanks for reporting this! The test is actually wrong – I meant the opposite. I want to check that the struct is not more than 48 bytes. Let me fix it.

pelletier commented 2 years ago

Should be fixed by https://github.com/pelletier/go-toml/commit/5aaf5ef13b8a47eca3eb424cfdb8bc7a044ec5fa. Let me know if it works, and whether you'd like me to tag a new beta release to get your build going.

flyn-org commented 2 years ago

Fixed! Thank you.