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

Package's ".x" is not reproducible between dependency upgrade #4111

Open
sluongng opened this issue Sep 20, 2024 · 1 comment
Open

Package's ".x" is not reproducible between dependency upgrade #4111

sluongng opened this issue Sep 20, 2024 · 1 comment

Comments

@sluongng
Copy link
Contributor

This is a tracking issue for golang/go#69547

I was upgrading our external dependencies recently and these 2 GoCompilePkg actions ran on the same package between 2 consecutive commits.

Specifically, the package is server/util/db with a single source file db.go. The upgraded dependency was gorm.io/driver/{mysql,clickhouse,sqlite}. There was no code change in db.go.

The expectation is for db.x output to stay the same between the 2 compilations as no exported data was change. However, we observed that there were some bytes differences between the 2 .x files, which caused downstream compile actions to all rebuild.

~> diffoscope db{1,2}.x
--- db1.x
+++ db2.x
│┄ Command `'nm -s {}'` failed with exit code 1. Standard output:
│┄     /Library/Developer/CommandLineTools/usr/bin/nm: error: for the -s option: bad number of arguments (must be two arguments)
│┄     /Library/Developer/CommandLineTools/usr/bin/nm: error: a.out: No such file or directory
@@ -34357,15 +34357,15 @@
 00086340: 0104 0203 0405 1000 8108 0082 0803 7b03  ..............{.
 00086350: 4303 0103 0203 4103 8001 0324 034a 031b  C.....A....$.J..
 00086360: 03d4 0303 d503 03dc 0303 d803 0081 080f  ................
 00086370: 010d 0203 0405 0607 0809 0a0b 0c0d 0e0b  ................
 00086380: 0083 0800 8408 0343 034a 03d4 0303 d503  .......C.J......
 00086390: 03d8 0303 da03 0341 0365 0083 080a 0108  .......A.e......
 000863a0: 0203 0405 0607 0809 1200 8508 0086 0803  ................
-000863b0: bd01 03d4 0303 d804 037b 0341 0380 0103  .........{.A....
+000863b0: bd01 03d8 0403 d403 037b 0341 0380 0103  .........{.A....
 000863c0: 4a03 ea04 03d5 0303 d504 03d8 0303 2403  J.............$.
 000863d0: ef04 03d6 0403 dc03 0085 0811 010f 0203  ................
 000863e0: 0405 0607 0809 0a0b 0c0d 0e0f 1026 0087  .............&..
 000863f0: 0800 8808 0328 036f 0355 0358 035a 0302  .....(.o.U.X.Z..
 00086400: 0341 0324 03d9 0403 dc04 03dd 0403 0103  .A.$............
 00086410: 2303 5703 5903 2903 2503 5f03 6a03 4403  #.W.Y.).%._.j.D.
 00086420: 6d03 4a03 1b03 e604 03e7 0403 d402 0380  m.J.............
@@ -113551,9 +113551,9 @@
 001bb8e0: 0806 0103 0004 0000 0117 0004 0d00 0017  ................
 001bb8f0: 0102 0100 0101 00d0 080f 0002 1700 0f01  ................
 001bb900: 0100 1701 040b 0b01 00d0 0815 1701 0001  ................
 001bb910: 0103 0000 0c3a 1700 0401 0105 0100 d008  .....:..........
 001bb920: 2014 0100 d008 2300 0400 0100 d008 270a   .....#.......'.
 001bb930: 0100 d108 0400 0117 0004 0101 0500 0100  ................
 001bb940: d208 0300 0a01 00d3 0803 0001 1401 00d3  ................
-001bb950: 080a 0004 0001 00d4 0802 907f c3c9 9764  ...............d
-001bb960: 77e3 0a24 240a                           w..$$.
+001bb950: 080a 0004 0001 00d4 0802 8162 2d2d 5d3d  ...........b--]=
+001bb960: fb45 0a24 240a                           .E.$$.
exit 1

I tried using various gcexports tools to decode the 2 files and diff them but the contents are pretty much identical. Consulting upstream Go team for more information on the 7-bytes diff.

@sluongng
Copy link
Contributor Author

Forgot to add: I also tried to compile the go_library several times in a loop

[
  go_library(name = "db_{}".format(i), ...)
  for i in (1, 10)
]

and was able to verify that the .x is reproducible when compiling within the same set of dependencies.

So the few bytes changes must come from the dependency upgrade, just unclear why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant