Kir-Antipov / outline-cli

🌐 The Free and Open Internet™ right in your terminal.
MIT License
8 stars 1 forks source link

`outline-sdk` won't build #4

Closed jeffangelion closed 1 day ago

jeffangelion commented 4 days ago

Log:

Applying a patch: 'patches/custom-dns-resolver.patch'...
Building 'outline-cli' as 'src/usr/local/sbin/__vpn_connect'...
go: downloading github.com/Jigsaw-Code/outline-sdk v0.0.16
go: downloading github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8
go: downloading github.com/vishvananda/netlink v1.1.0
go: downloading golang.org/x/sys v0.20.0
go: downloading golang.org/x/net v0.25.0
go: downloading github.com/eycorsican/go-tun2socks v1.16.11
go: downloading github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df
go: downloading github.com/shadowsocks/go-shadowsocks2 v0.1.5
go: downloading golang.org/x/crypto v0.23.0
# github.com/Jigsaw-Code/outline-sdk/network/lwip2transport
.cache/go/pkg/mod/github.com/!jigsaw-!code/outline-sdk@v0.0.16/network/lwip2transport/device.go:35:13: undefined: lwip.LWIPStack
.cache/go/pkg/mod/github.com/!jigsaw-!code/outline-sdk@v0.0.16/network/lwip2transport/device.go:83:15: undefined: lwip.NewLWIPStack
.cache/go/pkg/mod/github.com/!jigsaw-!code/outline-sdk@v0.0.16/network/lwip2transport/device.go:90:7: undefined: lwip.RegisterOutputFn
Kir-Antipov commented 4 days ago

Hi! There's nothing wrong with the patch. It appears that the CLI itself won't build on your system for some reason. Which distro are you using, and which Go version did you select for the compilation?

Kir-Antipov commented 4 days ago

That requires CGO_ENABLED=1 and a native C/C++ compiler installed in the system.

Ah, found it. I can replicate the same error if I set CGO_ENABLED=0 during the build.

Do you mind installing gcc on your system?

jeffangelion commented 3 days ago

Do you mind installing gcc on your system?

Well, my server was installed without any development/compilation needs in mind, so it makes sense

However, error is kind of obscure so maybe (or maybe not) script could check if all of dependencies is present

By the way, thanks for your project, looking forward for its maturing

Kir-Antipov commented 2 days ago

However, error is kind of obscure

It absolutely is!

so maybe (or maybe not) script could check if all of dependencies is present

It already does that to some extent:

https://github.com/Kir-Antipov/outline-cli/blob/8acac0bc35499c3f27ed4a76d685c99fd98d45df/install#L540-L542

However, I apparently missed Go's soft dependency on a local C/C++ compiler. Somehow, all the machines I used outline-cli on had gcc installed for one reason or another :D

Frankly, some users may not even know what gcc is and how to install it. So, since the script already has superuser privileges, it can suggest installing missing dependencies automatically, at least for apt, dnf, and pacman users (which covers like 99% of Linux ecosystem).

By the way, thanks for your project, looking forward for its maturing

Thanks a lot! I hope to clean up some things, including this one, in a few days for a new release :)

Kir-Antipov commented 1 day ago

gcc has been added to the list of required dependencies, and since the installation script can now automatically fetch missing dependencies (if permitted, of course), I've been able to successfully and painfully install outline-cli on freshly spun CentOS Stream 9 and Ubuntu 24.04 servers using a single command:

curl -Ls https://github.com/Kir-Antipov/outline-cli/blob/master/install?raw=true | sudo bash -s -- -y