!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

901 Members
For people hacking on the Nix package manager itself189 Servers

Load older messages


SenderMessageTime
20 Feb 2025
@Ericson2314:matrix.orgJohn Ericson no no it doesn't do that 18:52:56
@Ericson2314:matrix.orgJohn Ericsonlet me check18:53:05
@Ericson2314:matrix.orgJohn Ericsoncause I forget18:53:08
@Ericson2314:matrix.orgJohn Ericson emily: look at nix-meson-build-support/export/meson.build 18:53:45
@Ericson2314:matrix.orgJohn Ericson see how declare_dependency has include_directories in it? 18:54:19
@emilazy:matrix.orgemily ok, and include_dirs is defined as include_dirs += [include_directories('.')] in the various libraries 18:55:35
@emilazy:matrix.orgemilyso in practice this is exactly what's happening18:56:05
@emilazy:matrix.orgemilybut at least it's not Meson doing it out of the box I guess18:56:06
@Ericson2314:matrix.orgJohn Ericson emily: oh and install_headers, another hack on their end 18:58:44
@Ericson2314:matrix.orgJohn Ericson oh sorry I see what you mean now 18:59:14
@Ericson2314:matrix.orgJohn Ericsonyes Lix and us are both doing that haha18:59:25
@Ericson2314:matrix.orgJohn Ericson they put their source code in lix/libutil/ 18:59:35
@Ericson2314:matrix.orgJohn Ericson and then they make the repo root the include path 18:59:45
@Ericson2314:matrix.orgJohn Ericson so everything, upstream and downstream libraries is in principle able to incldue 18:59:59
@Ericson2314:matrix.orgJohn Ericson meson has "targets", e.g. those produced by executable(..) and library(..) 19:00:28
@Ericson2314:matrix.orgJohn Ericsonbut they don't have any analogous notion for headers19:00:35
@emilazy:matrix.orgemily I still think just libfoo/include/nix is the thing that makes sense. but if that's not an option, how about simply generating a nix/ with header files in it in Meson and having that be the downstream include directory used? 19:00:52
@emilazy:matrix.orgemilyyou can also use it for installing headers: simply install that generated thing19:00:59
@emilazy:matrix.orgemily no symlinks in the source tree, should be pretty simple on the Meson end, and no .cc files in include paths 19:01:10
@emilazy:matrix.orgemilyright now it seems like libraries can see headers from "downstream" libraries that they don't depend on too, which this would avoid19:01:25
@Ericson2314:matrix.orgJohn 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
@emilazy:matrix.orgemily(but I might be misreading that)19:01:33
@emilazy:matrix.orgemilyI guess https://mesonbuild.com/Generating-sources.html#generating-headers might not actually be fancy enough for this. not sure.19:02:04
@Ericson2314:matrix.orgJohn Ericson I think this happens with Lix, but not us. since we do the include dirs once per dep 19:02:37
@Ericson2314:matrix.orgJohn Ericson you can do a fucked up #include "libutil-file.cc" 19:02:46
@Ericson2314:matrix.orgJohn Ericsonbut you cannot do a libexpr include from libstore19:02:57
@emilazy:matrix.orgemilyI see, ok19:03:02
@emilazy:matrix.orgemilyI understand the scoping now19:03:12
@Ericson2314:matrix.orgJohn Ericsonmeson has both configure time and build time path manipulation19:03:31
@emilazy:matrix.orgemily 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

Show newer messages


Back to Room ListRoom Version: 6