SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
19.85k stars 2.36k forks source link

Embedded Tor compile error #614

Closed bart3nder closed 1 year ago

bart3nder commented 1 year ago

Hi! I get an error while compiling with embedded Tor on server, using command:

go install -v -tags with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_gvisor,with_lwip,with_embedded_tor github.com/sagernet/sing-box/cmd/sing-box@latest

Compile Log:

runtime/cgo
net
github.com/gofrs/uuid/v5
crypto/x509
crypto/tls
golang.org/x/net/internal/socket
golang.org/x/net/ipv4
golang.org/x/net/ipv6
github.com/miekg/dns
github.com/oschwald/maxminddb-golang
github.com/sagernet/sing/common/exceptions
github.com/sagernet/sing/common/buf
github.com/sagernet/sing/common/metadata
github.com/sagernet/sing/common/network
net/textproto
vendor/golang.org/x/net/http/httpguts
vendor/golang.org/x/net/http/httpproxy
net/http/httptrace
net/http
github.com/sagernet/sing-dns
github.com/sagernet/sing/common/bufio
github.com/sagernet/sing/common/uot
github.com/sagernet/go-tun2socks/core
github.com/sagernet/netlink/nl
github.com/sagernet/netlink
github.com/sagernet/sing-tun/internal/clashtcpip
github.com/sagernet/sing/common/canceler
github.com/sagernet/sing/common/control
github.com/sagernet/sing/common/udpnat
gvisor.dev/gvisor/pkg/tcpip/adapters/gonet
github.com/sagernet/sing-tun
os/user
github.com/sagernet/sing-box/common/process
github.com/sagernet/sing-box/common/urltest
github.com/sagernet/sing-box/adapter
github.com/sagernet/sing-box/common/dialer/conntrack
github.com/sagernet/quic-go/internal/utils
github.com/quic-go/qtls-go1-20
github.com/sagernet/quic-go/internal/qtls
github.com/sagernet/quic-go/internal/qerr
github.com/sagernet/quic-go/internal/wire
github.com/sagernet/quic-go/logging
github.com/sagernet/quic-go/internal/handshake
github.com/sagernet/quic-go
golang.org/x/net/http/httpguts
github.com/sagernet/quic-go/http3
github.com/sagernet/tfo-go
github.com/sagernet/sing-box/common/dialer
github.com/pires/go-proxyproto
github.com/sagernet/sing-box/common/proxyproto
github.com/sagernet/sing-box/common/redir
github.com/mholt/acmez
github.com/caddyserver/certmagic
github.com/sagernet/cloudflare-tls
github.com/sagernet/reality
github.com/sagernet/sing/common/tls
github.com/sagernet/utls
golang.org/x/net/http2
github.com/sagernet/sing-box/common/tls
github.com/insomniacslk/dhcp/interfaces
github.com/insomniacslk/dhcp/dhcpv4
github.com/sagernet/sing-box/transport/dhcp
github.com/sagernet/sing-box/common/baderror
github.com/sagernet/sing-box/transport/hysteria
github.com/sagernet/sing-box/transport/v2raygrpc/credentials
golang.org/x/net/trace
google.golang.org/grpc/internal/credentials
google.golang.org/grpc/credentials
google.golang.org/grpc/internal/channelz
google.golang.org/grpc/resolver
google.golang.org/grpc/balancer
google.golang.org/grpc/credentials/insecure
google.golang.org/grpc/internal/binarylog
google.golang.org/grpc/internal/resolver/dns
google.golang.org/grpc/internal/syscall
google.golang.org/grpc/peer
google.golang.org/grpc/stats
net/http/httputil
google.golang.org/grpc/internal/transport
google.golang.org/grpc
github.com/sagernet/sing-box/transport/v2raygrpc
github.com/sagernet/sing/protocol/http
golang.org/x/net/http2/h2c
github.com/sagernet/sing-box/transport/v2rayhttp
github.com/sagernet/sing-box/transport/v2raygrpclite
github.com/sagernet/websocket
github.com/sagernet/sing-box/transport/v2raywebsocket
github.com/sagernet/sing-box/transport/v2rayquic
github.com/sagernet/smux
github.com/sagernet/sing-box/transport/trojan
github.com/sagernet/sing-vmess
github.com/sagernet/sing-box/transport/vless
github.com/sagernet/sing-shadowsocks
github.com/sagernet/sing/common/bufio/deadline
github.com/sagernet/sing-shadowsocks/shadowaead
github.com/sagernet/sing-shadowsocks/shadowaead_2022
github.com/sagernet/sing-shadowtls/tls
github.com/sagernet/sing-shadowtls
github.com/sagernet/sing-vmess/packetaddr
github.com/sagernet/sing/protocol/socks
github.com/sagernet/sing-box/inbound
github.com/cretz/bine/process
berty.tech/go-libtor/libtor
# berty.tech/go-libtor/libtor
In file included from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/lib/crypt_ops/crypto_curve25519.h:15,
                 from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/lib/crypt_ops/crypto_ed25519.h:14,
                 from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/core/or/channel.h:15,
                 from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/app/config/config.c:71,
                 from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/linux_tor_src_app_config_config.go:10:
go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/lib/crypt_ops/crypto_openssl_mgt.h:19:10: fatal error: openssl/opensslv.h: No such file or directory
   19 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
github.com/Dreamacro/clash/transport/shadowsocks/shadowaead
github.com/Dreamacro/clash/transport/shadowsocks/shadowstream
github.com/Dreamacro/clash/transport/shadowsocks/core
github.com/Dreamacro/clash/transport/socks5
golang.org/x/net/internal/socks
golang.org/x/net/proxy
github.com/cretz/bine/tor
github.com/hashicorp/yamux
github.com/sagernet/sing-box/common/mux
github.com/sagernet/sing-box/transport/clashssr/obfs
github.com/sagernet/sing-box/transport/clashssr/protocol
github.com/sagernet/sing-box/transport/simple-obfs
github.com/sagernet/sing-box/transport/sip003
github.com/sagernet/wireguard-go/conn
github.com/sagernet/sing-box/transport/wireguard
github.com/sagernet/sing-shadowsocks/shadowstream
github.com/sagernet/wireguard-go/ipc
github.com/sagernet/wireguard-go/device
golang.org/x/crypto/ssh
github.com/sagernet/sing-box/common/sniff
go4.org/netipx
github.com/spf13/pflag
golang.zx2c4.com/wireguard/wgctrl/wgtypes 

Any ideas how to fix it?

loveqianool commented 1 year ago

https://stackoverflow.com/questions/46008624/how-to-fix-fatal-error-openssl-opensslv-h-no-such-file-or-directory-in-redhat

bart3nder commented 1 year ago

Nope, still the same

GOPROXY=https://goproxy.cn go install -v -tags with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_gvisor,with_lwip,with_embedded_tor github.com/sagernet/sing-box/cmd/sing-box@latest
berty.tech/go-libtor/libtor
# berty.tech/go-libtor/libtor
In file included from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/linux_tor_src_app_main_main.go:10:
go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/app/main/main.c:87:10: fatal error: event2/event.h: No such file or directory
   87 | #include <event2/event.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
loveqianool commented 1 year ago

apt-get install libevent-dev

bart3nder commented 1 year ago

New error!

GOPROXY=https://goproxy.cn go install -v -tags with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_gvisor,with_lwip,with_embedded_tor github.com/sagernet/sing-box/cmd/sing-box@latest
berty.tech/go-libtor/libtor
# berty.tech/go-libtor/libtor
In file included from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/lib/tls/tortls_openssl.c:48,
                 from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/linux_tor_src_lib_tls_tortls_openssl.go:10:
go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/lib/tls/tortls_openssl.c:1176:3: error: missing binary operator before token "1"
 1176 |   SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION != 0
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ChaingTsung commented 11 months ago

New error!

GOPROXY=https://goproxy.cn go install -v -tags with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_gvisor,with_lwip,with_embedded_tor github.com/sagernet/sing-box/cmd/sing-box@latest
berty.tech/go-libtor/libtor
# berty.tech/go-libtor/libtor
In file included from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/lib/tls/tortls_openssl.c:48,
                 from go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/linux_tor_src_lib_tls_tortls_openssl.go:10:
go/pkg/mod/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/lib/tls/tortls_openssl.c:1176:3: error: missing binary operator before token "1"
 1176 |   SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION != 0
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Same issue. Have you solved it?

ManicDevs commented 11 months ago

NOBODY DID