Skip to content

Commit

Permalink
GH-45605: [R][C++] Fix identifier ... preceded by whitespace warnings (
Browse files Browse the repository at this point in the history
…#45606)

### Rationale for this change

Fix warnings, pass on CRAN

### What changes are included in this PR?

Removing some whitespace

### Are these changes tested?

Yes

### Are there any user-facing changes?

No, other than being releasable on CRAN

* GitHub Issue: #45605

Authored-by: Jonathan Keane <[email protected]>
Signed-off-by: Bryce Mecum <[email protected]>
  • Loading branch information
jonkeane authored and amoeba committed Feb 24, 2025
1 parent 3897361 commit c47a022
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
4 changes: 3 additions & 1 deletion ci/scripts/r_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export TEXMFVAR=/tmp/texmf-var
BEFORE=$(ls -alh ~/)

SCRIPT="as_cran <- !identical(tolower(Sys.getenv('NOT_CRAN')), 'true')
if (as_cran) {
# generally will be false, but we can override it by setting SKIP_VIGNETTES=true
skip_vignettes <- identical(tolower(Sys.getenv('SKIP_VIGNETTES')), 'true')
if (as_cran && !skip_vignettes) {
args <- '--as-cran'
build_args <- character()
} else {
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/vendored/datetime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ of the above project.
The following changes are made:
- fix internal inclusion paths (from "date/xxx.h" to simply "xxx.h")
- enclose the `date` namespace inside the `arrow_vendored` namespace
- fix 4 declarations like `CONSTCD11 date::day operator "" _d(unsigned long long d) NOEXCEPT;`
to not have offending whitespace for modern clang:
`CONSTCD11 date::day operator ""_d(unsigned long long d) NOEXCEPT;`

## How to update

Expand Down
8 changes: 4 additions & 4 deletions cpp/src/arrow/vendored/datetime/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const year_month_weekday_last&
inline namespace literals
{

CONSTCD11 date::day operator "" _d(unsigned long long d) NOEXCEPT;
CONSTCD11 date::year operator "" _y(unsigned long long y) NOEXCEPT;
CONSTCD11 date::day operator ""_d(unsigned long long d) NOEXCEPT;
CONSTCD11 date::year operator ""_y(unsigned long long y) NOEXCEPT;

} // inline namespace literals
#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
Expand Down Expand Up @@ -1972,15 +1972,15 @@ inline namespace literals
CONSTCD11
inline
date::day
operator "" _d(unsigned long long d) NOEXCEPT
operator ""_d(unsigned long long d) NOEXCEPT
{
return date::day{static_cast<unsigned>(d)};
}

CONSTCD11
inline
date::year
operator "" _y(unsigned long long y) NOEXCEPT
operator ""_y(unsigned long long y) NOEXCEPT
{
return date::year(static_cast<int>(y));
}
Expand Down
21 changes: 11 additions & 10 deletions dev/tasks/r/github.linux.cran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@

jobs:
as-cran:
name: "rhub/{{ MATRIX }}"
name: "rhub/{{ '${{ matrix.config.r_image }}' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# See https://hub.docker.com/r/rhub
r_image:
- ubuntu-gcc12 # ~ r-devel-linux-x86_64-debian-gcc
- ubuntu-clang # ~ r-devel-linux-x86_64-debian-clang
- ubuntu-next # ~ r-patched-linux-x86_64
- ubuntu-release # ~ r-release-linux-x86_64
config:
# See https://r-hub.github.io/containers/
- { r_image: "ubuntu-gcc12" } # ~ r-devel-linux-x86_64-debian-gcc
- { r_image: "ubuntu-clang" } # ~ r-devel-linux-x86_64-debian-clang
- { r_image: "ubuntu-next" } # ~ r-patched-linux-x86_64
- { r_image: "ubuntu-release" } # ~ r-release-linux-x86_64
- { r_image: "clang20", skip_vignettes: true } # ~ r-devel-linux-x86_64-fedora-clang
env:
R_ORG: "rhub"
R_IMAGE: {{ MATRIX }}
R_IMAGE: {{ '${{ matrix.config.r_image }}' }}
R_TAG: "latest"
ARROW_R_DEV: "FALSE"
steps:
Expand All @@ -46,7 +47,7 @@ jobs:
env:
{{ macros.github_set_sccache_envvars()|indent(8)}}
# setting ARROW_SOURCE_HOME='' here ensures that we use the cpp source copied into tools/
run: archery docker run -e ARROW_SOURCE_HOME='' r
run: archery docker run -e ARROW_SOURCE_HOME='' -e SKIP_VIGNETTES={{ '${{ matrix.config.skip_vignettes }}' }} r
- name: Dump install logs
run: cat arrow/r/check/arrow.Rcheck/00install.out
if: always()
Expand All @@ -57,5 +58,5 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: test-output-{{ "${{ matrix.r_image }}" }}
name: test-output-{{ "${{ matrix.config.r_image }}" }}
path: arrow/r/check/arrow.Rcheck/tests/testthat.Rout*
2 changes: 0 additions & 2 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1198,8 +1198,6 @@ tasks:
test-r-linux-as-cran:
ci: github
template: r/github.linux.cran.yml
params:
MATRIX: {{ "${{ matrix.r_image }}" }}

test-r-macos-as-cran:
ci: github
Expand Down
2 changes: 1 addition & 1 deletion r/src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ std::string fs___SubTreeFileSystem__base_path(

// [[arrow::export]]
cpp11::writable::list fs___FileSystemFromUri(const std::string& path) {
using cpp11::literals::operator"" _nm;
using cpp11::literals::operator""_nm;

std::string out_path;
auto io_context = MainRThread::GetInstance().CancellableIOContext();
Expand Down

0 comments on commit c47a022

Please sign in to comment.