Skip to content

Commit 1719d77

Browse files
Merge branch 'reprovide-sweep' into reprovide-sweep-enabled
2 parents 1981a63 + 72b66b3 commit 1719d77

File tree

16 files changed

+80
-98
lines changed

16 files changed

+80
-98
lines changed

.github/workflows/gotest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
make -j "$PARALLEL" test/unit/gotest.junit.xml &&
4646
[[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
4747
- name: Upload coverage to Codecov
48-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
48+
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
4949
if: failure() || success()
5050
with:
5151
name: unittests

.github/workflows/sharness.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
# increasing parallelism beyond 10 doesn't speed up the tests much
5656
PARALLEL: ${{ github.repository == 'ipfs/kubo' && 10 || 3 }}
5757
- name: Upload coverage report
58-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
58+
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
5959
if: failure() || success()
6060
with:
6161
name: sharness

cmd/ipfs/kubo/daemon.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,15 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
284284
default:
285285
return err
286286
case fsrepo.ErrNeedMigration:
287+
migrationDone := make(chan struct{})
288+
go func() {
289+
select {
290+
case <-req.Context.Done():
291+
os.Exit(1)
292+
case <-migrationDone:
293+
}
294+
}()
295+
287296
domigrate, found := req.Options[migrateKwd].(bool)
288297

289298
// Get current repo version for more informative message
@@ -299,6 +308,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
299308
if !found {
300309
domigrate = YesNoPrompt("Run migrations now? [y/N]")
301310
}
311+
close(migrationDone)
302312

303313
if !domigrate {
304314
fmt.Printf("Not running migrations on repository at %s. Re-run daemon with --migrate or see 'ipfs repo migrate --help'\n", cctx.ConfigRoot)

cmd/ipfs/util/signal.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,7 @@ func SetupInterruptHandler(ctx context.Context) (io.Closer, context.Context) {
6464
switch count {
6565
case 1:
6666
fmt.Println() // Prevent un-terminated ^C character in terminal
67-
68-
ih.wg.Add(1)
69-
go func() {
70-
defer ih.wg.Done()
71-
cancelFunc()
72-
}()
73-
67+
cancelFunc()
7468
default:
7569
fmt.Println("Received another interrupt before graceful shutdown, terminating...")
7670
os.Exit(-1)

cmd/ipfswatch/main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"syscall"
1414

1515
commands "github.com/ipfs/kubo/commands"
16+
"github.com/ipfs/kubo/config"
1617
core "github.com/ipfs/kubo/core"
1718
coreapi "github.com/ipfs/kubo/core/coreapi"
1819
corehttp "github.com/ipfs/kubo/core/corehttp"
@@ -25,10 +26,18 @@ import (
2526

2627
var (
2728
http = flag.Bool("http", false, "expose IPFS HTTP API")
28-
repoPath = flag.String("repo", os.Getenv("IPFS_PATH"), "IPFS_PATH to use")
29+
repoPath *string
2930
watchPath = flag.String("path", ".", "the path to watch")
3031
)
3132

33+
func init() {
34+
ipfsPath, err := config.PathRoot()
35+
if err != nil {
36+
ipfsPath = os.Getenv(config.EnvDir)
37+
}
38+
repoPath = flag.String("repo", ipfsPath, "repo path to use")
39+
}
40+
3241
func main() {
3342
flag.Parse()
3443

core/commands/sysdiag.go

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package commands
22

33
import (
44
"os"
5-
"path"
65
"runtime"
76

7+
"github.com/ipfs/go-ipfs-cmds"
88
version "github.com/ipfs/kubo"
9+
"github.com/ipfs/kubo/config"
910
"github.com/ipfs/kubo/core"
1011
cmdenv "github.com/ipfs/kubo/core/commands/cmdenv"
11-
12-
cmds "github.com/ipfs/go-ipfs-cmds"
1312
manet "github.com/multiformats/go-multiaddr/net"
1413
sysi "github.com/whyrusleeping/go-sysinfo"
1514
)
@@ -84,32 +83,28 @@ func runtimeInfo(out map[string]interface{}) error {
8483
func envVarInfo(out map[string]interface{}) error {
8584
ev := make(map[string]interface{})
8685
ev["GOPATH"] = os.Getenv("GOPATH")
87-
ev["IPFS_PATH"] = os.Getenv("IPFS_PATH")
86+
ev[config.EnvDir] = os.Getenv(config.EnvDir)
8887

8988
out["environment"] = ev
9089
return nil
9190
}
9291

93-
func ipfsPath() string {
94-
p := os.Getenv("IPFS_PATH")
95-
if p == "" {
96-
p = path.Join(os.Getenv("HOME"), ".ipfs")
97-
}
98-
return p
99-
}
100-
10192
func diskSpaceInfo(out map[string]interface{}) error {
102-
di := make(map[string]interface{})
103-
dinfo, err := sysi.DiskUsage(ipfsPath())
93+
pathRoot, err := config.PathRoot()
94+
if err != nil {
95+
return err
96+
}
97+
dinfo, err := sysi.DiskUsage(pathRoot)
10498
if err != nil {
10599
return err
106100
}
107101

108-
di["fstype"] = dinfo.FsType
109-
di["total_space"] = dinfo.Total
110-
di["free_space"] = dinfo.Free
102+
out["diskinfo"] = map[string]interface{}{
103+
"fstype": dinfo.FsType,
104+
"total_space": dinfo.Total,
105+
"free_space": dinfo.Free,
106+
}
111107

112-
out["diskinfo"] = di
113108
return nil
114109
}
115110

docs/examples/kubo-as-a-library/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ go 1.25
77
replace github.com/ipfs/kubo => ./../../..
88

99
require (
10-
github.com/ipfs/boxo v0.34.1-0.20250827083005-8b6d074957d4
10+
github.com/ipfs/boxo v0.34.1-0.20250908112856-e66b18d8aa7f
1111
github.com/ipfs/kubo v0.0.0-00010101000000-000000000000
1212
github.com/libp2p/go-libp2p v0.43.0
1313
github.com/multiformats/go-multiaddr v0.16.1
@@ -83,7 +83,6 @@ require (
8383
github.com/ipfs/go-ds-measure v0.2.2 // indirect
8484
github.com/ipfs/go-ds-pebble v0.5.1 // indirect
8585
github.com/ipfs/go-fs-lock v0.1.1 // indirect
86-
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
8786
github.com/ipfs/go-ipfs-ds-help v1.1.1 // indirect
8887
github.com/ipfs/go-ipfs-pq v0.0.3 // indirect
8988
github.com/ipfs/go-ipfs-redirects-file v0.1.2 // indirect

docs/examples/kubo-as-a-library/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.25.0 h1:OqNqsGZPX8zh3eFMO8Lf8EHRRnSGBMqcd
289289
github.com/ipfs-shipyard/nopfs/ipfs v0.25.0/go.mod h1:BxhUdtBgOXg1B+gAPEplkg/GpyTZY+kCMSfsJvvydqU=
290290
github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
291291
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
292-
github.com/ipfs/boxo v0.34.1-0.20250827083005-8b6d074957d4 h1:q6q06Ye71ZZjM/JZyK0Q8t0UVSwzch/VwMS9yTtxBfw=
293-
github.com/ipfs/boxo v0.34.1-0.20250827083005-8b6d074957d4/go.mod h1:rXql6ncaLZZfLqDG3Cuw9ZYQKd3rMU5bk1TGXF0+ZL0=
292+
github.com/ipfs/boxo v0.34.1-0.20250908112856-e66b18d8aa7f h1:KBd0A0ScHnjVpg50cfmigbkKxUMDAC69CaY2qlTUgY8=
293+
github.com/ipfs/boxo v0.34.1-0.20250908112856-e66b18d8aa7f/go.mod h1:rXql6ncaLZZfLqDG3Cuw9ZYQKd3rMU5bk1TGXF0+ZL0=
294294
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
295295
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
296296
github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk=

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/hashicorp/go-version v1.7.0
2323
github.com/ipfs-shipyard/nopfs v0.0.14
2424
github.com/ipfs-shipyard/nopfs/ipfs v0.25.0
25-
github.com/ipfs/boxo v0.34.1-0.20250827083005-8b6d074957d4
25+
github.com/ipfs/boxo v0.34.1-0.20250908112856-e66b18d8aa7f
2626
github.com/ipfs/go-block-format v0.2.2
2727
github.com/ipfs/go-cid v0.5.0
2828
github.com/ipfs/go-cidutil v0.1.0
@@ -147,7 +147,6 @@ require (
147147
github.com/huin/goupnp v1.3.0 // indirect
148148
github.com/ipfs/bbloom v0.0.4 // indirect
149149
github.com/ipfs/go-bitfield v1.1.0 // indirect
150-
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
151150
github.com/ipfs/go-ipfs-ds-help v1.1.1 // indirect
152151
github.com/ipfs/go-ipfs-pq v0.0.3 // indirect
153152
github.com/ipfs/go-ipfs-redirects-file v0.1.2 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.25.0 h1:OqNqsGZPX8zh3eFMO8Lf8EHRRnSGBMqcd
356356
github.com/ipfs-shipyard/nopfs/ipfs v0.25.0/go.mod h1:BxhUdtBgOXg1B+gAPEplkg/GpyTZY+kCMSfsJvvydqU=
357357
github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
358358
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
359-
github.com/ipfs/boxo v0.34.1-0.20250827083005-8b6d074957d4 h1:q6q06Ye71ZZjM/JZyK0Q8t0UVSwzch/VwMS9yTtxBfw=
360-
github.com/ipfs/boxo v0.34.1-0.20250827083005-8b6d074957d4/go.mod h1:rXql6ncaLZZfLqDG3Cuw9ZYQKd3rMU5bk1TGXF0+ZL0=
359+
github.com/ipfs/boxo v0.34.1-0.20250908112856-e66b18d8aa7f h1:KBd0A0ScHnjVpg50cfmigbkKxUMDAC69CaY2qlTUgY8=
360+
github.com/ipfs/boxo v0.34.1-0.20250908112856-e66b18d8aa7f/go.mod h1:rXql6ncaLZZfLqDG3Cuw9ZYQKd3rMU5bk1TGXF0+ZL0=
361361
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
362362
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
363363
github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk=

0 commit comments

Comments
 (0)