Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Panke opened this issue Feb 5, 2022 · 7 comments

Comments

@Panke
Copy link
Contributor

Panke commented Feb 5, 2022

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
Copy link
Contributor Author

Panke commented Feb 5, 2022

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.

@rikkimax
Copy link
Contributor

rikkimax commented Feb 5, 2022 via email

@Panke
Copy link
Contributor Author

Panke commented Feb 5, 2022

That does not make a difference.

@Panke
Copy link
Contributor Author

Panke commented Feb 15, 2022

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.

@WebFreak001
Copy link
Member

this might help: #2224

https://code.dlang.org/packages/dub-build-deep

mesonbuild/meson#10045

@MrcSnm
Copy link
Contributor

MrcSnm commented Mar 16, 2023

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.

@WebFreak001
Copy link
Member

WebFreak001 commented Mar 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants