Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto/secp256k1: add workaround for go mod vendor #21735

Merged
merged 2 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions crypto/secp256k1/dummy.go
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"
)
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/contrib/dummy.go
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
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/dummy.go
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
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/include/dummy.go
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
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/src/dummy.go
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
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/src/modules/dummy.go
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
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go
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
7 changes: 7 additions & 0 deletions crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go
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