Skip to content

Commit 4aba23b

Browse files
committed
rebase upstreaming-when
2 parents c2a0f66 + 7fe1e36 commit 4aba23b

File tree

854 files changed

+51211
-13807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

854 files changed

+51211
-13807
lines changed

.android/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM ubuntu:latest
2+
3+
ARG ndk_version=r27c
4+
5+
RUN apt-get update && apt-get install -y \
6+
build-essential \
7+
curl \
8+
cmake \
9+
ninja-build \
10+
python3 \
11+
unzip
12+
13+
RUN curl -o ndk.zip https://dl.google.com/android/repository/android-ndk-${ndk_version}-linux.zip
14+
RUN unzip ndk.zip && mv android-ndk-${ndk_version} /ndk
15+
16+
RUN curl -o capnproto.tar.gz https://capnproto.org/capnproto-c++-0.10.2.tar.gz
17+
RUN mkdir -p /src/capnproto
18+
RUN tar zxf capnproto.tar.gz -C /src/capnproto --strip-components=1
19+
RUN mkdir -p /build/capnproto
20+
RUN cd /build/capnproto
21+
RUN /src/capnproto/configure
22+
RUN make -j$(nproc) install
23+
RUN cd -
24+
25+
RUN mkdir -p /build/rr
26+
RUN chmod 777 /build/rr
27+
28+
WORKDIR /build/rr
29+
CMD ["/bin/bash", "/src/rr/.android/build.sh"]

.android/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Building for Android
2+
3+
To build for Android (from the root of the rr source tree):
4+
5+
```
6+
docker build .android -t rr-android
7+
mkdir -p obj/dist
8+
docker run -it --rm \
9+
-u $UID:$GID \
10+
-v $(pwd):/src/rr \
11+
-v $(pwd)/obj/dist:/dist \
12+
rr-android
13+
```
14+
15+
`-u $UID:GID` ensures that the build runs with your current UID/GID, which is
16+
necessary to avoid the output being only writable by root.
17+
18+
`-v $(pwd):/src/rr` mounts the source tree in the container so it can be built.
19+
20+
`-v $(pwd)/obj/dist:/dist` sets the output directory for the container to the
21+
current directory. The last step of the build will copy the rr tarball to the
22+
directory on the left of `:`.

.android/build.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
set -x
4+
5+
DEVICE_CMAKE_DEFS="-DCMAKE_TOOLCHAIN_FILE=/ndk/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DANDROID_PLATFORM=android-28"
6+
7+
# Build capnp again for the device
8+
INSTALL_PREFIX=$(pwd)/install
9+
mkdir -p $INSTALL_PREFIX
10+
mkdir capnproto-android
11+
cd capnproto-android
12+
cmake -G Ninja \
13+
$DEVICE_CMAKE_DEFS \
14+
-DEXTERNAL_CAPNP=True \
15+
-DBUILD_SHARED_LIBS=True \
16+
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
17+
/src/capnproto
18+
cmake --build .
19+
cmake --install .
20+
cd -
21+
22+
mkdir obj
23+
cd obj
24+
cmake -G Ninja \
25+
$DEVICE_CMAKE_DEFS \
26+
-Ddisable32bit=True \
27+
-DBUILD_TESTS=False \
28+
-DCMAKE_FIND_ROOT_PATH=$INSTALL_PREFIX \
29+
-DSKIP_PKGCONFIG=True \
30+
-DEXTRA_VERSION_STRING="$BUILD_ID" \
31+
-DZLIB_LDFLAGS=-lz \
32+
-DEXTRA_EXTERNAL_SOLIBS="/build/rr/capnproto-android/src/kj/libkj.so;/build/rr/capnproto-android/src/capnp/libcapnp.so" \
33+
/src/rr
34+
cmake --build .
35+
cpack -G TGZ
36+
37+
cp dist/* /dist/

.buildkite/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test.yml
2+
test-*.yml

0 commit comments

Comments
 (0)