You are not logged in.
As has been documented, this package can't be built and run with a modern (newer than 1.22?) Go compiler. I am compiling with Go 1.27. Running "makepkg -sf" works, but the app refuses to run with the following error:
panic: tls: ConnectionState is not equal to tls.ConnectionState: struct field count mismatch: 18 vs 17
goroutine 1 [running]:
github.com/Psiphon-Labs/psiphon-tunnel-core/vendor/github.com/Psiphon-Labs/psiphon-tls.init.0()
github.com/Psiphon-Labs/psiphon-tunnel-core/vendor/github.com/Psiphon-Labs/psiphon-tls/unsafe.go:44 +0xf9The suggested fix at some point (the one I linked) was to disable quic-go, by building with the tag PSIPHON_DISABLE_QUIC. I did it by editing the PKGBUILD to include the following:
# Note the "-tags" argument that, by default, doesn't exist
export GOFLAGS="-buildmode=pie -tags=PSIPHON_DISABLE_QUIC -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"Only now, the build fails with the following error:
'/home/gooseyloosey/Builds/psiphon-tunnel-core/src/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon-tunnel-core-2.0.39' -> '.'
go build -o bin/psiphon-console-client github.com/Psiphon-Labs/psiphon-tunnel-core/ConsoleClient
go build -o bin/psiphon-server github.com/Psiphon-Labs/psiphon-tunnel-core/Server
# github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/server
go/src/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/server/tunnelServer.go:224:5: too many arguments in call to quic.Listen
have (*commonLogger, func(peerAddress string, err error, logFields "github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common".LogFields), string, bool, int, string, bool)
want ("github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common".Logger, func(string, error, "github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common".LogFields), string, int, string, bool)
==> ERROR: A failure occurred in build().
Aborting...The error only happens when building the server. I only want the client, so I was happy with removing the server from the build process by editing the PKGBUILD to comment it out, but the issue is that the client doesn't run again, with the exact same error:
panic: tls: ConnectionState is not equal to tls.ConnectionState: struct field count mismatch: 18 vs 17
goroutine 1 [running]:
github.com/Psiphon-Labs/psiphon-tunnel-core/vendor/github.com/Psiphon-Labs/psiphon-tls.init.0()
github.com/Psiphon-Labs/psiphon-tunnel-core/vendor/github.com/Psiphon-Labs/psiphon-tls/unsafe.go:44 +0xf9Is there hope? Should I contribute to Psiphon now to look into this? Do I shut up and download an older version of the Go compiler?
Offline
PKGBUILD updated to latest release and patches applied for both issues although if I understood correctly you only need the second one (patches generated with LLM assistance)
diff --git a/PKGBUILD b/PKGBUILD
index 77e4220..bbc999e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=('psiphon-console-client' 'psiphon-server')
pkgbase=psiphon-tunnel-core
-pkgver=2.0.39
+pkgver=2.0.41
pkgrel=1
pkgdesc="Psiphon Internet censorship circumvention system."
arch=('i686' 'x86_64')
@@ -11,7 +11,9 @@ url="https://$_gomod"
license=('GPL')
makedepends=('go')
options=(!debug)
-source=("$pkgbase-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
+source=("$pkgbase-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
+ "quic-disabled-Listen-fix.patch"
+ "psiphon-tls-go1.27-ConnectionState.patch")
install=psiphon.install
export GO111MODULE=off
@@ -22,6 +24,17 @@ export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+prepare() {
+ cd "$pkgbase-$pkgver"
+
+ # Fix stale PSIPHON_DISABLE_QUIC stub: quic.Listen gained a
+ # disablePathMTUDiscovery bool parameter.
+ patch -p1 < "$srcdir/quic-disabled-Listen-fix.patch"
+
+ # Go 1.27 added tls.ConnectionState.LocalCertificate.
+ patch -p1 < "$srcdir/psiphon-tls-go1.27-ConnectionState.patch"
+}
+
build() {
function echorun {
echo "$@"
@@ -101,4 +114,6 @@ package_psiphon-server() {
}
# sums
-sha256sums=('fea25d22f808d647c40236ceb90da1654fe814b4c606544bedb915c44c532553')
+sha256sums=('043bc13d77191b84f1b38df8dbaf784fe0219bcc8a6b63928ccca31b08dc7feb'
+ 'b287793546a35a700611821d2bc9a5cbb0d905ca6cbef72ef2d3a1df4195dd04'
+ '03b08f9648a853ebabed244d88a31d8641c4e7883080da088d197b619c4c19da')
diff --git a/psiphon-tls-go1.27-ConnectionState.patch b/psiphon-tls-go1.27-ConnectionState.patch
new file mode 100644
index 0000000..99e0c64
--- /dev/null
+++ b/psiphon-tls-go1.27-ConnectionState.patch
@@ -0,0 +1,14 @@
+--- a/vendor/github.com/Psiphon-Labs/psiphon-tls/common.go
++++ b/vendor/github.com/Psiphon-Labs/psiphon-tls/common.go
+@@ -341,6 +341,11 @@
+ // are a server, or if we received a HelloRetryRequest if we are a client.
+ HelloRetryRequest bool
+
++ // LocalCertificate is the certificate chain presented to the peer, if any,
++ // during the handshake. This field is only populated for connections which
++ // are not resumed (DidResume is false).
++ LocalCertificate [][]byte
++
+ // ekm is a closure exposed via ExportKeyingMaterial.
+ ekm func(label string, context []byte, length int) ([]byte, error)
+
diff --git a/quic-disabled-Listen-fix.patch b/quic-disabled-Listen-fix.patch
new file mode 100644
index 0000000..bb6fc7e
--- /dev/null
+++ b/quic-disabled-Listen-fix.patch
@@ -0,0 +1,10 @@
+--- a/psiphon/common/quic/quic_disabled.go
++++ b/psiphon/common/quic/quic_disabled.go
+@@ -46,6 +46,7 @@
+ _ common.Logger,
+ _ func(string, error, common.LogFields),
+ _ string,
++ _ bool,
+ _ int,
+ _ string,
+ _ bool) (net.Listener, error) {Edit:
I removed changes to move the build closer to Arch's Go package guidelines from the diff as that is a separate issue.
Last edited by loqs (Today 09:00:09)
Offline