velentr / buildroot.nix

Flake for building Buildroot using nix
3 stars 0 forks source link

Cant generate initial lockfile? #1

Open J-Swift opened 1 month ago

J-Swift commented 1 month ago

Hey, came across your project in a google search and it looks promising! Only problem is when I try to follow the README I get this:

$ nix build .#packages.x86_64-linux.lockfile
warning: Git tree '/Users/jimmy/tmp/batocera.linux' is dirty
error:
       … from call site
         at /nix/store/b44bndr89w6lrn4c5hac6wzw1z26xzpz-source/flake.nix:25:29:
           24|   in {
           25|     lib.mkBuildroot = args: import ./default.nix args;
             |                             ^
           26|

       error: function 'anonymous lambda' called without required argument 'lockfile'
       at /nix/store/b44bndr89w6lrn4c5hac6wzw1z26xzpz-source/default.nix:4:1:
            3| # SPDX-License-Identifier: MIT
            4| {
             | ^
            5|   name,

any ideas? I'm trying to run it against https://github.com/batocera-linux/batocera.linux/

velentr commented 4 weeks ago

I had changed the mkBuildroot function slightly (to enable some possible future features), but neglected to update the README or example flake. I just pushed a fix for the README, let me know if it works for you.

J-Swift commented 4 weeks ago

Got closer : D

Still failing, but it might be because of the structure of that specific project. It fails with

sed: can't read package/util-linux/util-linux.mk: No such file or directory

Which is true, it doesnt exist on the top-level but does exist in the embedded buildroot submodule. I'll keep messing with it to see if I can find anything obvious.

velentr commented 4 weeks ago

You'll need to use src = ./buildroot; (instead of src = self;) as the argument to mkBuildroot to account for this. You also need to build with nix build .?submodules=1#lockfile so nix knows to clone the submodules as well (there's some discussion around using submodules in a flake like this and using .?submodules=1 seems like the easiest way to do this from my quick skimming of those discussions).

I tested this out and hit a bug in my code; I've just pushed a fix and think it should be working now.