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 0000000..f786450 Binary files /dev/null and b/tools/build/linux/rig.gpg differ diff --git a/tools/config/configure.R b/tools/config/configure.R index e10fd30..3856a39 100644 --- a/tools/config/configure.R +++ b/tools/config/configure.R @@ -164,7 +164,7 @@ if (mac) { pkg_sources <- sort(dir("./src", ".cpp$|.c$"), decreasing = TRUE) # linker libraries -linker_libs <- system(sprintf("%s --libs protobuf grpc++ openssl", pkg_config), intern = TRUE) +linker_libs <- system(sprintf("%s --libs protobuf grpc++", pkg_config), intern = TRUE) # abseil no longer contains a dynamic_annotations library. brew install # separatly, from Abseil LTS 20200923, Patch 1 @@ -179,8 +179,6 @@ if (mac) { # some windows lib needs to be added manually for building with static openssl if (isTRUE(win)) { linker_libs <- paste(linker_libs, "-lcrypt32 -lws2_32 -limagehlp") -} else { - linker_libs <- paste(linker_libs, "-lupb_collections_lib -lupb_json_lib -lupb_textformat_lib -lupb -lutf8_range_lib -lre2 -lcares -laddress_sorting -lsystemd") } # compiler flags