meson icon indicating copy to clipboard operation
meson copied to clipboard

dependencies/detect: correctly get the `log_tried()`

Open dcbaker opened this issue 3 years ago • 2 comments

We're currently trying to call the method .log_tried() on a function, which is invalid. Mypy even helpfully points this out, except that we don't yet run mypy on this file :/

We can fix this, but we may not be able to figure out the method anyway, since we could end up with a situation where there is no way to get the method tried, since the dependency errored on creation and the callable isn't an ExternalDependency initializer.

Fixes: #11145

dcbaker avatar Dec 07 '22 22:12 dcbaker

Codecov Report

Merging #11147 (79018af) into master (b249470) will decrease coverage by 0.12%. The diff coverage is n/a.

:exclamation: Current head 79018af differs from pull request most recent head 69dafc0. Consider uploading reports for the commit 69dafc0 to get more accurate results

@@            Coverage Diff             @@
##           master   #11147      +/-   ##
==========================================
- Coverage   66.07%   65.94%   -0.13%     
==========================================
  Files         414      207     -207     
  Lines       90036    45023   -45013     
  Branches    19290     9324    -9966     
==========================================
- Hits        59488    29692   -29796     
+ Misses      26003    12967   -13036     
+ Partials     4545     2364    -2181     
Impacted Files Coverage Δ
scripts/clangtidy.py 0.00% <0.00%> (-93.34%) :arrow_down:
modules/cuda.py 0.00% <0.00%> (-69.82%) :arrow_down:
templates/cudatemplates.py 37.50% <0.00%> (-62.50%) :arrow_down:
compilers/cuda.py 19.63% <0.00%> (-45.40%) :arrow_down:
dependencies/cuda.py 19.23% <0.00%> (-43.75%) :arrow_down:
modules/icestorm.py 57.14% <0.00%> (-40.00%) :arrow_down:
compilers/cython.py 43.18% <0.00%> (-38.64%) :arrow_down:
dependencies/coarrays.py 45.00% <0.00%> (-17.50%) :arrow_down:
cmake/traceparser.py 71.11% <0.00%> (-9.10%) :arrow_down:
compilers/mixins/clike.py 70.12% <0.00%> (-6.69%) :arrow_down:
... and 259 more

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

codecov[bot] avatar Dec 07 '22 23:12 codecov[bot]

Thanks for working on this! I couldn't get my head around it myself.

punytroll avatar Dec 08 '22 08:12 punytroll

This can be closed since the bug was solved by #12226.

bruchar1 avatar Sep 12 '23 12:09 bruchar1

I wonder if this should stay open since it is a more general solution? @dcbaker if you wanna provide input...

tristan957 avatar Sep 12 '23 15:09 tristan957

My original objection was that "a more general solution" is literally just "try: code; except Exception: log('it failed but we arent sure why. Continuing....')".

Standard development policy when faced with type errors is that we fix the data model, not raised an "I dunno" error; I don't see why this should be an exception.

eli-schwartz avatar Sep 12 '23 15:09 eli-schwartz

Cool sounds good. Closed it is.

tristan957 avatar Sep 12 '23 15:09 tristan957