crypto/secp256k1: add workaround for go mod vendor (#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: #20232
pull/21980/head
Steve Ruckdashel 4 years ago committed by GitHub
parent 581c028d18
commit 6a4e730003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      crypto/secp256k1/dummy.go
  2. 7
      crypto/secp256k1/libsecp256k1/contrib/dummy.go
  3. 7
      crypto/secp256k1/libsecp256k1/dummy.go
  4. 7
      crypto/secp256k1/libsecp256k1/include/dummy.go
  5. 7
      crypto/secp256k1/libsecp256k1/src/dummy.go
  6. 7
      crypto/secp256k1/libsecp256k1/src/modules/dummy.go
  7. 7
      crypto/secp256k1/libsecp256k1/src/modules/ecdh/dummy.go
  8. 7
      crypto/secp256k1/libsecp256k1/src/modules/recovery/dummy.go

@ -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"
)

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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
Loading…
Cancel
Save