From b77004a65aca4c559867429a1a1caffcd9ba3f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Wed, 29 Nov 2023 15:53:06 +0100 Subject: [PATCH] Fix build on Linux Add GHA tests --- .github/workflows/linux.yaml | 67 ++++++++++++++++++++++ .gitignore | 1 + inst/include/bigrquerystorage.h | 1 + src/RcppExports.cpp | 1 + tools/build/linux/Dockerfile-debian-12 | 41 +++++++++++++ tools/build/linux/Dockerfile-fedora-38 | 36 ++++++++++++ tools/build/linux/Dockerfile-ubuntu-22.04 | 41 +++++++++++++ tools/build/linux/rig.gpg | Bin 0 -> 1169 bytes tools/config/configure.R | 4 +- 9 files changed, 189 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/linux.yaml create mode 100644 inst/include/bigrquerystorage.h create mode 100644 tools/build/linux/Dockerfile-debian-12 create mode 100644 tools/build/linux/Dockerfile-fedora-38 create mode 100644 tools/build/linux/Dockerfile-ubuntu-22.04 create mode 100644 tools/build/linux/rig.gpg diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml new file mode 100644 index 0000000..341d637 --- /dev/null +++ b/.github/workflows/linux.yaml @@ -0,0 +1,67 @@ +# Test build on various Linux distros +name: Linux build test + +on: + workflow_dispatch: + inputs: + ubuntu-2204: + description: "Ubuntu 22.04" + required: true + type: choice + options: + - 'yes' + - 'no' + default: 'yes' + debian-12: + description: "Debian 12" + required: true + type: choice + options: + - 'yes' + - 'no' + default: 'yes' + fedora-38: + description: "Fedora 38" + required: true + type: choice + options: + - 'yes' + - 'no' + default: 'yes' + +jobs: + ubuntu-2204: + if: ${{ github.event.inputs.ubuntu-2204 == '' || github.event.inputs.ubuntu-2204 == 'yes' }} + runs-on: ubuntu-latest + name: Ubuntu 22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build in Docker + run: | + docker build -f tools/build/linux/Dockerfile-ubuntu-22.04 -t bqs:ubuntu2204 . + docker run bqs:ubuntu2204 R -q -e 'library(bigrquerystorage)' + + debian-12: + if: ${{ github.event.inputs.debian-12 == '' || github.event.inputs.debian-12 == 'yes' }} + runs-on: ubuntu-latest + name: Debian 12 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build in Docker + run: | + docker build -f tools/build/linux/Dockerfile-debian-12 -t bqs:debian12 . + docker run bqs:debian12 R -q -e 'library(bigrquerystorage)' + + fedora-38: + if: ${{ github.event.inputs.fedora-38 == '' || github.event.inputs.fedora-38 == 'yes' }} + runs-on: ubuntu-latest + name: Fedora 38 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Build in Docker + run: | + docker build -f tools/build/linux/Dockerfile-fedora-38 -t bqs:fedora-38 . + docker run bqs:fedora-38 R -q -e 'library(bigrquerystorage)' diff --git a/.gitignore b/.gitignore index 291e0d2..dd3692e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ src/google/ *.so *.dll .httr-oauth +/src/Makevars diff --git a/inst/include/bigrquerystorage.h b/inst/include/bigrquerystorage.h new file mode 100644 index 0000000..ff7ee49 --- /dev/null +++ b/inst/include/bigrquerystorage.h @@ -0,0 +1 @@ +#include diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index bca2319..c4bf1b7 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,6 +1,7 @@ // Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 +#include "../inst/include/bigrquerystorage.h" #include using namespace Rcpp; diff --git a/tools/build/linux/Dockerfile-debian-12 b/tools/build/linux/Dockerfile-debian-12 new file mode 100644 index 0000000..6143c83 --- /dev/null +++ b/tools/build/linux/Dockerfile-debian-12 @@ -0,0 +1,41 @@ +# -*- Dockerfile -*- + +FROM debian:12 + +# ------------------------------------------------------------------------- +# This is going to use P3M on x86_64 +COPY tools/build/linux/rig.gpg /etc/apt/trusted.gpg.d/rig.gpg +RUN echo "deb http://rig.r-pkg.org/deb rig main" > \ + /etc/apt/sources.list.d/rig.list && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get update -y && \ + apt-get install -y r-rig && \ + rig add release + +# ------------------------------------------------------------------------- +# FIXME: We don't need this once grpc is in the system requirements db +RUN apt-get install -y libprotobuf-dev protobuf-compiler-grpc \ + libgrpc++-dev libc-ares-dev \ + libre2-dev pkg-config + +# ------------------------------------------------------------------------- +# Only copy DESCRIPTION, so Docker can cache the dependency install +RUN mkdir /root/bigrquerystorage +COPY DESCRIPTION /root/bigrquerystorage/ +WORKDIR /root/bigrquerystorage +# No upgrade, to always install binary packages, in case P3M is behind +RUN R -q -e 'pak::local_install_deps(upgrade = FALSE)' + +# ------------------------------------------------------------------------- +# Call R CMD build first, so we get rid of Makevars, .o, .so, etc. +# Change file ownership, otherwise git complains +# Clean up thoroughly, in case the cleanup script is not perfect. +RUN apt-get install -y git +COPY . /root/bigrquerystorage +RUN chown root:root -R . +RUN git clean -fdx . + +# ------------------------------------------------------------------------- +WORKDIR /root +RUN R CMD build bigrquerystorage +RUN R CMD INSTALL bigrquerystorage_*.tar.gz diff --git a/tools/build/linux/Dockerfile-fedora-38 b/tools/build/linux/Dockerfile-fedora-38 new file mode 100644 index 0000000..1ca5d96 --- /dev/null +++ b/tools/build/linux/Dockerfile-fedora-38 @@ -0,0 +1,36 @@ +# -*- Dockerfile -*- + +FROM fedora:38 + +# ------------------------------------------------------------------------- +RUN yum install -y \ + https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm && \ + rig add devel + +# ------------------------------------------------------------------------- +# FIXME: We don't need this once grpc is in the system requirements db +RUN dnf install -y protobuf-devel protobuf-compiler \ + grpc-devel c-ares-devel \ + re2-devel pkgconf + +# ------------------------------------------------------------------------- +# Only copy DESCRIPTION, so Docker can cache the dependency install +RUN mkdir /root/bigrquerystorage +COPY DESCRIPTION /root/bigrquerystorage/ +WORKDIR /root/bigrquerystorage +# No upgrade, to always install binary packages, in case P3M is behind +RUN R -q -e 'pak::local_install_deps(upgrade = FALSE)' + +# ------------------------------------------------------------------------- +# Call R CMD build first, so we get rid of Makevars, .o, .so, etc. +# Change file ownership, otherwise git complains +# Clean up thoroughly, in case the cleanup script is not perfect. +RUN dnf install -y git +COPY . /root/bigrquerystorage +RUN chown root:root -R . +RUN git clean -fdx . + +# ------------------------------------------------------------------------- +WORKDIR /root +RUN R CMD build bigrquerystorage +RUN R CMD INSTALL bigrquerystorage_*.tar.gz diff --git a/tools/build/linux/Dockerfile-ubuntu-22.04 b/tools/build/linux/Dockerfile-ubuntu-22.04 new file mode 100644 index 0000000..6829efb --- /dev/null +++ b/tools/build/linux/Dockerfile-ubuntu-22.04 @@ -0,0 +1,41 @@ +# -*- Dockerfile -*- + +FROM ubuntu:22.04 + +# ------------------------------------------------------------------------- +# This is going to use P3M on x86_64 +COPY tools/build/linux/rig.gpg /etc/apt/trusted.gpg.d/rig.gpg +RUN echo "deb http://rig.r-pkg.org/deb rig main" > \ + /etc/apt/sources.list.d/rig.list && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get update -y && \ + apt-get install -y r-rig && \ + rig add release + +# ------------------------------------------------------------------------- +# FIXME: We don't need this once grpc is in the system requirements db +RUN apt-get install -y libprotobuf-dev protobuf-compiler-grpc \ + libgrpc++-dev libc-ares-dev libre2-dev \ + pkg-config + +# ------------------------------------------------------------------------- +# Only copy DESCRIPTION first, so Docker can cache the dependency install +RUN mkdir /root/bigrquerystorage +COPY DESCRIPTION /root/bigrquerystorage/ +WORKDIR /root/bigrquerystorage +# No upgrade, to always install binary packages, in case P3M is behind +RUN R -q -e 'pak::local_install_deps(upgrade = FALSE)' + +# ------------------------------------------------------------------------- +# Call R CMD build first, so we get rid of Makevars, .o, .so, etc. +# Change file ownership, otherwise git complains +# Clean up thoroughly, in case the cleanup script is not perfect. +RUN apt-get install -y git +COPY . /root/bigrquerystorage +RUN chown root:root -R . +RUN git clean -fdx . + +# ------------------------------------------------------------------------- +WORKDIR /root +RUN R CMD build bigrquerystorage +RUN R CMD INSTALL bigrquerystorage_*.tar.gz diff --git a/tools/build/linux/rig.gpg b/tools/build/linux/rig.gpg new file mode 100644 index 0000000000000000000000000000000000000000..f786450e688830126bff563b59d98634a1054d3a GIT binary patch literal 1169 zcmV;C1aAA80u2OY@+B<+5CG3Hf&L|)lNO+Dgp9t|XhG`Se!)|(Z_lcN)mq=jfz!D^ z$<__}T5#x5;~Yk1y3vE{@3cYwp7eU|%wZ8(d4A{Xo|huVx5if8qHzLZ-i!_<{=hpy zysB|cdJ5Dk$##517?v4wd2`DA!v}6!8k)YIx~A`g=qM`7bH7Z7+&!UiX&WBxOEldW zXyRMe{mE#gmDmkj*a&Y~tE7?_fUgd^mTaMM=op6Kc!Cl-^p|4xT&gEe zACYq*F@Ee<2o~L=hjfk6!Ha58=pTJftg93F^hAg3v`75X9y^jADrQLmEK^mkhWRwP z_Ugc+Gn@!n`WI{=DT&IxcKwL|K0HMebgXj>tm~$%Q9sH-&EkIi3y5`GY43Xo>4J;P zSj#J;o25?wDY% zq8ioX`?r%r_MKWPUXK4&Z{2VqQgAXLnfyox{`qdY9rMv9&UqFqhu-iR^fB3()}h#_ zr1Q?z6f5w~QOmG=a5|W(uk^mI|9|J=FrZJ3zDvX!?m)>(JKUjFs_y}t`7GGx4E=+) zEC$i+q?qvy4F3QT0RRECB}ZXmZ*m|*b7691X&^jfb7691X)b4BVsCOlXKi6=Y%XJO zZ9a(tR|FFQ2mnDAAp}_Cmfn#B*nvVJ@iYYjWb!2~0viJb2?e8?fCUQ) z2nPZJA_4{#3JC}c0t6NU0|5da2Lcy>0162ZEebTf99r=-96b;Je7Yo{xMdDefH!dd z{M_qs((Gsub8GML^*lyghaA<{KfDTJ&e8>xiEa#&v=$J-E$8>@x25mg9WX~U{~GA+ zJ5HM*)2PN})3Kwp1CcMoBuVPwBVF5j=5dKgB1KPRVkaw@srA$+EI>>d78i049J9cF ztrbp&sZ_c=Sa_9q`rt3z*)-z*T2+xREeWDN>ke(u&Q+L?78P*CK9S?6qZPqPC6MMc zHxM#2`R%4?rfhN^OLO#zAyknU#Lwg(Ovp02&H;G(>G{ac*i#8zUsjQ3PViqH=dB-B z>V164PB^i~30`AfDoi_0VMdlj;0cc6)dS9KgY-i!p1<-gD*d;7)c=*{=2kfr2X1 zjYHyYIfv>CG#290@?M)!b3;#ilS^V4=zdw>E`>sjhQ8@B>lQmRbtoXm=Z3x<>LT`=23G%L>_FqRP(0<6 ziK4%p{D2}e7;|-ds|#3u?A73f6s6>{+;i2(cw?lLb1hdaKpFG`LY