dub
dub copied to clipboard
How to build every dependency of a project (given a dub.json / dub.selections.json)?
I am trying to improve dub2nix and make Nix work better with D. To this end I want to build all dependencies of a package without building that package itself. I tried to fetch the dependencies from a dub.selections.json file and build them, but this fails:
`[nix-shell:~/dlang/dlang-mix-meson-playground]$ HOME=. dub fetch [email protected] Fetching stdx-allocator 2.77.5...
[nix-shell:~/dlang/dlang-mix-meson-playground]$ dub add-local .dub/packages/stdx-allocator-2.77.5/stdx-allocator 2.77.5 Registered package: stdx-allocator (version: 2.77.5)
[nix-shell:~/dlang/dlang-mix-meson-playground]$ HOME=. dub build --skip-registry=all [email protected] No package stdx-allocator was found matching the dependency 2.77.5 `
If I move the package to another place and dub add-local it there and allow the registries it will 1.) fetch the package again to /.dub/packages, but 2.) build the package in the place specified with dub add-local.
Try skipping configured or standard instead of all.
On Sun, Feb 6, 2022 at 5:49 AM Tobias Pankrath @.***> wrote:
If I move the package to another place and dub add-local it there and allow the registries it will 1.) fetch the package again to /.dub/packages, but 2.) build the package in the place specified with dub add-local.
— Reply to this email directly, view it on GitHub https://github.com/dlang/dub/issues/2209#issuecomment-1030657545, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHSL46KPJEAPJI2OSLYCPTUZVIH7ANCNFSM5NUFE3QQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
That does not make a difference.
I am going now a different route without dub add-local.
-
I fetch all packages from a
dub.selections.jsonfile into a custom file-repository. -
HOME=. dub build --skip-registry=all --registray=file://what/ever <pkg>@<version>foreach package indub.selections.jsonand keep the ./dub/packages/ as a build dependency -
For the actual build, restore the ./dub/packages folder and get the required flags via
dub describe.
this might help: https://github.com/dlang/dub/issues/2224
https://code.dlang.org/packages/dub-build-deep
https://github.com/mesonbuild/meson/pull/10045
Is there some way to get a staticLibraryBundle target type?
This could be helpful for my engine. I have done a simple script to do something like that but the work is still very manual.
@MrcSnm consider opening a new issue for that and describe what you want from it.