paleolimbot commented on PR #14930:
URL: https://github.com/apache/arrow/pull/14930#issuecomment-1352058901
Huge goose chase; however, I was able to verify with Docker that this change
does in fact fix the printing of error messages in a non-UTF-8 locale:
Before this PR:
```
deweydunnington@Deweys-MacBook-Air-2 arrow-dev-latin1 % docker run --rm -it
arrow-dev-latin1 bash
root@980fe9cafb13:/# R
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> localeToCharset()
[1] "ISO8859-1"
> arrow::read_csv_arrow("C:/Doesn'tExistButHasAú")
Error: IOError: Failed to open local file 'C:/Doesn'tExistButHasAú'.
Detail: [errno 2] No such file or directory
```
After this PR:
```
deweydunnington@Deweys-MacBook-Air-2 arrow-dev-latin1 % docker run --rm -it
arrow-dev-latin1 bash
root@78db171f1324:/# R
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> arrow::read_csv_arrow("C:/Doesn'tExistButHasAú")
Error: IOError: Failed to open local file 'C:/Doesn'tExistButHasAú'. Detail:
[errno 2] No such file or directory
```
Dockerfile:
```dockerfile
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Halifax
RUN apt-get update && apt-get install -y gcc-12 g++-12 valgrind r-base cmake
git libxml2-dev libcurl4-openssl-dev libssl-dev libgit2-dev libfontconfig1-dev
libfreetype6-dev libharfbuzz-dev libfribidi-dev libpng-dev libtiff5-dev
libjpeg-dev
RUN R -e 'install.packages(c("testthat", "pkgbuild", "cpp11", "R6",
"assertthat", "bit64", "bit", "cli", "ellipsis", "glue", "magrittr", "purrr",
"rlang", "blob", "stringr", "tidyselect", "vctrs", "lubridate", "dplyr",
"hms"), repos = "https://cloud.r-project.org")'
RUN git clone https://github.com/apache/arrow.git /arrow && mkdir
/arrow-build && cd /arrow-build && cmake /arrow/cpp -DARROW_CSV=ON
-DARROW_DATASET=ON -DARROW_FILESYSTEM=ON -DARROW_COMPUTE=ON -DARROW_PARQUET=ON
-DBoost_SOURCE=BUNDLED && cmake --build . && cmake --install . --prefix
/arrow-dist
ENV ARROW_HOME /arrow-dist
ENV LD_LIBRARY_PATH /arrow-dist/lib
# Generate a non-UTF-8 locale and make sure R uses it
RUN apt-get install -y locales && locale-gen en_CA && update-locale en_CA &&
echo 'invisible(Sys.setlocale("LC_ALL", "en_CA"))' > ~/.Rprofile
# Checkout a different fork/commit of the arrow R package. Works as long as
this is
# pretty close to apache/arrow@master but is useful to test the difference
between branches
# without having to rebuild arrow
# for master
# RUN git clone https://github.com/apache/arrow.git /arrow-r && cd /arrow-r
&& git switch master
# for a PR
RUN git clone https://github.com/paleolimbot/arrow.git /arrow-r && cd
/arrow-r && git switch r-path-latin1
RUN cd /arrow-r/r && R CMD INSTALL .
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]