dub icon indicating copy to clipboard operation
dub copied to clipboard

How to build every dependency of a project (given a dub.json / dub.selections.json)?

Open Panke opened this issue 3 years ago • 7 comments
trafficstars

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 `

Panke avatar Feb 05 '22 16:02 Panke

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.

Panke avatar Feb 05 '22 16:02 Panke

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: @.***>

rikkimax avatar Feb 05 '22 17:02 rikkimax

That does not make a difference.

Panke avatar Feb 05 '22 22:02 Panke

I am going now a different route without dub add-local.

  1. I fetch all packages from a dub.selections.json file into a custom file-repository.

  2. HOME=. dub build --skip-registry=all --registray=file://what/ever <pkg>@<version> foreach package in dub.selections.json and keep the ./dub/packages/ as a build dependency

  3. For the actual build, restore the ./dub/packages folder and get the required flags via dub describe.

Panke avatar Feb 15 '22 09:02 Panke

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

WebFreak001 avatar Feb 13 '23 13:02 WebFreak001

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 avatar Mar 16 '23 15:03 MrcSnm

@MrcSnm consider opening a new issue for that and describe what you want from it.

WebFreak001 avatar Mar 16 '23 17:03 WebFreak001