Closed godexsoft closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.0%. Comparing base (
86f95b6
) to head (c279139
).
I know nothing about building packages with
nix
so feel free to drop this suggestion, but would it be possible to move.nix
files into a newnix
directory ?
I'd love to. I tried to do so a few weeks back but being a nix noob myself i failed miserably so had to revert it. I'll try again as i'd also prefer the root of the project to remain as uncluttered as possible.
I know nothing about building packages with
nix
so feel free to drop this suggestion, but would it be possible to move.nix
files into a newnix
directory ?I'd love to. I tried to do so a few weeks back but being a nix noob myself i failed miserably so had to revert it. I'll try again as i'd also prefer the root of the project to remain as uncluttered as possible.
So i was able to move most files out of the way and into nix
. But the main flake
and its lockfile apparently need to be at the root of the repo if we want to be able to avoid having to do something like nix build github:libfn/functional?dir=nix#clang
. For the build environment it would probably look like nix develop ./nix#clang
or something but i have not tried.
Let me know if you are ok with the flake in root or if you would like me to do more research on this.
btw., we could totally add all the remaining tooling to the build environment. Stuff like clangd
, clang-tidy
, clang-format
and whatever else we need to develop the library comfortably. But this could also be done in a separate branch later on.
I know nothing about building packages with
nix
so feel free to drop this suggestion, but would it be possible to move.nix
files into a newnix
directory ?I'd love to. I tried to do so a few weeks back but being a nix noob myself i failed miserably so had to revert it. I'll try again as i'd also prefer the root of the project to remain as uncluttered as possible.
So i was able to move most files out of the way and into
nix
. But the mainflake
and its lockfile apparently need to be at the root of the repo if we want to be able to avoid having to do something likenix build github:libfn/functional?dir=nix#clang
. For the build environment it would probably look likenix develop ./nix#clang
or something but i have not tried.Let me know if you are ok with the flake in root or if you would like me to do more research on this.
I'm OK with that.
@godexsoft as you probably noticed, I changed install
targets
@godexsoft there's a problem:
bronekk@aleph ~ % nix run --extra-experimental-features nix-command --extra-experimental-features flakes github:libfn/functional/feature/nix-build
error: unable to execute '/nix/store/x2kbhqgfnbdnr7s7fmk02yncnfv45m9j-libfn/bin/libfn': No such file or directory
@godexsoft there's a problem:
bronekk@aleph ~ % nix run --extra-experimental-features nix-command --extra-experimental-features flakes github:libfn/functional/feature/nix-build error: unable to execute '/nix/store/x2kbhqgfnbdnr7s7fmk02yncnfv45m9j-libfn/bin/libfn': No such file or directory
I think it's because there is nothing to run? We are not installing any executables as far as i know.
When i use nix build github:libfn/functional/feature/nix-build -L
it appears to do what we want. I can see it's now installing to the paths you setup. Once you do a nix build
from the github url it places all outputs into the result
folder on your CWD. You can try to replace run
with build
in your command and maybe add -L
that will produce all the output to the console instead of just one line.
This PR adds support for building and/or developing
libfn
using Nix. Some details on how to get it to do its thing are provided in NIX.md. Hopefully this does not break anything else. At least CI seems happy now and I was able to still build stuff from my devcontainer setup.