Skip to content

Make generated sources and one error message deterministic#1804

Merged
speth merged 2 commits intoCantera:mainfrom
keszybz:reproducibility
Oct 30, 2024
Merged

Make generated sources and one error message deterministic#1804
speth merged 2 commits intoCantera:mainfrom
keszybz:reproducibility

Conversation

@keszybz
Copy link
Copy Markdown
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.
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
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