2021-10-13 18:00:37 +00:00
|
|
|
FROM alpine:3.11 as builder
|
2015-07-23 01:49:26 +00:00
|
|
|
|
2021-10-13 18:00:37 +00:00
|
|
|
# Install utilities, libraries, and dev tools.
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash curl \
|
2022-03-09 00:46:18 +00:00
|
|
|
bsd-compat-headers c-ares-dev linux-headers \
|
2021-10-13 18:00:37 +00:00
|
|
|
build-base git ninja python2 python3
|
2015-07-23 01:49:26 +00:00
|
|
|
|
2022-03-09 00:46:18 +00:00
|
|
|
# Default to python2 because our build system is ancient.
|
|
|
|
RUN ln -sf python2 /usr/bin/python
|
|
|
|
|
2018-12-19 19:45:40 +00:00
|
|
|
# Install depot_tools.
|
2021-10-13 18:00:37 +00:00
|
|
|
WORKDIR /
|
2022-03-09 00:46:18 +00:00
|
|
|
RUN git clone -b chrome/4147 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
|
|
RUN touch depot_tools/.disable_auto_update
|
2018-12-19 19:45:40 +00:00
|
|
|
ENV PATH $PATH:/depot_tools
|
|
|
|
|
2022-03-09 00:46:18 +00:00
|
|
|
# Bypass VPYTHON included by depot_tools. Prefer the system installation.
|
|
|
|
ENV VPYTHON_BYPASS="manually managed python not supported by chrome operations"
|
|
|
|
|
2018-12-19 19:45:40 +00:00
|
|
|
# Alpine uses musl which does not have mallinfo defined in malloc.h. Define the
|
|
|
|
# structure to workaround a Chromium base bug.
|
|
|
|
RUN sed -i \
|
|
|
|
'/malloc_usable_size/a \\nstruct mallinfo {\n int arena;\n int hblkhd;\n int uordblks;\n};' \
|
|
|
|
/usr/include/malloc.h
|
build: Stop using hermetic clang, libc++, etc
This brings our default build config more in line with what is
necessary for some platforms anyway: using the system-installed
toolchain and sysroot to build everything.
We will no longer fetch source or binaries for any specific build
tools, such as libc++, clang, gold, binutils, or valgrind.
The main part of this change is the changing of default gyp settings
in gyp_packager.py. For this, a bug in gyp_packager.py had to be
fixed, in which similar GYP_DEFINE key names (such as clang and
host_clang) would conflict, causing some defaults not to be installed
properly.
In order to enable clang=0 by default, some changes had to be made in
common.gypi:
- compiler macros added to fix a compatibility issue between
Chromium's base/mac/ folder and the actual OSX SDK
- replaced clang_warning_flags variables with standard cflags
settings, plus xcode_settings for OSX
- turned off warnings-as-errors for non-shaka code, rather than
allow-listing specific warning types, since we can't actually fix
those warnings on any platform
- disabled two specific warnings in shaka code, both of which are
caused by headers from our non-shaka dependencies
Also, one warning (missing "override" keyword) has been fixed in
vod_media_info_dump_muxer_listener.h.
Although these changes were done to make building simpler on a wider
array of platforms (arm64, for example), it seems to make the build a
bit faster, too. For me, at least, on my main Linux workstation:
- "gclient sync" now runs 20-30% faster
- "ninja -C out/Release" now runs 5-13% faster
The following environment variables are no longer required:
- DEPOT_TOOLS_WIN_TOOLCHAIN
- MACOSX_DEPLOYMENT_TARGET
Documentation, Dockerfiles, and GitHub Actions workflows have been
updated to reflect this.
The following GYP_DEFINES are no longer required for anyone:
- clang=0
- host_clang=0
- clang_xcode=1
- use_allocator=none
- use_experimental_allocator_shim=0
Documentation, Dockerfiles, and GitHub Actions workflows have been
updated to reflect this.
The following repos are no longer dependencies in gclient:
- binutils
- clang
- gold
- libc++
- libc++abi
- valgrind
The following gclient hooks have been removed:
- clang
- mac_toolchain
- sysroot
Change-Id: Ie94ccbeec722ab73c291cb7df897d20761a09a70
2021-07-28 20:01:19 +00:00
|
|
|
ENV GYP_DEFINES='musl=1'
|
2021-10-13 18:00:37 +00:00
|
|
|
|
|
|
|
# Build shaka-packager from the current directory, rather than what has been
|
|
|
|
# merged.
|
2016-05-17 00:41:02 +00:00
|
|
|
WORKDIR shaka_packager
|
2022-03-07 19:56:34 +00:00
|
|
|
RUN gclient config https://github.com/shaka-project/shaka-packager.git --name=src --unmanaged
|
2018-12-19 19:45:40 +00:00
|
|
|
COPY . src
|
2021-10-13 18:00:37 +00:00
|
|
|
RUN gclient sync --force
|
|
|
|
RUN ninja -C src/out/Release
|
2018-12-19 19:45:40 +00:00
|
|
|
|
|
|
|
# Copy only result binaries to our final image.
|
2021-10-13 18:00:37 +00:00
|
|
|
FROM alpine:3.11
|
2018-12-20 21:26:10 +00:00
|
|
|
RUN apk add --no-cache libstdc++ python
|
2018-12-19 19:45:40 +00:00
|
|
|
COPY --from=builder /shaka_packager/src/out/Release/packager \
|
|
|
|
/shaka_packager/src/out/Release/mpd_generator \
|
2018-12-20 21:26:10 +00:00
|
|
|
/shaka_packager/src/out/Release/pssh-box.py \
|
2018-12-19 19:45:40 +00:00
|
|
|
/usr/bin/
|
2018-12-20 21:26:10 +00:00
|
|
|
# Copy pyproto directory, which is needed by pssh-box.py script. This line
|
|
|
|
# cannot be combined with the line above as Docker's copy command skips the
|
|
|
|
# directory itself. See https://github.com/moby/moby/issues/15858 for details.
|
|
|
|
COPY --from=builder /shaka_packager/src/out/Release/pyproto /usr/bin/pyproto
|