bud icon indicating copy to clipboard operation
bud copied to clipboard

`bud build` and `bud run` add bogus entry to `go.mod`

Open vito opened this issue 3 years ago • 1 comments

I think this started happening with pretty recent changes - I'm using v0.1.9:

diff --git a/go.mod b/go.mod
index feb9af9..69e8957 100644
--- a/go.mod
+++ b/go.mod
@@ -136,3 +136,5 @@ require (
 
 // keep in sync with upstream buildkit
 replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible
+
+replace github.com/livebud/bud => /home/vito/go/pkg/mod/github.com/livebud/[email protected]

This has an absolute path on my dev machine so I have to avoid accidentally committing it.

vito avatar Jul 02 '22 17:07 vito

Ahh, I can see that being annoying. This happens when using the latest version of bud, so not one of the releases: https://github.com/livebud/bud/blob/f3872335de4f45ae51453ff5082e1ad16c38343a/internal/cli/bud/bud.go#L149-L168

Some context: I originally added this when testing Bass Loop before releasing v0.1.9 to test that Bud continued to work. The runtime had breaking changes so testing the latest CLI with Bud's runtime fixed within Bass Loop's go.mod to an earlier version was causing errors.

I'm not sure what the right solution is here. Originally it did nothing on latest: https://github.com/livebud/bud/blob/e4c96b51b08e979e7a7bdfa921c778633f5275e9/internal/cli/bud/bud.go#L150-L153

Maybe default do nothing, but support a --link or --dev flag?

Update: What seems best is if you could tweak the replace with an environment variable or flag instead of modifying go.mod each time go run is called. There might be a way to do this.

matthewmueller avatar Jul 02 '22 18:07 matthewmueller