diff --git a/.config/cspell/cspell.json b/.config/cspell/cspell.json index 69eb768..67faa75 100644 --- a/.config/cspell/cspell.json +++ b/.config/cspell/cspell.json @@ -3,7 +3,7 @@ "enableGlobDot": true, "useGitignore": true, "gitignoreRoot": ".", - "ignorePaths": ["LICENSE", "*.sum", "go.mod", "local.env"], + "ignorePaths": ["LICENSE", "*.sum", "go.mod", "local.env", ".local/", "patch/"], "words": [ "autorelay", "briandowns", diff --git a/.config/git/ignore b/.config/git/ignore index affa4fb..ad428e2 100644 --- a/.config/git/ignore +++ b/.config/git/ignore @@ -8,8 +8,5 @@ _* local.env node_modules/ -go.work.sum -bin/ -logs/ -coverage/ +go.*work.sum !**/testdata/**/.* diff --git a/docker/Dockerfile b/docker/Dockerfile index 81af882..66965aa 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,7 +15,7 @@ FROM ${TARGETOS}-${TARGETARCH}-${TARGETVARIANT}base ARG TARGETPLATFORM -COPY bin/docker/${TARGETPLATFORM} / +COPY .local/bin/docker/${TARGETPLATFORM} / WORKDIR /data diff --git a/docker/Dockerfile.dockerignore b/docker/Dockerfile.dockerignore index b030b62..7d02504 100644 --- a/docker/Dockerfile.dockerignore +++ b/docker/Dockerfile.dockerignore @@ -1,2 +1,2 @@ * -!bin/docker/ +!.local/bin/docker/ diff --git a/go.vendored.work b/go.vendored.work new file mode 100644 index 0000000..1df0b25 --- /dev/null +++ b/go.vendored.work @@ -0,0 +1,9 @@ +go 1.25.0 + +use ( + ./p2pcp + ./project + ./test +) + +replace github.com/libp2p/go-libp2p => ./.local/vendor/github.com/libp2p/go-libp2p diff --git a/p2pcp/go.mod b/p2pcp/go.mod index 350242d..ee6efdc 100644 --- a/p2pcp/go.mod +++ b/p2pcp/go.mod @@ -131,7 +131,7 @@ require ( go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/exp v0.0.0-20251017212417-90e834f514db // indirect + golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect golang.org/x/mod v0.29.0 // indirect golang.org/x/net v0.46.0 // indirect golang.org/x/sync v0.17.0 // indirect diff --git a/p2pcp/go.sum b/p2pcp/go.sum index 81325c6..a20bf16 100644 --- a/p2pcp/go.sum +++ b/p2pcp/go.sum @@ -425,8 +425,8 @@ golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1m golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20251017212417-90e834f514db h1:by6IehL4BH5k3e3SJmcoNbOobMey2SLpAF79iPOEBvw= -golang.org/x/exp v0.0.0-20251017212417-90e834f514db/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= diff --git a/p2pcp/internal/interrupt/interrupt.go b/p2pcp/internal/interrupt/interrupt.go index d6bdb67..99159ae 100644 --- a/p2pcp/internal/interrupt/interrupt.go +++ b/p2pcp/internal/interrupt/interrupt.go @@ -16,18 +16,13 @@ func RegisterInterruptHandler(ctx context.Context, handler func()) { signal.Notify(sigChan, os.Interrupt) go func() { count := 0 - for { - select { - case <-ctx.Done(): - return - case <-sigChan: - count++ - if count == 1 { - fmt.Println("\nCanceling...") - go handler() - } else { - os.Exit(1) - } + for range sigChan { + count++ + if count == 1 { + fmt.Println("\nCanceling...") + go handler() + } else { + os.Exit(1) } } }() diff --git a/p2pcp/internal/node/mdns.go b/p2pcp/internal/node/mdns.go index f2dc6f1..db8a99f 100644 --- a/p2pcp/internal/node/mdns.go +++ b/p2pcp/internal/node/mdns.go @@ -19,6 +19,7 @@ func (notifee *mdnsNotifee) HandlePeerFound(addrInfo peer.AddrInfo) { slog.Debug("mdns: found new peer.", "peer", addrInfo.ID) err := notifee.host.Connect(notifee.ctx, addrInfo) if err == nil { + slog.Debug("mdns: connected to new peer.", "peer", addrInfo.ID) notifee.host.ConnManager().Protect(addrInfo.ID, "mdns") } } diff --git a/package.json b/package.json index 8399247..17fe9bf 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "update": "go run project update" }, "dependencies": { - "cspell": "^9.2.1", + "cspell": "^9.2.2", "prettier": "^3.6.2", "prettier-plugin-packagejson": "^2.5.19", "prettier-plugin-toml": "^2.0.6" diff --git a/patch/mdns.patch b/patch/mdns.patch new file mode 100644 index 0000000..ce55521 --- /dev/null +++ b/patch/mdns.patch @@ -0,0 +1,187 @@ +--- /go/pkg/mod/github.com/libp2p/go-libp2p@v0.44.0/p2p/discovery/mdns/mdns.go 2025-10-25 10:14:40.301293929 +0000 ++++ /workspaces/p2pcp/.local/temp/mdns.go 2025-10-27 11:28:53.210687076 +0000 +@@ -5,6 +5,7 @@ + "errors" + "io" + "math/rand" ++ "net" + "strings" + "sync" + +@@ -45,7 +46,10 @@ + ctxCancel context.CancelFunc + + resolverWG sync.WaitGroup +- server *zeroconf.Server ++ ++ // Per-interface servers map, keyed by interface IP address ++ servers map[string]*zeroconf.Server ++ serversMux sync.RWMutex + + notifee Notifee + } +@@ -59,6 +63,7 @@ + serviceName: serviceName, + peerName: randomString(32 + rand.Intn(32)), // generate a random string between 32 and 63 characters long + notifee: notifee, ++ servers: make(map[string]*zeroconf.Server), + } + s.ctx, s.ctxCancel = context.WithCancel(context.Background()) + return s +@@ -74,39 +79,40 @@ + + func (s *mdnsService) Close() error { + s.ctxCancel() +- if s.server != nil { +- s.server.Shutdown() ++ ++ s.serversMux.Lock() ++ for _, server := range s.servers { ++ if server != nil { ++ server.Shutdown() ++ } + } ++ s.servers = make(map[string]*zeroconf.Server) ++ s.serversMux.Unlock() ++ + s.resolverWG.Wait() + return nil + } + +-// We don't really care about the IP addresses, but the spec (and various routers / firewalls) require us +-// to send A and AAAA records. +-func (s *mdnsService) getIPs(addrs []ma.Multiaddr) ([]string, error) { +- var ip4, ip6 string ++func groupAddressesByIP(addrs []ma.Multiaddr) map[string][]ma.Multiaddr { ++ addrsByInterface := make(map[string][]ma.Multiaddr) ++ + for _, addr := range addrs { ++ var ip string + first, _ := ma.SplitFirst(addr) + if first == nil { + continue + } +- if ip4 == "" && first.Protocol().Code == ma.P_IP4 { +- ip4 = first.Value() +- } else if ip6 == "" && first.Protocol().Code == ma.P_IP6 { +- ip6 = first.Value() ++ switch first.Protocol().Code { ++ case ma.P_IP4, ma.P_IP6: ++ ip = first.Value() ++ default: ++ continue + } ++ ++ addrsByInterface[ip] = append(addrsByInterface[ip], addr) + } +- ips := make([]string, 0, 2) +- if ip4 != "" { +- ips = append(ips, ip4) +- } +- if ip6 != "" { +- ips = append(ips, ip6) +- } +- if len(ips) == 0 { +- return nil, errors.New("didn't find any IP addresses") +- } +- return ips, nil ++ ++ return addrsByInterface + } + + func (s *mdnsService) startServer() error { +@@ -121,32 +127,73 @@ + if err != nil { + return err + } +- var txts []string +- for _, addr := range addrs { +- if manet.IsThinWaist(addr) { // don't announce circuit addresses +- txts = append(txts, dnsaddrPrefix+addr.String()) +- } +- } +- +- ips, err := s.getIPs(addrs) ++ interfaces, err := net.Interfaces() + if err != nil { + return err + } + +- server, err := zeroconf.RegisterProxy( +- s.peerName, +- s.serviceName, +- mdnsDomain, +- 4001, // we have to pass in a port number here, but libp2p only uses the TXT records +- s.peerName, +- ips, +- txts, +- nil, +- ) +- if err != nil { +- return err ++ addrsByIP := groupAddressesByIP(addrs) ++ ++ s.serversMux.Lock() ++ defer s.serversMux.Unlock() ++ for _, iface := range interfaces { ++ if iface.Flags&(net.FlagUp|net.FlagMulticast) != (net.FlagUp | net.FlagMulticast) { ++ continue ++ } ++ ++ var multiAddrs []ma.Multiaddr ++ var ips []string ++ ifaceAddrs, err := iface.Addrs() ++ if err != nil { ++ log.Debug("failed to get interface addresses", "err", err) ++ continue ++ } ++ for _, addr := range ifaceAddrs { ++ if ipNet, ok := addr.(*net.IPNet); ok { ++ ip := ipNet.IP.String() ++ if ifaceMultiAddrs, ok := addrsByIP[ip]; ok { ++ multiAddrs = append(multiAddrs, ifaceMultiAddrs...) ++ ips = append(ips, ip) ++ } ++ } ++ } ++ ++ // Build TXT records for this interface ++ var txts []string ++ for _, addr := range multiAddrs { ++ if manet.IsThinWaist(addr) { // don't announce circuit addresses ++ txts = append(txts, dnsaddrPrefix+addr.String()) ++ } ++ } ++ ++ if len(txts) == 0 { ++ log.Warn("No valid multiaddrs to announce on interface", "interface", iface.Name) ++ continue ++ } ++ ++ // Register server for this specific interface ++ server, err := zeroconf.RegisterProxy( ++ s.peerName, ++ s.serviceName, ++ mdnsDomain, ++ 4001, // we have to pass in a port number here, but libp2p only uses the TXT records ++ s.peerName, ++ ips, ++ txts, ++ []net.Interface{iface}, // Bind to specific interface ++ ) ++ if err != nil { ++ log.Warn("Failed to register mDNS for interface", "interface", iface.Name, "error", err) ++ continue ++ } ++ ++ s.servers[iface.Name] = server ++ } ++ ++ if len(s.servers) == 0 { ++ return errors.New("failed to register mDNS on any interface") + } +- s.server = server ++ + return nil + } + diff --git a/project/cmd/build/build.go b/project/cmd/build/build.go index 44fd80c..78ea5e9 100644 --- a/project/cmd/build/build.go +++ b/project/cmd/build/build.go @@ -9,10 +9,12 @@ import ( "github.com/spf13/cobra" ) +var vendoredGoWorkPath = filepath.Join(workspace.GetProjectPath(), "go.vendored.work") + func Run() { os.Setenv("CGO_ENABLED", "0") projectPath := workspace.GetProjectPath() - binPath := filepath.Join(projectPath, "bin") + binPath := filepath.Join(projectPath, ".local/bin") // Output binaries for the main module. for _, module := range workspace.GetModules() { @@ -21,6 +23,8 @@ func Run() { if moduleName == project.Name { output = filepath.Join(binPath, moduleName) } + restore := workspace.SetEnv("GOWORK", vendoredGoWorkPath) + defer restore() workspace.Run("go", "build", "-o", output, module) } } diff --git a/project/cmd/build/docker.go b/project/cmd/build/docker.go index 1d382a5..6475d0a 100644 --- a/project/cmd/build/docker.go +++ b/project/cmd/build/docker.go @@ -34,13 +34,15 @@ var platformEnvs = map[string]platformEnv{ } func GetBinariesPath() string { - return filepath.Join(workspace.GetProjectPath(), "bin/docker") + return filepath.Join(workspace.GetProjectPath(), ".local/bin/docker") } func BuildBinaries() { slog.Info("Building multi-arch binaries...") - restore := workspace.SetEnv("CGO_ENABLED", "0") - defer restore() + restoreCgo := workspace.SetEnv("CGO_ENABLED", "0") + defer restoreCgo() + restoreGoWork := workspace.SetEnv("GOWORK", vendoredGoWorkPath) + defer restoreGoWork() projectPath := workspace.GetProjectPath() binariesPath := GetBinariesPath() diff --git a/project/cmd/build/release.go b/project/cmd/build/release.go index be09155..8878c99 100644 --- a/project/cmd/build/release.go +++ b/project/cmd/build/release.go @@ -11,7 +11,7 @@ import ( ) func GetReleaseArtifactsPath() string { - return filepath.Join(workspace.GetProjectPath(), "bin/release") + return filepath.Join(workspace.GetProjectPath(), ".local/bin/release") } func PackBinaries() { @@ -24,7 +24,7 @@ func PackBinaries() { for platform := range platformEnvs { go func() { defer wg.Done() - outputName := strings.Join([]string{project.Name, project.Version, strings.Replace(platform, "/", "_", -1)}, "_") + outputName := strings.Join([]string{project.Name, project.Version, strings.ReplaceAll(platform, "/", "_")}, "_") binaryPath := filepath.Join(binariesPath, platform, project.Name) if strings.HasPrefix(platform, "windows") { diff --git a/project/cmd/codecov/codecov.go b/project/cmd/codecov/codecov.go index 1ead4b2..fcaf529 100644 --- a/project/cmd/codecov/codecov.go +++ b/project/cmd/codecov/codecov.go @@ -11,7 +11,7 @@ var CodecovCommand = &cobra.Command{ Use: "codecov", Run: func(cmd *cobra.Command, args []string) { projectPath := workspace.GetProjectPath() - coverageFile := filepath.Join(projectPath, "coverage/coverage.txt") + coverageFile := filepath.Join(projectPath, ".local/coverage/coverage.txt") commitHash := workspace.GitCommitHash() workspace.Run("codecovcli", "--verbose", "upload-process", "--commit-sha", commitHash, diff --git a/project/cmd/restore/restore.go b/project/cmd/restore/restore.go index 2cd0605..26ed931 100644 --- a/project/cmd/restore/restore.go +++ b/project/cmd/restore/restore.go @@ -16,6 +16,7 @@ var RestoreCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { workspace.Run("uv", "python", "install", "--preview", "--default", pythonVersion) workspace.Run("uv", "tool", "install", "--reinstall", fmt.Sprintf("codecov-cli@%s", codecovVersion)) + for _, module := range workspace.GetModules() { workspace.RunWithChdir(module, "go", "mod", "download") } @@ -37,5 +38,8 @@ var RestoreCmd = &cobra.Command{ "--bootstrap", "--driver-opt", "network=host") } + + vendor() + applyPatches() }, } diff --git a/project/cmd/restore/vendor.go b/project/cmd/restore/vendor.go new file mode 100644 index 0000000..1629c85 --- /dev/null +++ b/project/cmd/restore/vendor.go @@ -0,0 +1,55 @@ +package restore + +import ( + "fmt" + "os" + "path/filepath" + "project/pkg/project" + "project/pkg/workspace" + "strings" +) + +func GetVendorModules() []string { + return []string{ + "github.com/libp2p/go-libp2p@v0.44.0", + } +} + +func vendor() { + projectPath := workspace.GetProjectPath() + + // Delete and recreate vendor directory + vendorPath := filepath.Join(projectPath, ".local", "vendor") + workspace.ResetDir(vendorPath) + setWritable := func() { + workspace.Run("chmod", "--quiet", "--recursive", "u+w", vendorPath) + } + setWritable() + defer setWritable() + + goModCache := workspace.GetOutput("go", "env", "GOMODCACHE") + goModCache = strings.TrimSpace(goModCache) + + tempProjectName := fmt.Sprintf("%s-vendor", project.Name) + tempPath := filepath.Join(os.TempDir(), tempProjectName) + workspace.ResetDir(tempPath) + workspace.RunWithChdir(tempPath, "go", "mod", "init", tempProjectName) + + for _, module := range GetVendorModules() { + workspace.RunWithChdir(tempPath, "go", "get", module) + sourcePath := filepath.Join(goModCache, module) + targetPath := filepath.Join(vendorPath, strings.SplitN(module, "@", 2)[0]) + workspace.Run("mkdir", "--parents", targetPath) + workspace.RunWithChdir(sourcePath, "cp", "--recursive", ".", targetPath) + } +} + +// https://github.com/libp2p/go-libp2p/issues/3415 +func applyPatches() { + projectPath := workspace.GetProjectPath() + vendorPath := filepath.Join(projectPath, ".local", "vendor") + + mdnsPatch := filepath.Join(projectPath, "patch/mdns.patch") + mdnsTarget := filepath.Join(vendorPath, "github.com/libp2p/go-libp2p/p2p/discovery/mdns/mdns.go") + workspace.Run("patch", "--unified", mdnsTarget, mdnsPatch) +} diff --git a/project/cmd/test/setup.go b/project/cmd/test/setup.go index af91fd8..e7dff71 100644 --- a/project/cmd/test/setup.go +++ b/project/cmd/test/setup.go @@ -11,18 +11,19 @@ import ( func setup() { projectPath := workspace.GetProjectPath() - workspace.ResetDir(filepath.Join(projectPath, "bin", "integration")) + binariesPath := filepath.Join(projectPath, ".local/bin/integration") + workspace.ResetDir(binariesPath) os.Setenv("CGO_ENABLED", "0") // Build binary with coverage workspace.Run("go", "build", "-cover", - "-o", filepath.Join(projectPath, "bin", "integration", project.Name), + "-o", filepath.Join(binariesPath, project.Name), filepath.Join(projectPath, project.Name)) // Build test cmd tool workspace.Run("go", "build", - "-o", filepath.Join(projectPath, "bin", "integration", "test"), + "-o", filepath.Join(binariesPath, "test"), filepath.Join(projectPath, "test")) // Build test image diff --git a/project/cmd/test/test.go b/project/cmd/test/test.go index ffad885..7cd3bc1 100644 --- a/project/cmd/test/test.go +++ b/project/cmd/test/test.go @@ -16,8 +16,8 @@ func Run() { workspace.Run("go", "clean", "-testcache") projectPath := workspace.GetProjectPath() - logsPath := filepath.Join(projectPath, "logs/integration") - coveragePath := filepath.Join(projectPath, "coverage") + logsPath := filepath.Join(projectPath, ".local/logs/integration") + coveragePath := filepath.Join(projectPath, ".local/coverage") workspace.ResetDir(coveragePath) workspace.ResetDir(logsPath) diff --git a/project/go.mod b/project/go.mod index 62a2e78..d5db65b 100644 --- a/project/go.mod +++ b/project/go.mod @@ -6,7 +6,7 @@ require ( github.com/go-git/go-git/v5 v5.16.3 github.com/google/go-github/v69 v69.2.0 github.com/spf13/cobra v1.10.1 - golang.org/x/exp v0.0.0-20251017212417-90e834f514db + golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 golang.org/x/mod v0.29.0 ) diff --git a/project/go.sum b/project/go.sum index 0baea2f..32e8f88 100644 --- a/project/go.sum +++ b/project/go.sum @@ -84,8 +84,8 @@ github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= -golang.org/x/exp v0.0.0-20251017212417-90e834f514db h1:by6IehL4BH5k3e3SJmcoNbOobMey2SLpAF79iPOEBvw= -golang.org/x/exp v0.0.0-20251017212417-90e834f514db/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= diff --git a/project/pkg/project/project.go b/project/pkg/project/project.go index bb6a599..24c7cd2 100644 --- a/project/pkg/project/project.go +++ b/project/pkg/project/project.go @@ -2,4 +2,4 @@ package project const Name = "p2pcp" -const Version = "1.1.0" +const Version = "1.2.0" diff --git a/test/go.mod b/test/go.mod index fe5cf67..0b1e243 100644 --- a/test/go.mod +++ b/test/go.mod @@ -9,7 +9,7 @@ require ( github.com/spf13/cobra v1.10.1 github.com/stretchr/testify v1.11.1 golang.org/x/crypto v0.43.0 - google.golang.org/genproto v0.0.0-20251020155222-88f65dc88635 + google.golang.org/genproto v0.0.0-20251022142026-3a174f9686a8 ) require ( @@ -129,7 +129,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect - golang.org/x/exp v0.0.0-20251017212417-90e834f514db // indirect + golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect golang.org/x/mod v0.29.0 // indirect golang.org/x/net v0.46.0 // indirect golang.org/x/sync v0.17.0 // indirect diff --git a/test/go.sum b/test/go.sum index 32b9b15..f7e4643 100644 --- a/test/go.sum +++ b/test/go.sum @@ -436,8 +436,8 @@ golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1m golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20251017212417-90e834f514db h1:by6IehL4BH5k3e3SJmcoNbOobMey2SLpAF79iPOEBvw= -golang.org/x/exp v0.0.0-20251017212417-90e834f514db/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 h1:mgKeJMpvi0yx/sU5GsxQ7p6s2wtOnGAHZWCHUM4KGzY= +golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546/go.mod h1:j/pmGrbnkbPtQfxEe5D0VQhZC6qKbfKifgD0oM7sR70= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -553,8 +553,8 @@ google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20251020155222-88f65dc88635 h1:I5FLgnlmGA5voD3BZp9Rc17FGiius/DlMB3WsJ1C4Xw= -google.golang.org/genproto v0.0.0-20251020155222-88f65dc88635/go.mod h1:1Ic78BnpzY8OaTCmzxJDP4qC9INZPbGZl+54RKjtyeI= +google.golang.org/genproto v0.0.0-20251022142026-3a174f9686a8 h1:a12a2/BiVRxRWIqBbfqoSK6tgq8cyUgMnEI81QlPge0= +google.golang.org/genproto v0.0.0-20251022142026-3a174f9686a8/go.mod h1:1Ic78BnpzY8OaTCmzxJDP4qC9INZPbGZl+54RKjtyeI= google.golang.org/genproto/googleapis/api v0.0.0-20251014184007-4626949a642f h1:OiFuztEyBivVKDvguQJYWq1yDcfAHIID/FVrPR4oiI0= google.golang.org/genproto/googleapis/api v0.0.0-20251014184007-4626949a642f/go.mod h1:kprOiu9Tr0JYyD6DORrc4Hfyk3RFXqkQ3ctHEum3ZbM= google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f h1:1FTH6cpXFsENbPR5Bu8NQddPSaUUE6NA2XdZdDSAJK4= diff --git a/test/internal/docker/compose.go b/test/internal/docker/compose.go index bd984f1..fd1d6ed 100644 --- a/test/internal/docker/compose.go +++ b/test/internal/docker/compose.go @@ -33,7 +33,7 @@ func ComposeDown(ctx context.Context, composeFilePath string) { } func ComposeCollectCoverage(ctx context.Context) { - coveragePath := filepath.Join(workspace.GetProjectPath(), "coverage/integration") + coveragePath := filepath.Join(workspace.GetProjectPath(), ".local/coverage/integration") err := os.MkdirAll(coveragePath, 0755) workspace.Check(err) workspace.RunCtx(ctx, "docker", "cp", "receiver:/coverage/.", coveragePath) @@ -44,7 +44,7 @@ func DumpComposeLogs(ctx context.Context, composeFilePath string, testName strin workspace.Check(err) composeProjectName := filepath.Base(filepath.Dir(composeFilePath)) - logsPath := filepath.Join(workspace.GetProjectPath(), "logs", "integration", testName) + logsPath := filepath.Join(workspace.GetProjectPath(), ".local/logs/integration", testName) workspace.ResetDir(logsPath) filter := filters.NewArgs() diff --git a/test/internal/integration/input_test.go b/test/internal/integration/input_test.go index 2820c78..05a41a2 100644 --- a/test/internal/integration/input_test.go +++ b/test/internal/integration/input_test.go @@ -34,7 +34,7 @@ func runCommand(ctx context.Context, args ...string) (rm func()) { func() { defer func() { recover() - coveragePath := filepath.Join(workspace.GetProjectPath(), "coverage/integration") + coveragePath := filepath.Join(workspace.GetProjectPath(), ".local/coverage/integration") err := os.MkdirAll(coveragePath, 0755) workspace.Check(err) workspace.RunCtx(ctx, "docker", "cp", fmt.Sprintf("%s:/coverage/.", project.Name), coveragePath) diff --git a/test/testdata/integration/test.Dockerfile b/test/testdata/integration/test.Dockerfile index 12f26a5..b513077 100644 --- a/test/testdata/integration/test.Dockerfile +++ b/test/testdata/integration/test.Dockerfile @@ -1,7 +1,7 @@ FROM gcr.io/distroless/static-debian12 -COPY bin/integration/p2pcp /p2pcp -COPY bin/integration/test /test +COPY .local/bin/integration/p2pcp /p2pcp +COPY .local/bin/integration/test /test WORKDIR /data diff --git a/test/testdata/integration/test.Dockerfile.dockerignore b/test/testdata/integration/test.Dockerfile.dockerignore index b329fe4..73f6314 100644 --- a/test/testdata/integration/test.Dockerfile.dockerignore +++ b/test/testdata/integration/test.Dockerfile.dockerignore @@ -1,2 +1,2 @@ * -!bin/integration/ +!.local/bin/integration/