summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorAndrei Horodniceanu <a.horodniceanu@proton.me>2024-08-16 21:07:38 +0300
committerEli Schwartz <eschwartz93@gmail.com>2025-03-05 02:34:07 -0500
commitf8c3f9e909e0743f6504b8878b71170154128fac (patch)
treee66280af12f69392c01aefacb1914169dcf783e3 /ci
parent751e8f1530dcf411f5e4d8acc758635316a77bcb (diff)
downloadmeson-f8c3f9e909e0743f6504b8878b71170154128fac.tar.gz
dependencies/dub: First try to describe local project
The current approach of determining dub dependencies is by specifying a name and, optionally, a version. Dub will then be called to generate a json summary of the package and code in meson will parse that and extract relevant information. This can be insufficient because dub packages can provide multiple configurations for multiple use-cases, examples include providing a configuration for an executable and a configuration for a library. As a practical example, the dub package itself provides an application configuration and multiple library configurations, the json description of dub will, by default, be for the application configuration which will make dub as a library unusable in meson. This can be solved without modifying the meson build interface by having dub describe the entire local project and collecting dependencies information from that. This way dub will generate information based on the project's 'dub.json' file, which is free to require dependencies in any way accepted by dub, by specifying configurations, by modifying compilation flags etc. This is all transparent to meson as dub's main purpose is to provide a path to the library file generated by the dependency in addition to other command-line arguments for the compiler. This change will, however, require that projects that want to build with meson also provided a 'dub.json' file in which dependency information is recorded. Failure to do so will not break existing projects that didn't use a 'dub.json', but they will be limited to what the previous implementation offered. Projects that already have a 'dub.json' should be fine, so long as the file is valid and the information in it matches the one in 'meson.build'. For example for a 'dependency()' call in 'meson.build' that dependency must exist in 'dub.json', otherwise the call will now fail when it worked previously. Using a 'dub.json' also has as a consequence that the version of the dependencies that are found are the ones specified in 'dub.selections.json', which can be helpful for projects that already provide a 'dub.json' in addition to 'meson.build' to de-duplicate code. In terms of other code changes: - multiple version requirements for a dub dependency now work, though they can only be used when a 'dub.json' is present in which case the version of dependencies is already pinned by 'dub.selections.json' - the 'd/11 dub' test case has been changed to auto-generate the 'dub.json' config outside of the source directory, as the auto-generated file triggers warning when parsed by dub, which upsets the new code as the warnings interfere with the legitimate output. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
Diffstat (limited to 'ci')
-rwxr-xr-xci/ciimage/opensuse/install.sh11
-rwxr-xr-xci/ciimage/ubuntu-rolling/install.sh11
2 files changed, 12 insertions, 10 deletions
diff --git a/ci/ciimage/opensuse/install.sh b/ci/ciimage/opensuse/install.sh
index 5ee1f6435..43b0f7c9b 100755
--- a/ci/ciimage/opensuse/install.sh
+++ b/ci/ciimage/opensuse/install.sh
@@ -42,11 +42,12 @@ echo 'ulimit -n -S 10000' >> /ci/env_vars.sh
source /ci/env_vars.sh
-dub_fetch urld
-dub build --deep urld --arch=x86_64 --compiler=dmd --build=debug
-dub_fetch dubtestproject
-dub build dubtestproject:test1 --compiler=dmd
-dub build dubtestproject:test2 --compiler=dmd
+dub_fetch dubtestproject@1.2.0
+dub build dubtestproject:test1 --compiler=dmd --arch=x86_64
+dub build dubtestproject:test2 --compiler=dmd --arch=x86_64
+dub build dubtestproject:test3 --compiler=dmd --arch=x86_64
+dub_fetch urld@3.0.0
+dub build urld --compiler=dmd --arch=x86_64
# Cleanup
zypper --non-interactive clean --all
diff --git a/ci/ciimage/ubuntu-rolling/install.sh b/ci/ciimage/ubuntu-rolling/install.sh
index 212ed020a..1c0891c23 100755
--- a/ci/ciimage/ubuntu-rolling/install.sh
+++ b/ci/ciimage/ubuntu-rolling/install.sh
@@ -50,11 +50,12 @@ install_python_packages hotdoc
echo 'ulimit -n -S 10000' >> /ci/env_vars.sh
ulimit -n -S 10000
# dub stuff
-dub_fetch urld
-dub build --deep urld --arch=x86_64 --compiler=gdc --build=debug
-dub_fetch dubtestproject
-dub build dubtestproject:test1 --compiler=ldc2
-dub build dubtestproject:test2 --compiler=ldc2
+dub_fetch dubtestproject@1.2.0
+dub build dubtestproject:test1 --compiler=ldc2 --arch=x86_64
+dub build dubtestproject:test2 --compiler=ldc2 --arch=x86_64
+dub build dubtestproject:test3 --compiler=gdc --arch=x86_64
+dub_fetch urld@3.0.0
+dub build urld --compiler=gdc --arch=x86_64
# Remove debian version of Rust and install latest with rustup.
# This is needed to get the cross toolchain as well.