Sorry if this is confusing, I built this test suite to check if dub is ready to use libraries installed in system directories.
I built this test suite with the assumption that libraries should not get packaged with their built binary files. I considered this because, as I understand, in dub you can include libraries in projects with specific configurations and versions. This would lead to a problem when you try to package 2 applications that depend on the same library with different configuration/version flags since you cannot easily detect which flags were used to build a specific binary, and even if you could include multiple binaries, I don't think that dub has any feature to actually detect them correctly.
I'm by no means proficient in D nor knowledgeable on how this should actually work, so any comments are welcome.
This test suite works using podman to run Fedora 39 containers.
The podman image installs ldc2 from Fedora and builds the latest dub version
from the git repository. To build/update the container environment run the build_env.sh
script.
This should just need podman to run. The tests are run through the run_test.sh
script.
When the container image is built, it's configured to add the
data/settings.json
file in the /var/lib/dub
directory, this configures
dub to search system libraries on the /opt/orig/system
folder inside
the container.
The container is configured to have read only access to the test folder,
this folder is mounted into the /opt/orig
path inside the container.
The test folder contains a local and system folder with apps and libraries pertaining the test and a run.sh script.
The run script does the following:
- Copy the
/opt/orig/local
folder into/opt/src
. - Call dub to add all the local libraries.
- Build the application on the
/opt/src/
folder. - Run the built application.
The container is also configured to export some folders for debuging:
/opt/src
->./build_out/test*/src
/root/.dub
->./build_out/test*/cache
The currently implemented tests are the following:
local library -> local app
system library -> local app
local library -> local library -> local app
system library -> local library -> local app
system library -> system library -> local app
local library -> local library
system library -> local library
local library -> local library -> local library
system library -> local library -> local library
system library -> system library -> local library