| 20 Feb 2025 |
emily | you can also use it for installing headers: simply install that generated thing | 19:00:59 |
emily | no symlinks in the source tree, should be pretty simple on the Meson end, and no .cc files in include paths | 19:01:10 |
emily | right now it seems like libraries can see headers from "downstream" libraries that they don't depend on too, which this would avoid | 19:01:25 |
John Ericson | it is just done with side effects instead like install_headers, making PC files, and include_directories , the logic is very balkanized between those 3 things which must stay in sync | 19:01:30 |
emily | (but I might be misreading that) | 19:01:33 |
emily | I guess https://mesonbuild.com/Generating-sources.html#generating-headers might not actually be fancy enough for this. not sure. | 19:02:04 |
John Ericson | I think this happens with Lix, but not us. since we do the include dirs once per dep | 19:02:37 |
John Ericson | you can do a fucked up #include "libutil-file.cc" | 19:02:46 |
John Ericson | but you cannot do a libexpr include from libstore | 19:02:57 |
emily | I see, ok | 19:03:02 |
emily | I understand the scoping now | 19:03:12 |
John Ericson | meson has both configure time and build time path manipulation | 19:03:31 |
emily | it's hard for me to see any non-hacky way of avoiding include/nix that doesn't leave the Nix-build-time include paths different from the Nix-end-user include paths | 19:05:17 |
emily | because you still end up with C++ files, maybe internal headers, whatever on the path | 19:05:27 |
John Ericson | agreed | 19:05:44 |
John Ericson | and I want private non-installed headers | 19:05:49 |
emily | perhaps it would be best if the libraries were entirely separate Meson builds that consume each other via .pc files, but I don't know if Meson itself can orchestrate that or if you'd have to just do it with Nix. | 19:06:00 |
John Ericson | which further motivates a separation | 19:06:01 |
John Ericson | emily: we are trying to do the meson version of taht | 19:06:21 |
John Ericson | * emily: we are trying to do the meson version of that | 19:06:23 |
John Ericson | with meson subprojects | 19:06:27 |
John Ericson | but it is designed to not require installing | 19:06:36 |
emily | perhaps you can use fs.copyfile to copy headers into an include/nix/* directory in the build tree and then have that be the include directory | 19:06:50 |
John Ericson | (installing is all side effects not ninja target direven, like most build systems) | 19:06:54 |
John Ericson | fs.copyFile will do it at configure time | 19:07:02 |
emily | I think that that should work and satisfy ^ strongly | 19:07:07 |
emily | it says "Copy a file from the source directory to the build directory at build time", is that inaccurate? | 19:07:18 |
John Ericson | which will kill the debug cycle | 19:07:19 |
emily | it returns a custom_target() | 19:07:22 |
emily | which would run at build time, afaik. | 19:07:27 |