gokrazy / tools

this repository contains the gok CLI tool of gokrazy
https://gokrazy.org
BSD 3-Clause "New" or "Revised" License
50 stars 26 forks source link

Relative paths cause issue in gok's --parent_dir #50

Closed damdo closed 1 year ago

damdo commented 1 year ago

Yesterday I noticed that this commit https://github.com/gokrazy/tools/commit/7b9dd260c5be1381673582f1faf07805278c56f1 slightly changed the behaviour of gok.

gok -i foo --parent_dir=./..

A relative path to the parent_dir, in fact, used to work for me, but now it doesn't seem to. Using an absolute path as a temporary workaround fixes the issue for me.

An excerpt from the issue:

Including loadable kernel modules from:
/Users/ddonati/go/pkg/mod/github.com/gokrazy-community/kernel-rpi-os-32@v1.0.2-5.15.84/dist/lib/modules
2023/03/12 12:17:35 Error: build directory "../gokrazy-tmp3/builddir/github.com/gokrazy/gokrazy/cmd/ntp" does not exist in "/Users/ddonati/src/private/infra/metal/gokrazy/gokrazy-tmp3/builddir/github.com/gokrazy/gokrazy/cmd/dhcp"
Try 'gok -i gokrazy-tmp3 add github.com/gokrazy/gokrazy/cmd/ntp' followed by an update.
Afterwards, your 'gok sbom' command should work: chdir ../gokrazy-tmp3/builddir/github.com/gokrazy/gokrazy/cmd/ntp: no such file or directory

Here is how to reproduce it: https://gist.github.com/damdo/0782d2c980c8e2cb14e1aee84c546aed

stapelberg commented 1 year ago

Should be fixed now, let me know if you still run into issues :)

damdo commented 1 year ago

Works well :) thanks!