Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-3366: [R] Dockerfile for docker-compose setup #2770

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
fixed failing test in the R package
  • Loading branch information
jameslamb committed Nov 17, 2018
commit dd26d4b972717f202e9c32dd1a4ab748e6764f93
2 changes: 1 addition & 1 deletion ci/docker_build_r.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ R CMD build --keep-empty-dirs .
R CMD INSTALL $(ls | grep arrow_*.tar.gz)

export _R_CHECK_FORCE_SUGGESTS_=false
R CMD check $(ls | grep arrow_*.tar.gz) --as-cran
R CMD check $(ls | grep arrow_*.tar.gz) --as-cran --no-manual

popd
1 change: 1 addition & 0 deletions r/.Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ LICENSE.md
^data-raw$
lint.sh
Dockerfile
.*\.tar\.gz
9 changes: 5 additions & 4 deletions r/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ RUN apt update && \
libgit2-dev \
libssl-dev && \
# install clang to mirror what was done on Travis
apt install -y\
apt install -y \
clang \
clang-format \
clang-tidy && \
# R CMD CHECK --as-cran needs pdflatex to build the package manual
apt install -y \
texlive-latex-base && \
# Install vctrs from Github
Rscript -e "install.packages('devtools', repos = 'http://cran.rstudio.com')" && \
Rscript -e "devtools::install_github('romainfrancois/vctrs@bit64')" && \
Expand All @@ -67,9 +70,7 @@ RUN apt update && \
# Tell R where it can find the source code for arrow
ENV PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/build/cpp/src/arrow
ENV LD_LIBRARY_PATH=/opt/conda/lib/:/build/cpp/src/arrow:/arrow/r/src
env CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"

#export BUILD_DIR=/build/cpp-install
ENV CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"

# build, install, test R package
CMD /arrow/ci/docker_build_cpp.sh && \
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-RecordBatch.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ test_that("read_record_batch handles various streams (ARROW-3450, ARROW-3505)",
batch4 <- read_record_batch(mmap_file)
batch5 <- read_record_batch(bytes)
batch6 <- read_record_batch(buf_reader)
expect_error(read_record_batch(buf_reader))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romainfrancois I believe this PR is now working! However, I want to talk about this test.

I had to remove this to get R CMD CHECK or devtools::test() to complete. I think the issue is that expect_error cannot trap C++ exceptions. When running with this test restored, testing immediately stops with error:

terminate called after throwing an instance of 'std::bad_alloc'
    what():  std::bad_alloc
  Aborted

Have you ever seen that issue with expect_error() before? I tried googling around and nothing obvious jumped out to me. I have no idea how this could be working on Travis but not in my setup on docker :/.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another question is why an exception is being thrown at all

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s what Rcpp::stop does, but this is supposed to be caught by the generated code.

#expect_error(read_record_batch(buf_reader))

stream_reader <- record_batch_stream_reader(bytes)
batch7 <- read_record_batch(stream_reader)
Expand Down