fix: disable psiphon when building with go1.19 (#871)
Part of https://github.com/ooni/probe/issues/2211. See also https://github.com/ooni/probe/issues/2222, which describes the issue we have with psiphon and go1.19.
This commit is contained in:
parent
9ffa124511
commit
208ffa253b
26 changed files with 113 additions and 37 deletions
|
|
@ -1,5 +1,13 @@
|
|||
//go:build !go1.19
|
||||
|
||||
package tunnel
|
||||
|
||||
//
|
||||
// Psiphon not working with go1.19
|
||||
//
|
||||
// TODO(https://github.com/ooni/probe/issues/2222)
|
||||
//
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
|
@ -11,6 +19,13 @@ import (
|
|||
"github.com/ooni/psiphon/tunnel-core/ClientLibrary/clientlib"
|
||||
)
|
||||
|
||||
// mockableStartPsiphon allows us to test for psiphon startup failures.
|
||||
var mockableStartPsiphon = func(
|
||||
ctx context.Context, config []byte, workdir string) (*clientlib.PsiphonTunnel, error) {
|
||||
return clientlib.StartTunnel(ctx, config, "", clientlib.Parameters{
|
||||
DataRootDirectory: &workdir}, nil, nil)
|
||||
}
|
||||
|
||||
// psiphonTunnel is a psiphon tunnel
|
||||
type psiphonTunnel struct {
|
||||
// bootstrapTime is the bootstrapTime of the bootstrap
|
||||
|
|
@ -53,7 +68,7 @@ func psiphonStart(ctx context.Context, config *Config) (Tunnel, DebugInfo, error
|
|||
return nil, debugInfo, err
|
||||
}
|
||||
start := time.Now()
|
||||
tunnel, err := config.startPsiphon(ctx, configJSON, workdir)
|
||||
tunnel, err := mockableStartPsiphon(ctx, configJSON, workdir)
|
||||
if err != nil {
|
||||
return nil, debugInfo, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue