meson icon indicating copy to clipboard operation
meson copied to clipboard

Dub dependency configuration

Open rtbo opened this issue 3 years ago • 7 comments

Add the possibility to specify a configuration for Dub dependencies. Requires to add new kwarg to dependency.

rtbo avatar Mar 26 '22 09:03 rtbo

Codecov Report

Merging #10189 (f55e4d1) into master (37663da) will decrease coverage by 0.35%. The diff coverage is 4.00%.

:exclamation: Current head f55e4d1 differs from pull request most recent head 2ad784c. Consider uploading reports for the commit 2ad784c to get more accurate results

@@            Coverage Diff             @@
##           master   #10189      +/-   ##
==========================================
- Coverage   68.95%   68.60%   -0.36%     
==========================================
  Files         406      412       +6     
  Lines       88458    87917     -541     
  Branches    19621    20751    +1130     
==========================================
- Hits        61000    60319     -681     
- Misses      22868    23087     +219     
+ Partials     4590     4511      -79     
Impacted Files Coverage Δ
mesonbuild/dependencies/dub.py 6.15% <0.00%> (-1.90%) :arrow_down:
mesonbuild/interpreter/interpreter.py 84.58% <ø> (+0.16%) :arrow_up:
mesonbuild/dependencies/detect.py 91.22% <100.00%> (+0.23%) :arrow_up:
mesonbuild/mlog.py 82.72% <0.00%> (-8.05%) :arrow_down:
mlog.py 78.40% <0.00%> (-7.37%) :arrow_down:
mesonbuild/scripts/meson_exe.py 72.28% <0.00%> (-5.10%) :arrow_down:
mesonbuild/compilers/mixins/clang.py 68.96% <0.00%> (-4.21%) :arrow_down:
dependencies/dub.py 44.23% <0.00%> (-4.08%) :arrow_down:
compilers/mixins/clang.py 66.66% <0.00%> (-4.07%) :arrow_down:
scripts/meson_exe.py 78.31% <0.00%> (-3.83%) :arrow_down:
... and 177 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 Mar 26 '22 10:03 codecov[bot]

Hello @rtbo, I'm new here and trying to help out a bit. One of those things is kicking the tires on PRs that haven't updated in a bit. Is this PR ready for review?

anadon avatar Apr 07 '22 04:04 anadon

Is this PR ready for review?

The code is ready, but I'm struggling a bit with the tests. The main reason is that I can't add new Dub packages to the tests images, so I try to install Dub deps directly from the test meson scripts, which is at best an awful hack.

rtbo avatar Apr 07 '22 16:04 rtbo

Can you tell me how I could test this locally?

anadon avatar Apr 07 '22 19:04 anadon

I reverted code that skips the failing tests. It was only failing on Windows, I think due to racing of different tests running Dub commands at the same time. (tests d/14 dub with deps and d/16 dub config). You can run tests locally with ./run_project_tests.py --only d

rtbo avatar Apr 07 '22 20:04 rtbo

@dcbaker @eli-schwartz This PR was stalled for a few month, but it should be OK for review now. Main use case: use Dub dependencies that are applications, but have a library configuration (e.g. dub, dfmt ...). Currently we can't use such dependencies because application is the default configuration. Now we can choose library.

rtbo avatar Nov 23 '22 08:11 rtbo

Note: the tests only run on Windows. On linux they are skipped either because Dub is not installed, or because GDC is used as a compiler. To run the tests on Linux we should have Dub and Dmd/Ldc at the same time. Each time I try to modify the image scripts I get weird unrelated errors though. The tests will kick-in as soon as those conditions are met (and will fail because uninstalled dub packages). I'm not sure how I can act on this.

rtbo avatar Nov 23 '22 08:11 rtbo