eggos: cmd/egg: build failure when specifying build path

I tried egg build on something very simple:

(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:16:51
~/tmp/hello-eggos
 130
$ egg build .
2021/08/06 10:16:53 eggos not found in go.mod
2021/08/06 10:16:53 go get github.com/icexin/eggos
go get: added github.com/icexin/eggos v0.4.0
malformed import path "-tags": leading dash
package eggos is not in GOROOT (/usr/local/Cellar/go/1.16/libexec/src/eggos)
2021/08/06 10:18:02 exit status 1
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:18:02
~/tmp/hello-eggos
 1
$ ls -lah
total 2.1M
drwxr-xr-x   6 prologic staff  192 Aug  6 10:18 .
drwxr-xr-x 151 prologic staff 4.8K Aug  6 10:16 ..
-rw-r--r--   1 prologic staff   80 Aug  6 10:18 go.mod
-rw-r--r--   1 prologic staff  98K Aug  6 10:18 go.sum
-rwxr-xr-x   1 prologic staff 2.0M Aug  6 10:16 hello-eggos
-rw-r--r--   1 prologic staff   73 Aug  6 10:16 main.go
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:18:47
~/tmp/hello-eggos
 0
$ cat main.go
package main

import "fmt"

func main() {
	fmt.Println("Hello eggos!")
}
(⎈ |local:default)
prologic@Jamess-iMac
Fri Aug 06 10:18:50
~/tmp/hello-eggos
 0
$ cat go.mod
module hello-eggos

go 1.16

require github.com/icexin/eggos v0.4.0 // indirect

It might be the last 3 lines here:

malformed import path "-tags": leading dash
package eggos is not in GOROOT (/usr/local/Cellar/go/1.16/libexec/src/eggos)
2021/08/06 10:18:02 exit status 1

Bug?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 32 (11 by maintainers)

Most upvoted comments

This is pretty amazing shit you’ve built here btw 😂 I’m loving this! Leet it up! This may very well turn out to be a really really good way of building super secure applications 👌

Absolutely not! I just don’t want to host any of my own code (or forks) on Github anymore, but I will still be a happy participant of open source 😀 – Sorry for the slightly extra work though. Btw my Gitea instance accepts Github OAuth in case that’s convenience fo ryou.

Also I just tries a simple “Hello World” web server and it works!

$ egg run -p 8000:8000
...
Screen Shot 2021-08-06 at 17 08 49 Screen Shot 2021-08-06 at 17 08 59

🎉

@prologic thanks for your contribution. Do you mind if I merge the code into a PR and submit it to GitHub?

It might (with more work) be possible to make egg run and egg test take no arguments and implicitly to some checks, run build if necessary and just automagically workout what the built kernel is.

egg test is actually run like this, it will automatically compile the unit test file, and then run it in qemu.

Interesting in a PR for this?

@prologic welcome!

You can specify qemu parameters after --, such as -- -nographic to make qemu not display the window.

The complete command is as follows

egg run -k hello-eggos -- -nographic

Thanks for the report @prologic

Remove the current path . in the command line, and run egg build directly in the project directory. egg have bugs when specifying the build path. I will try to fix it.