classification
Title: hashlib: build fails when blake2 is disabled in OpenSSL
Type: compile error Stage: resolved
Components: Build, SSL Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: Alexandru Ardelean, christian.heimes, miss-islington
Priority: normal Keywords: patch

Created on 2019-11-04 12:24 by Alexandru Ardelean, last changed 2019-11-06 06:14 by christian.heimes. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17043 merged Alexandru Ardelean, 2019-11-04 12:35
PR 17044 merged miss-islington, 2019-11-04 14:56
Messages (4)
msg355940 - (view) Author: Alexandru Ardelean (Alexandru Ardelean) * Date: 2019-11-04 12:24
This was caught via OpenWrt's build, when upgrading to 3.8.
By default, Blake2 is not enabled in OpenWrt's OpenSSL.
Not sure if this is an issue in OpenSSL or Python or both.

After digging through the _hashopenssl.c, it seems that the check for Blake2 being enabled/present in OpenSSL is not consistent with how OpenSSL does it.

The build error is:

86_64-openwrt-linux-musl-gcc -shared -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -znow -zrelro -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -znow -zrelro -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -znow -zrelro -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0=Python-3.8.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DNDEBUG -fno-inline -I/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/include -I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/include -I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/include/fortify -I/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/include build/temp.linux2-3.8/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_curses_panel.o -L. -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/target-x86_64_musl/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/usr/lib -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/lib -L/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0 -L/home/sandu/work/openwrt/openwrt/staging_dir/toolchain-x86_64_gcc-8.3.0_musl/x86_64-openwrt-linux-musl/lib -lpanelw -lncursesw -o build/lib.linux2-3.8/_curses_panel.cpython-38.so
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c: In function 'py_digest_by_name':
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:220:22: error: implicit declaration of function 'EVP_blake2s256'; did you mean 'SN_blake2s256'? [-Werror=implicit-function-declaration]
             digest = EVP_blake2s256();
                      ^~~~~~~~~~~~~~
                      SN_blake2s256
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:220:20: warning: assignment to 'const EVP_MD *' {aka 'const struct evp_md_st *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
             digest = EVP_blake2s256();
                    ^
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:223:22: error: implicit declaration of function 'EVP_blake2b512'; did you mean 'LN_blake2b512'? [-Werror=implicit-function-declaration]
             digest = EVP_blake2b512();
                      ^~~~~~~~~~~~~~
                      LN_blake2b512
/home/sandu/work/openwrt/openwrt/build_dir/target-x86_64_musl/Python-3.8.0/Modules/_hashopenssl.c:223:20: warning: assignment to 'const EVP_MD *' {aka 'const struct evp_md_st *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
             digest = EVP_blake2b512();
                    ^
msg355946 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-11-04 14:56
New changeset 6552563b3d5061816720a5a6c7d4ffd6ba35b98b by Christian Heimes (Alexandru Ardelean) in branch 'master':
bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (#17043)
https://github.com/python/cpython/commit/6552563b3d5061816720a5a6c7d4ffd6ba35b98b
msg356099 - (view) Author: miss-islington (miss-islington) Date: 2019-11-06 06:10
New changeset 7c20888e71304ecbf4bd3d595f364b7c691d30a0 by Miss Islington (bot) in branch '3.8':
bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (GH-17043)
https://github.com/python/cpython/commit/7c20888e71304ecbf4bd3d595f364b7c691d30a0
msg356100 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-11-06 06:14
Thanks!
History
Date User Action Args
2019-11-06 06:14:43christian.heimessetstatus: open -> closed
type: compile error
messages: + msg356100

resolution: fixed
stage: patch review -> resolved
2019-11-06 06:10:10miss-islingtonsetnosy: + miss-islington
messages: + msg356099
2019-11-04 14:56:22miss-islingtonsetpull_requests: + pull_request16557
2019-11-04 14:56:02christian.heimessetmessages: + msg355946
2019-11-04 12:35:48Alexandru Ardeleansetkeywords: + patch
stage: patch review
pull_requests: + pull_request16556
2019-11-04 12:24:10Alexandru Ardeleancreate