Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

decrease required go version to 1.12 #29

Closed
wants to merge 1 commit into from

Conversation

oleg-jukovec
Copy link

The error occurs when trying to build the library using go < 1.16:
./alloc.go:14:10: unrecognized Go type _Ctype_void
./alloc.go:16:21: unrecognized Go type _Ctype_void

This is an unnecessary restriction. It can be fixed by replacing
*C.void with unsafe.Pointer (as it is already done for ptr argument of
CRYPTO_EX_free[1][2]).

  1. https://www.openssl.org/docs/manmaster/man3/SSL_get_ex_new_index.html
  2. https://www.openssl.org/docs/man3.0/man3/CRYPTO_EX_free.html

Related to #18

Motivation:

I want to use the library with go 1.13.

Before the fix:

$ go version
go version go1.12.17 linux/amd64
$ go test
# github.com/libp2p/go-openssl
./alloc.go:14:10: unrecognized Go type _Ctype_void
./alloc.go:16:21: unrecognized Go type _Ctype_void
./alloc.go:14:10: unrecognized Go type _Ctype_void
./alloc.go:16:21: unrecognized Go type _Ctype_void
FAIL	github.com/libp2p/go-openssl [build failed]

After the fix:

$ go version
go version go1.12.17 linux/amd64
$ go test .
ok  	github.com/oleg-jukovec/go-openssl	4.333s

The error occurs when trying to build the library using go < 1.16:
./alloc.go:14:10: unrecognized Go type _Ctype_void
./alloc.go:16:21: unrecognized Go type _Ctype_void

This is an unnecessary restriction. It can be fixed by replacing
*C.void with unsafe.Pointer (as it is already done for `ptr` argument of
CRYPTO_EX_free[1][2]).

1. https://www.openssl.org/docs/manmaster/man3/SSL_get_ex_new_index.html
2. https://www.openssl.org/docs/man3.0/man3/CRYPTO_EX_free.html

Related to libp2p#18
@MarcoPolo
Copy link

Can you use Go 1.17 or 1.18 instead? We, like the Go team with its own security policies, only support the last two major releases of Go.

Closing this as wontfix, but thanks for figuring out a workaround for folks who may find this in the future.

@MarcoPolo MarcoPolo closed this Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants