rust-lang / docker-rust

The official Docker images for Rust
436 stars 88 forks source link

OpenSSL when cross-compiling for musl #58

Closed arlyon closed 4 years ago

arlyon commented 4 years ago

This is a continuation of #11

Rust is no longer able to find the OpenSSL headers as early as July 2019 on the latest tag (1.42.0-buster) despite them being there:

➜ docker run --rm rust:latest head /usr/include/openssl/opensslv.h
/*
 * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef HEADER_OPENSSLV_H

According to this issue trying to get rust to know where all the headers are is a pain point.

sfackler commented 4 years ago

If you are cross compiling, you need a copy of OpenSSL built for the target. The image's OpenSSL is linked to glibc, not musl libc.