forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto/secp256k1: add workaround for go mod vendor (ethereum#21735)
Go won't vendor C files if there are no Go files present in the directory. Workaround is to add dummy Go files. Fixes: ethereum#20232
- Loading branch information
1 parent
58bb949
commit 9d27270
Showing
8 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// +build dummy | ||
|
||
// This file is part of a workaround for `go mod vendor` which won't vendor | ||
// C files if there's no Go file in the same directory. | ||
// This would prevent the crypto/secp256k1/libsecp256k1/include/secp256k1.h file to be vendored. | ||
// | ||
// This Go file imports the c directory where there is another dummy.go file which | ||
// is the second part of this workaround. | ||
// | ||
// These two files combined make it so `go mod vendor` behaves correctly. | ||
// | ||
// See this issue for reference: https://github.com/golang/go/issues/26366 | ||
|
||
package secp256k1 | ||
|
||
import ( | ||
_ "github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/include" | ||
_ "github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src" | ||
_ "github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/recovery" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package libsecp256k1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package ecdh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build dummy | ||
|
||
// Package c contains only a C file. | ||
// | ||
// This Go file is part of a workaround for `go mod vendor`. | ||
// Please see the file crypto/secp256k1/dummy.go for more information. | ||
package recovery |