Skip to content

Conversation

@eli-schwartz
Copy link
Member

We mostly just need to do the same thing. Plug in one utility method to make sanity_check_impl find the right compile args, and plug in DEVNULL to the test run. It's that simple.

This solves a few inconsistencies. The main one is that fortran never logged the sanity checks to the Meson debug log, making it hard to debug.

There's also some interesting quirks we built up in the dedicated fortran handling. For example:

  • in commit 5b109c9 we added cwd to building the fortran executable, with a wordy comment about how the compiler has defects. But the clike base has always done that on general principle anyway, so we would never have had that bug in the first place.
  • in commit d6be782 we added special deletion of an old "bad existing exe file" just for fortran. Looking at the PR discussion for this odd requirement, it turns out that the real problem is mixing WSL and native Windows without deleting the build directory. This is apparently fortran specific simply because "contemporary Windows 10 Fortran users" switch between the two?
    The actual problem is that this never used .exe as the output name, so Windows thinks you want to run something other than the thing you asked to run, because it's not even a Window executable. But... the common clike handling could have fixed that without needing special cases.

It is more correct to join commands with a command joiner than a
whitespace joiner.
@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #10835 (9b84022) into master (496dce0) will decrease coverage by 18.49%.
The diff coverage is n/a.

❗ Current head 9b84022 differs from pull request most recent head be10cff. Consider uploading reports for the commit be10cff to get more accurate results

@@             Coverage Diff             @@
##           master   #10835       +/-   ##
===========================================
- Coverage   68.99%   50.49%   -18.50%     
===========================================
  Files         406      203      -203     
  Lines       88650    44306    -44344     
  Branches    19665     9818     -9847     
===========================================
- Hits        61164    22373    -38791     
+ Misses      22887    19925     -2962     
+ Partials     4599     2008     -2591     
Impacted Files Coverage Δ
modules/qt5.py 0.00% <0.00%> (-100.00%) ⬇️
modules/modtest.py 0.00% <0.00%> (-100.00%) ⬇️
scripts/run_tool.py 0.00% <0.00%> (-100.00%) ⬇️
scripts/msgfmthelper.py 0.00% <0.00%> (-100.00%) ⬇️
modules/icestorm.py 0.00% <0.00%> (-97.15%) ⬇️
modules/keyval.py 0.00% <0.00%> (-95.24%) ⬇️
scripts/clangtidy.py 0.00% <0.00%> (-93.34%) ⬇️
scripts/vcstagger.py 0.00% <0.00%> (-91.67%) ⬇️
modules/sourceset.py 0.00% <0.00%> (-90.54%) ⬇️
scripts/depscan.py 0.00% <0.00%> (-83.45%) ⬇️
... and 320 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

This code dates back to 2012 and probably has no specific reason...
We *mostly* just need to do the same thing. Plug in one utility method
to make sanity_check_impl find the right compile args, and plug in
DEVNULL to the test run. It's that simple.

This solves a few inconsistencies. The main one is that fortran never
logged the sanity checks to the Meson debug log, making it hard to
debug.

There's also some interesting quirks we built up in the dedicated
fortran handling. For example:

- in commit 5b109c9 we added cwd to
  building the fortran executable, with a wordy comment about how the
  compiler has defects. But the clike base has always done that on
  general principle anyway, so we would never have had that bug in the
  first place.

- in commit d6be782 we added special
  deletion of an old "bad existing exe file" just for fortran. Looking
  at the PR discussion for this odd requirement, it turns out that the
  real problem is mixing WSL and native Windows without deleting the
  build directory. This is apparently fortran specific simply because
  "contemporary Windows 10 Fortran users" switch between the two?

  The actual problem is that this never used .exe as the output name, so
  Windows thinks you want to run something other than the thing you
  asked to run, because it's not even a Window executable. But... the
  common clike handling could have fixed that without needing special
  cases.
@tristan957
Copy link
Member

Looks pretty good to me :)

@xclaesse xclaesse merged commit 30b1774 into mesonbuild:master Sep 22, 2022
@eli-schwartz eli-schwartz deleted the fortran-sanity-log branch September 23, 2022 02:51
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.

3 participants