Skip to content

Commit 9b9e7cc

Browse files
authored
all: add build tags for wasip1 (#31090)
1 parent 9bc8256 commit 9b9e7cc

File tree

10 files changed

+54
-16
lines changed

10 files changed

+54
-16
lines changed

cmd/utils/diskusage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build !windows && !openbsd
18-
// +build !windows,!openbsd
17+
//go:build !windows && !openbsd && !wasip1
18+
// +build !windows,!openbsd,!wasip1
1919

2020
package utils
2121

crypto/kzg4844/kzg4844_ckzg_cgo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build ckzg && !nacl && !js && cgo && !gofuzz
17+
//go:build ckzg && !nacl && !js && !wasip1 && cgo && !gofuzz
1818

1919
package kzg4844
2020

crypto/kzg4844/kzg4844_ckzg_nocgo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build !ckzg || nacl || js || !cgo || gofuzz
17+
//go:build !ckzg || nacl || js || wasip1 || !cgo || gofuzz
1818

1919
package kzg4844
2020

crypto/signature_cgo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build !nacl && !js && cgo && !gofuzz
18-
// +build !nacl,!js,cgo,!gofuzz
17+
//go:build !nacl && !js && !wasip1 && cgo && !gofuzz
18+
// +build !nacl,!js,!wasip1,cgo,!gofuzz
1919

2020
package crypto
2121

crypto/signature_nocgo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build nacl || js || !cgo || gofuzz
18-
// +build nacl js !cgo gofuzz
17+
//go:build nacl || js || wasip1 || !cgo || gofuzz
18+
// +build nacl js wasip1 !cgo gofuzz
1919

2020
package crypto
2121

ethdb/leveldb/leveldb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build !js
18-
// +build !js
17+
//go:build !js && !wasip1
18+
// +build !js,!wasip1
1919

2020
// Package leveldb implements the key-value database layer based on LevelDB.
2121
package leveldb

metrics/cpu_disabled.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build ios || js
18-
// +build ios js
17+
//go:build ios || js || wasip1
18+
// +build ios js wasip1
1919

2020
package metrics
2121

metrics/cpu_enabled.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build !ios && !js
18-
// +build !ios,!js
17+
//go:build !ios && !js && !wasip1
18+
// +build !ios,!js,!wasip1
1919

2020
package metrics
2121

metrics/cputime_unix.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// You should have received a copy of the GNU Lesser General Public License
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

17-
//go:build !windows && !js
18-
// +build !windows,!js
17+
//go:build !windows && !js && !wasip1
18+
// +build !windows,!js,!wasip1
1919

2020
package metrics
2121

rpc/ipc_wasip1.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2018 The go-ethereum Authors
2+
// This file is part of the go-ethereum library.
3+
//
4+
// The go-ethereum library is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Lesser General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// The go-ethereum library is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Lesser General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Lesser General Public License
15+
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
16+
17+
//go:build wasip1
18+
// +build wasip1
19+
20+
package rpc
21+
22+
import (
23+
"context"
24+
"errors"
25+
"net"
26+
)
27+
28+
var errNotSupported = errors.New("rpc: not supported")
29+
30+
// ipcListen will create a named pipe on the given endpoint.
31+
func ipcListen(endpoint string) (net.Listener, error) {
32+
return nil, errNotSupported
33+
}
34+
35+
// newIPCConnection will connect to a named pipe with the given endpoint as name.
36+
func newIPCConnection(ctx context.Context, endpoint string) (net.Conn, error) {
37+
return nil, errNotSupported
38+
}

0 commit comments

Comments
 (0)