distr1 / distri

a Linux distribution to research fast package management
https://distr1.org
Other
532 stars 28 forks source link

nil pointer dereference if archive is not at ~/distri #54

Open the-maldridge opened 4 years ago

the-maldridge commented 4 years ago

I'm trying to do a batch build of everything from scratch to get a feel for how the build process works, and right now it seems like distri does a hard coded check for its source tree at ~/distri. This is all good and well, but there really doesn't appear to be any error checking around this so a segfault occurs when the source archive is located anywhere else.

I'm happy to debug further, but I'm having trouble figuring out where certain values get initialized. I think that whatever is supposed to provide s.g.Nodes() on line 325 of batch.go isn't handling the bad directory correctly.

stapelberg commented 4 years ago

With a current version of the distri executable, I can’t reproduce this:

When I run distri batch, it complains instead of panicing:

% distri batch  
2020/03/14 19:46:46 distriroot "/root/distri"
batch: open /root/distri/pkgs: no such file or directory

When I set DISTRIROOT, a batch build works (e.g. DISTRIROOT=$HOME/thedistri distri batch)