-
Notifications
You must be signed in to change notification settings - Fork 45
Use minios disk package for cross-platform disk stats #62
Use minios disk package for cross-platform disk stats #62
Conversation
Adding some extra info. Down the path of some dependency imports, the previous step to jump to this repo is the Lotus API using types for its API definitions: see here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to import this without importing the whole minio dependency tree? (or a lighter library?)
Some other lighter packages that I found: Though, it's straightforward enough to just copy the |
go-disk-usage looks good |
Signed-off-by: Sander Pick <sanderpick@gmail.com>
5c386d7
to
3784564
Compare
Okay, migrated to go-disk-usage. |
if err := syscall.Statfs(path, &stat); err != nil { | ||
return FsStat{}, xerrors.Errorf("statfs: %w", err) | ||
} | ||
di := du.NewDiskUsage(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this package doesn't handle the syscall error: https://github.com/ricochet2200/go-disk-usage/blob/master/du/diskusage.go#L16
The same thing is now addressed in https://github.com/filecoin-project/sector-storage/pull/66/files#diff-3edd672f6d345b2738ba957c8bb19960R1 Thanks for the PR anyways |
Done in #66 |
Sure thing ;) |
Textile's powergate has a Lotus dependency. Powergate is leveraged by the hub, which has Linux and Darwin CLI builds. This syscall prevents us from releasing a Window build:
This PR just replaces
syscall.Statfs
withdisk.GetInfo
from https://github.com/minio/minio/tree/release/pkg/disk, which makes a library depending on Lotus compile on Windows.