fix: Fix crash in static-linked linux builds
The official, static-linked linux builds were crashing in their use of getaddrinfo, which libcurl was configured to use. Both getaddrinfo and all of its alternatives available in glibc fail with static linking. We can fix this by configuring libcurl to use libc-ares on Linux instead. This allows us to keep the benefits of a statically-linked Linux binary. Closes #996 Change-Id: Ib4a9eb939813fd165727788726459ef4adf3fc4d
This commit is contained in:
parent
9fc3ee1186
commit
e2d66b33fa
|
@ -43,6 +43,15 @@ runs:
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Install c-ares (Linux only)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ runner.os }}" == "Linux" ]]; then
|
||||||
|
echo "::group::Install c-ares"
|
||||||
|
sudo apt install -y libc-ares-dev
|
||||||
|
echo "::endgroup::"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install depot tools
|
- name: Install depot tools
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -12,6 +12,7 @@ for [other distros below](#notes-for-other-linux-distros).
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
|
libc-ares-dev \
|
||||||
build-essential git python python3
|
build-essential git python python3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -243,7 +244,7 @@ Use `apk` command to install dependencies:
|
||||||
```shell
|
```shell
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash curl \
|
bash curl \
|
||||||
bsd-compat-headers linux-headers \
|
bsd-compat-headers c-ares-dev linux-headers \
|
||||||
build-base git ninja python2 python3
|
build-base git ninja python2 python3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -270,6 +271,7 @@ Instead of running `sudo apt-get install` to install build dependencies, run:
|
||||||
```shell
|
```shell
|
||||||
sudo pacman -Sy --needed \
|
sudo pacman -Sy --needed \
|
||||||
core/which \
|
core/which \
|
||||||
|
c-ares \
|
||||||
gcc git python2 python3
|
gcc git python2 python3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -284,7 +286,7 @@ Instead of running `sudo apt-get install` to install build dependencies, run:
|
||||||
```shell
|
```shell
|
||||||
su -c 'yum install -y \
|
su -c 'yum install -y \
|
||||||
which \
|
which \
|
||||||
libatomic \
|
c-ares-devel libatomic \
|
||||||
gcc-c++ git python2'
|
gcc-c++ git python2'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -299,6 +301,7 @@ Use `zypper` command to install dependencies:
|
||||||
```shell
|
```shell
|
||||||
sudo zypper in -y \
|
sudo zypper in -y \
|
||||||
curl which \
|
curl which \
|
||||||
|
c-ares-devel \
|
||||||
gcc-c++ git python python3
|
gcc-c++ git python python3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ FROM alpine:3.11
|
||||||
# Install utilities, libraries, and dev tools.
|
# Install utilities, libraries, and dev tools.
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash curl \
|
bash curl \
|
||||||
bsd-compat-headers linux-headers \
|
bsd-compat-headers c-ares-dev linux-headers \
|
||||||
build-base git ninja python2 python3
|
build-base git ninja python2 python3
|
||||||
|
|
||||||
# Install depot_tools.
|
# Install depot_tools.
|
||||||
|
|
|
@ -3,6 +3,7 @@ FROM archlinux:latest
|
||||||
# Install utilities, libraries, and dev tools.
|
# Install utilities, libraries, and dev tools.
|
||||||
RUN pacman -Sy --needed --noconfirm \
|
RUN pacman -Sy --needed --noconfirm \
|
||||||
core/which \
|
core/which \
|
||||||
|
c-ares \
|
||||||
gcc git python2 python3
|
gcc git python2 python3
|
||||||
|
|
||||||
# Install depot_tools.
|
# Install depot_tools.
|
||||||
|
|
|
@ -3,7 +3,7 @@ FROM centos:8
|
||||||
# Install utilities, libraries, and dev tools.
|
# Install utilities, libraries, and dev tools.
|
||||||
RUN yum install -y \
|
RUN yum install -y \
|
||||||
which \
|
which \
|
||||||
libatomic \
|
c-ares-devel libatomic \
|
||||||
gcc-c++ git python2 python3
|
gcc-c++ git python2 python3
|
||||||
|
|
||||||
# Default to python3.
|
# Default to python3.
|
||||||
|
|
|
@ -4,6 +4,7 @@ FROM debian:9
|
||||||
RUN apt-get update && apt-get install -y apt-utils
|
RUN apt-get update && apt-get install -y apt-utils
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
|
libc-ares-dev \
|
||||||
build-essential git python python3
|
build-essential git python python3
|
||||||
|
|
||||||
# Install depot_tools.
|
# Install depot_tools.
|
||||||
|
|
|
@ -3,7 +3,7 @@ FROM fedora:34
|
||||||
# Install utilities, libraries, and dev tools.
|
# Install utilities, libraries, and dev tools.
|
||||||
RUN yum install -y \
|
RUN yum install -y \
|
||||||
which \
|
which \
|
||||||
libatomic \
|
c-ares-devel libatomic \
|
||||||
gcc-c++ git python2
|
gcc-c++ git python2
|
||||||
|
|
||||||
# Default to python3.
|
# Default to python3.
|
||||||
|
|
|
@ -3,6 +3,7 @@ FROM opensuse/leap:15
|
||||||
# Install utilities, libraries, and dev tools.
|
# Install utilities, libraries, and dev tools.
|
||||||
RUN zypper in -y \
|
RUN zypper in -y \
|
||||||
curl which \
|
curl which \
|
||||||
|
c-ares-devel \
|
||||||
gcc-c++ git python python3
|
gcc-c++ git python python3
|
||||||
|
|
||||||
# Install depot_tools.
|
# Install depot_tools.
|
||||||
|
|
|
@ -4,6 +4,7 @@ FROM ubuntu:18.04
|
||||||
RUN apt-get update && apt-get install -y apt-utils
|
RUN apt-get update && apt-get install -y apt-utils
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
|
libc-ares-dev \
|
||||||
build-essential git python python3
|
build-essential git python python3
|
||||||
|
|
||||||
# Install depot_tools.
|
# Install depot_tools.
|
||||||
|
|
|
@ -37,10 +37,16 @@
|
||||||
'HAVE_CONFIG_H',
|
'HAVE_CONFIG_H',
|
||||||
'CURL_CA_BUNDLE="<!(config/linux/find_curl_ca_bundle.sh)"',
|
'CURL_CA_BUNDLE="<!(config/linux/find_curl_ca_bundle.sh)"',
|
||||||
'USE_OPENSSL',
|
'USE_OPENSSL',
|
||||||
|
'USE_ARES',
|
||||||
],
|
],
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'config/linux',
|
'config/linux',
|
||||||
],
|
],
|
||||||
|
'link_settings': {
|
||||||
|
'libraries': [
|
||||||
|
'-lcares',
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
['OS == "mac"', {
|
['OS == "mac"', {
|
||||||
|
|
Loading…
Reference in New Issue