nixd icon indicating copy to clipboard operation
nixd copied to clipboard

Use Meson subprojects

Open Ericson2314 opened this issue 7 months ago • 4 comments

I see that there are per-library packages, and a top-level meson.build for development. Right now, this is assembled by hand but meson subprojects are what is exactly intended for this use-case. I recommend using them instead! You can look at the Nix repo to see how.

Ericson2314 avatar Apr 09 '25 05:04 Ericson2314

Right now, this is assembled by hand but meson subprojects are what is exactly intended for this use-case.

IIRC, it requires all subprojects placed in a hard-coded path subprojects/, that's unacceptable.

inclyc avatar Apr 09 '25 09:04 inclyc

@inclyc the directory name is overrideable. We override it to src, for example. You might even be able to override it to ., but I am not sure.

Ericson2314 avatar Apr 09 '25 13:04 Ericson2314

I think the current layout works well though, what can we benefit from such migration?

inclyc avatar Apr 09 '25 14:04 inclyc

@inclyc it makes the development environment more "realistic" / close to the "prod" separated Nix build. E.g. introduces a notion of scope in Meson's (otherwise) global variables, options also are namespaced per sub-project.

At the very least, I think it would allow to have a good deal less Meson code.

Ericson2314 avatar Apr 09 '25 16:04 Ericson2314

@inclyc the directory name is overrideable. We override it to src, for example. You might even be able to override it to ., but I am not sure.

It is not possible to override it to ..

../../meson.build:1:0: ERROR: Subproject_dir must not begin with a period.

I don't want to change the project layouts for now.

inclyc avatar May 11 '25 09:05 inclyc