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

Make generated sources and one error message deterministic #1804

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

keszybz
Copy link
Contributor

@keszybz keszybz commented Oct 30, 2024

Replace list(set(…)) by sorted(set(…)) to avoid randomness in builds and at runtime.

In Fedora rebuilds to test package build reproducibility
(see https://reproducible-builds.org/,
https://fedoraproject.org/wiki/Changes/ReproduciblePackageBuilds),
we get the following differences like the following for various CMakeLists.txt
and SConstruct files:

/usr/share/cantera/samples/cxx/LiC6_electrode/CMakeLists.txt:
│ │ -include_directories("/usr/include" "/usr/include/eigen3" "/usr/include/highfive")
│ │ +include_directories("/usr/include/highfive" "/usr/include/eigen3" "/usr/include")

Those end up in the -debugsources package and cause the whole build to be
flagged as irreproducible. In addition, if the an include file with the same
name happened to be present in more than one location, the unpredictable sort
order would mean that different files would be used in different builds. Sort
the directories alphabetically for predictable results.
The message would vary between reruns, which is not useful.
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.09%. Comparing base (3ba21c4) to head (1c319b5).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1804   +/-   ##
=======================================
  Coverage   73.09%   73.09%           
=======================================
  Files         383      383           
  Lines       54617    54617           
  Branches     9101     9101           
=======================================
+ Hits        39921    39924    +3     
+ Misses      11698    11696    -2     
+ Partials     2998     2997    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@speth speth merged commit afa45f4 into Cantera:main Oct 30, 2024
52 checks passed
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

Successfully merging this pull request may close these issues.

2 participants