!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

927 Members
For people hacking on the Nix package manager itself193 Servers

Load older messages


SenderMessageTime
20 Feb 2025
@Ericson2314:matrix.orgJohn Ericson src/lib<blah>/nix -> .. symlink 18:37:30
@Ericson2314:matrix.orgJohn Ericson and then make all our headers do #include "nix/*" 18:37:53
@Ericson2314:matrix.orgJohn Ericson and make the PC files not have the /nix 18:38:14
@Ericson2314:matrix.orgJohn Ericson that solution avoids moving source files around, which will make Eelco happy. (More seriously, it will keep the headers next to their corresponding sources, which he said he likes) 18:38:44
@emilazy:matrix.orgemily why can't you just do #include <nix/…> in the headers, have src/lib<blah>/include/nix be where the headers are, and add the built lib<blah>s as normal Meson dependencies? 18:39:02
@emilazy:matrix.orgemilyI don't think you need any symlink hacks to make that work18:39:07
@Ericson2314:matrix.orgJohn Ericson you need the symlink hack if you want foo.hh next to foo.cc 18:39:23
@Ericson2314:matrix.orgJohn EricsonI am happy to have that conversation with the rest of the team, but I don't think we should be blocked on that18:39:53
@Ericson2314:matrix.orgJohn Ericson the symlink hack is only in the source tree 18:40:03
@Ericson2314:matrix.orgJohn Ericsonin the installed outputs, everything is normal18:40:13
@Ericson2314:matrix.orgJohn Ericson and also importantly, were not doing anything like sedding-in the #include "nix/... either, which would screw over meson subproject stuff 18:40:41
@emilazy:matrix.orgemilyalright. well since it doesn't affect any downstream user I guess it doesn't really matter. just seems silly to me18:40:47
@Ericson2314:matrix.orgJohn Ericson(and I do use that, to work on hydra and nix-eval-jobs and nix all at once, it's nice!)18:40:56
@emilazy:matrix.orgemilyI think you could construct the symlink hack inside the Meson build rather than polluting the source tree with it.18:41:04
@emilazy:matrix.orgemilyit supports generated include stuff etc.18:41:09
@Ericson2314:matrix.orgJohn Ericsonthat might cause some side effects like more confusing paths in compiler diagnostics18:42:15
@Ericson2314:matrix.orgJohn Ericson(which is fixable)18:42:18
@Ericson2314:matrix.orgJohn Ericson * (which is fixable, granted)18:42:21
@Ericson2314:matrix.orgJohn Ericsonif you are willing to try this out, then I would say try either the source symlink or meson-made symlink 18:42:42
@Ericson2314:matrix.orgJohn Ericson(just don't do something where meson configure needs to be re-run every time a header changes, but I don't think you would do anyways :))18:43:13
@Ericson2314:matrix.orgJohn Ericson Lix uses include_directories(".." / "..") but that is bad for isolating the headers between projects, and fine-grained per package builds 18:44:08
@Ericson2314:matrix.orgJohn Ericson * Also FWIW: Lix uses include_directories(".." / "..") but that is bad for isolating the headers between projects, and fine-grained per package builds 18:44:14
@emilazy:matrix.orgemily I'm just going to use the namespace-polluted headers for now; it's not avoidable anyway since the .pc forces them upon you 18:46:18
@Ericson2314:matrix.orgJohn Ericsonhuh?18:46:37
@Ericson2314:matrix.orgJohn Ericsonfor a specific downstream project?18:46:47
@emilazy:matrix.orgemilyyeah18:46:50
@archercatneo:matrix.orgarchercatneo There's something I was wondering on why it's not done but why couldn't we in step 1 of compilation copy all *.hh files to $dev/include/nix then in the actual compilation do -I $dev/include (and if $dev is not avalible just use the normal meson artifacts dir) 18:47:02
@Ericson2314:matrix.orgJohn EricsonI mean I would not be opposed to backporting the change to get rid of the header polution to 2.2618:47:03
@emilazy:matrix.orgemily as in, <shared.hh> is already taken over anyway, so no point to avoid that by doing <nix/shared.hh> 18:47:08
@emilazy:matrix.orgemilysure, I think it should be fixed18:47:23

Show newer messages


Back to Room ListRoom Version: 6