Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

newlib build paths included, causing loss of build reproducibility across build OSs (IDFGH-13355) #14267

Closed
3 tasks done
bryghtlabs-richard opened this issue Jul 29, 2024 · 5 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@bryghtlabs-richard
Copy link
Contributor

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.1.2

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

CMD

What is the expected behavior?

When building same application with same sources and same tool versions, output binaries should match, even if the build OS is different.

What is the actual behavior?

Some paths seem to be captured when building newlib, which will then be present in the application's .bin file.

Steps to reproduce.

  1. Enable CONFIG_APP_REPRODUCIBLE_BUILD
  2. Confirm tool versions match across operating systems
  3. Build same application on Windows 11 and WSL2 with idf.py build
  4. Compare app .bin files from both builds
  5. Identify most common difference: newlib build path

Build or installation Logs.

No response

More Information.

I saw the documentation stated "Versions of the build tools (CMake, Ninja) and the cross-compiler" may cause differences, but this seems unrelated to that. Here is the first difference in HXD:

image

@bryghtlabs-richard bryghtlabs-richard added the Type: Bug bugs in IDF label Jul 29, 2024
@github-actions github-actions bot changed the title newlib build paths included, causing loss of build reproducibility across build OSs newlib build paths included, causing loss of build reproducibility across build OSs (IDFGH-13355) Jul 29, 2024
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 29, 2024
@igrr
Copy link
Member

igrr commented Jul 29, 2024

Thanks for bringing up the issue, and sorry that we didn't explicitly mention the OS in the list of things that may still cause the builds to be non-reproducible. But yes, this specific issue was assumed to be part of "Versions of the build tools (CMake, Ninja) and the cross-compiler".

We can try to substitute these paths in a future toolchain release, however I'm afraid that we won't be creating a patch release of the toolchains used in v5.1.x.

@bryghtlabs-richard
Copy link
Contributor Author

No worries about a fix for v5.1.x, it's just the version I was using. Remapping those paths would be certainly be helpful, and may be the only thing left across different OSs with the same tool versions - I've only seen differences in those strings and differences in pointers that may have been offset due to those strings changing length.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Aug 15, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress labels Aug 25, 2024
@bryghtlabs-richard
Copy link
Contributor Author

I do not think this is complete, please re-evaluate.

@igrr
Copy link
Member

igrr commented Sep 16, 2024

@bryghtlabs-richard The paths seem to be /builds/idf/crosstool-NG/builds/ for all platforms now, could you please clarify, what is the issue you are seeing?

@bryghtlabs-richard
Copy link
Contributor Author

Sorry, I saw the Aug 15 update and misunderstood, I didn't see the update two days ago. Setting the path like that should fix it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

4 participants