Skip to content

Commit 3dc0131

Browse files
authored
fix it (#882)
1 parent f15cc0d commit 3dc0131

File tree

2 files changed

+79
-12
lines changed

2 files changed

+79
-12
lines changed

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ FFI_DEPS:=$(addprefix $(FFI_PATH),$(FFI_DEPS))
1111
$(FFI_DEPS): build/.filecoin-install ;
1212

1313
# When enabled, build size-optimized libfilcrypto by default
14-
#CURIO_OPTIMAL_LIBFILCRYPTO ?= 1
15-
# Unfortunately, this breaks GPU detection, so disabling for now.
16-
CURIO_OPTIMAL_LIBFILCRYPTO = 0
17-
14+
CURIO_OPTIMAL_LIBFILCRYPTO ?= 1
1815
CGO_LDFLAGS_ALLOW_PATTERN := (-Wl,--whole-archive|-Wl,--no-as-needed|-Wl,--no-whole-archive|-Wl,--allow-multiple-definition|--whole-archive|--no-as-needed|--no-whole-archive|--allow-multiple-definition)
1916
CGO_LDFLAGS_ALLOW ?= "$(CGO_LDFLAGS_ALLOW_PATTERN)"
2017
export CGO_LDFLAGS_ALLOW
@@ -133,6 +130,9 @@ test: test-deps
133130

134131
CURIO_TAGS ?= cunative nofvm
135132

133+
# Convert space-separated tags to comma-separated for GOFLAGS (which is whitespace-split)
134+
CURIO_TAGS_CSV := $(shell echo "$(CURIO_TAGS)" | tr ' ' ',')
135+
136136
ifeq ($(shell uname),Linux)
137137
curio: CGO_LDFLAGS_ALLOW='.*'
138138
endif
@@ -271,10 +271,10 @@ cu2k: CURIO_TAGS+= 2k
271271
cu2k: curio
272272

273273
cfgdoc-gen:
274-
$(GOCC) run ./deps/config/cfgdocgen > ./deps/config/doc_gen.go
274+
$(GOCC) run $(GOFLAGS) -tags="$(CURIO_TAGS)" ./deps/config/cfgdocgen > ./deps/config/doc_gen.go
275275

276276
fix-imports:
277-
$(GOCC) run ./scripts/fiximports
277+
$(GOCC) run $(GOFLAGS) -tags="$(CURIO_TAGS)" ./scripts/fiximports
278278

279279
docsgen: docsgen-md docsgen-openrpc
280280
@echo "FixImports will run only from the 'make gen' target"
@@ -285,7 +285,7 @@ docsgen-md: docsgen-md-curio
285285
.PHONY: docsgen-md
286286

287287
api-gen:
288-
$(GOCC) run ./api/gen/api/proxygen.go
288+
$(GOCC) run $(GOFLAGS) -tags="$(CURIO_TAGS)" ./api/gen/api/proxygen.go
289289
@echo "FixImports will run only from the 'make gen' target"
290290
.PHONY: api-gen
291291

@@ -301,7 +301,7 @@ docsgen-md-curio: docsgen-md-bin
301301
.PHONY: api-gen
302302

303303
docsgen-md-bin: api-gen
304-
$(GOCC) build $(GOFLAGS) -o docgen-md ./scripts/docgen/cmd
304+
$(GOCC) build $(GOFLAGS) -tags="$(CURIO_TAGS)" -o docgen-md ./scripts/docgen/cmd
305305
@echo "FixImports will run only from the 'make gen' target"
306306
.PHONY: docsgen-md-bin
307307

@@ -310,7 +310,7 @@ docsgen-openrpc: docsgen-openrpc-curio
310310
.PHONY: docsgen-openrpc
311311

312312
docsgen-openrpc-bin: api-gen
313-
$(GOCC) build $(GOFLAGS) -o docgen-openrpc ./api/docgen-openrpc/cmd
313+
$(GOCC) build $(GOFLAGS) -tags="$(CURIO_TAGS)" -o docgen-openrpc ./api/docgen-openrpc/cmd
314314

315315
docsgen-openrpc-curio: docsgen-openrpc-bin
316316
./docgen-openrpc "api/api_curio.go" "Curio" "api" "./api" > build/openrpc/curio.json
@@ -329,7 +329,7 @@ docsgen-cli: curio sptool
329329
.PHONY: docsgen-cli
330330

331331
go-generate:
332-
CGO_LDFLAGS_ALLOW=$(CGO_LDFLAGS_ALLOW) $(GOCC) generate ./...
332+
CGO_LDFLAGS_ALLOW=$(CGO_LDFLAGS_ALLOW) GOFLAGS='$(GOFLAGS) -tags=$(CURIO_TAGS_CSV)' $(GOCC) generate ./...
333333
.PHONY: go-generate
334334

335335
gen: gensimple
@@ -354,12 +354,12 @@ endif
354354
$(MAKE) docsgen
355355
$(MAKE) marketgen
356356
$(MAKE) docsgen-cli
357-
$(GOCC) run ./scripts/fiximports
357+
$(GOCC) run $(GOFLAGS) -tags="$(CURIO_TAGS)" ./scripts/fiximports
358358
go mod tidy
359359
.PHONY: gensimple
360360

361361
fiximports:
362-
$(GOCC) run ./scripts/fiximports
362+
$(GOCC) run $(GOFLAGS) -tags="$(CURIO_TAGS)" ./scripts/fiximports
363363
.PHONY: fiximports
364364

365365
forest-test: GOFLAGS+=-tags=forest

lib/supraffi/seal_nonlinux.go

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,76 @@
22

33
package supraffi
44

5+
import "fmt"
6+
57
// TreeRFile builds tree-r from a last-layer file (optionally with a staged data file).
68
// Used for snap updates, does not require NVMe devices.
79
// This is a stub implementation for non-Linux platforms.
810
func TreeRFile(lastLayerFilename, dataFilename, outputDir string, sectorSize uint64) int {
911
panic("TreeRFile: supraseal is only available on Linux")
1012
}
13+
14+
// GetHealthInfo retrieves health information for all NVMe devices.
15+
// This is a stub implementation for non-Linux platforms.
16+
func GetHealthInfo() ([]HealthInfo, error) {
17+
return nil, fmt.Errorf("GetHealthInfo: supraseal is only available on Linux")
18+
}
19+
20+
// SupraSealInit initializes the supra seal with a sector size and optional config file.
21+
// This is a stub implementation for non-Linux platforms.
22+
func SupraSealInit(sectorSize uint64, configFile string) {
23+
panic("SupraSealInit: supraseal is only available on Linux")
24+
}
25+
26+
// Pc1 performs the pc1 operation for batch sealing.
27+
// This is a stub implementation for non-Linux platforms.
28+
func Pc1(blockOffset uint64, replicaIDs [][32]byte, parentsFilename string, sectorSize uint64) int {
29+
panic("Pc1: supraseal is only available on Linux")
30+
}
31+
32+
type Path struct {
33+
Replica string
34+
Cache string
35+
}
36+
37+
// GenerateMultiString generates a //multi// string from an array of Path structs.
38+
// This is a stub implementation for non-Linux platforms.
39+
func GenerateMultiString(paths []Path) (string, error) {
40+
return "", fmt.Errorf("GenerateMultiString: supraseal is only available on Linux")
41+
}
42+
43+
// Pc2 performs the pc2 operation for batch sealing.
44+
// This is a stub implementation for non-Linux platforms.
45+
func Pc2(blockOffset uint64, numSectors int, outputDir string, sectorSize uint64) int {
46+
panic("Pc2: supraseal is only available on Linux")
47+
}
48+
49+
// C1 performs the c1 operation for batch sealing.
50+
// This is a stub implementation for non-Linux platforms.
51+
func C1(blockOffset uint64, numSectors, sectorSlot int, replicaID, seed, ticket []byte, cachePath, parentsFilename, replicaPath string, sectorSize uint64) int {
52+
panic("C1: supraseal is only available on Linux")
53+
}
54+
55+
// GetMaxBlockOffset returns the highest available block offset from NVMe devices.
56+
// This is a stub implementation for non-Linux platforms.
57+
func GetMaxBlockOffset(sectorSize uint64) uint64 {
58+
panic("GetMaxBlockOffset: supraseal is only available on Linux")
59+
}
60+
61+
// GetSlotSize returns the size in blocks required for the given number of sectors.
62+
// This is a stub implementation for non-Linux platforms.
63+
func GetSlotSize(numSectors int, sectorSize uint64) uint64 {
64+
panic("GetSlotSize: supraseal is only available on Linux")
65+
}
66+
67+
// GetCommR returns comm_r after calculating from p_aux file. Returns true on success.
68+
// This is a stub implementation for non-Linux platforms.
69+
func GetCommR(commR []byte, cachePath string) bool {
70+
panic("GetCommR: supraseal is only available on Linux")
71+
}
72+
73+
// CheckAndSetupSPDK prepares SPDK hugepages and environment.
74+
// This is a stub implementation for non-Linux platforms.
75+
func CheckAndSetupSPDK(nrHuge int, minPages int) error {
76+
return fmt.Errorf("CheckAndSetupSPDK: supraseal/SPDK is only available on Linux")
77+
}

0 commit comments

Comments
 (0)