Skip to content

Commit a01a812

Browse files
authored
GH-45605: [R][C++] Fix identifier ... preceded by whitespace warnings (#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]>
1 parent d59a736 commit a01a812

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

ci/scripts/r_test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export TEXMFVAR=/tmp/texmf-var
9191
BEFORE=$(ls -alh ~/)
9292

9393
SCRIPT="as_cran <- !identical(tolower(Sys.getenv('NOT_CRAN')), 'true')
94-
if (as_cran) {
94+
# generally will be false, but we can override it by setting SKIP_VIGNETTES=true
95+
skip_vignettes <- identical(tolower(Sys.getenv('SKIP_VIGNETTES')), 'true')
96+
if (as_cran && !skip_vignettes) {
9597
args <- '--as-cran'
9698
build_args <- character()
9799
} else {

cpp/src/arrow/vendored/datetime/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ of the above project.
2323
The following changes are made:
2424
- fix internal inclusion paths (from "date/xxx.h" to simply "xxx.h")
2525
- enclose the `date` namespace inside the `arrow_vendored` namespace
26+
- fix 4 declarations like `CONSTCD11 date::day operator "" _d(unsigned long long d) NOEXCEPT;`
27+
to not have offending whitespace for modern clang:
28+
`CONSTCD11 date::day operator ""_d(unsigned long long d) NOEXCEPT;`
2629

2730
## How to update
2831

cpp/src/arrow/vendored/datetime/date.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,8 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const year_month_weekday_last&
963963
inline namespace literals
964964
{
965965

966-
CONSTCD11 date::day operator "" _d(unsigned long long d) NOEXCEPT;
967-
CONSTCD11 date::year operator "" _y(unsigned long long y) NOEXCEPT;
966+
CONSTCD11 date::day operator ""_d(unsigned long long d) NOEXCEPT;
967+
CONSTCD11 date::year operator ""_y(unsigned long long y) NOEXCEPT;
968968

969969
} // inline namespace literals
970970
#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
@@ -1972,15 +1972,15 @@ inline namespace literals
19721972
CONSTCD11
19731973
inline
19741974
date::day
1975-
operator "" _d(unsigned long long d) NOEXCEPT
1975+
operator ""_d(unsigned long long d) NOEXCEPT
19761976
{
19771977
return date::day{static_cast<unsigned>(d)};
19781978
}
19791979

19801980
CONSTCD11
19811981
inline
19821982
date::year
1983-
operator "" _y(unsigned long long y) NOEXCEPT
1983+
operator ""_y(unsigned long long y) NOEXCEPT
19841984
{
19851985
return date::year(static_cast<int>(y));
19861986
}

dev/tasks/r/github.linux.cran.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121

2222
jobs:
2323
as-cran:
24-
name: "rhub/{{ MATRIX }}"
24+
name: "rhub/{{ '${{ matrix.config.r_image }}' }}"
2525
runs-on: ubuntu-latest
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
# See https://hub.docker.com/r/rhub
30-
r_image:
31-
- ubuntu-gcc12 # ~ r-devel-linux-x86_64-debian-gcc
32-
- ubuntu-clang # ~ r-devel-linux-x86_64-debian-clang
33-
- ubuntu-next # ~ r-patched-linux-x86_64
34-
- ubuntu-release # ~ r-release-linux-x86_64
29+
config:
30+
# See https://r-hub.github.io/containers/
31+
- { r_image: "ubuntu-gcc12" } # ~ r-devel-linux-x86_64-debian-gcc
32+
- { r_image: "ubuntu-clang" } # ~ r-devel-linux-x86_64-debian-clang
33+
- { r_image: "ubuntu-next" } # ~ r-patched-linux-x86_64
34+
- { r_image: "ubuntu-release" } # ~ r-release-linux-x86_64
35+
- { r_image: "clang20", skip_vignettes: true } # ~ r-devel-linux-x86_64-fedora-clang
3536
env:
3637
R_ORG: "rhub"
37-
R_IMAGE: {{ MATRIX }}
38+
R_IMAGE: {{ '${{ matrix.config.r_image }}' }}
3839
R_TAG: "latest"
3940
ARROW_R_DEV: "FALSE"
4041
steps:
@@ -46,7 +47,7 @@ jobs:
4647
env:
4748
{{ macros.github_set_sccache_envvars()|indent(8)}}
4849
# setting ARROW_SOURCE_HOME='' here ensures that we use the cpp source copied into tools/
49-
run: archery docker run -e ARROW_SOURCE_HOME='' r
50+
run: archery docker run -e ARROW_SOURCE_HOME='' -e SKIP_VIGNETTES={{ '${{ matrix.config.skip_vignettes }}' }} r
5051
- name: Dump install logs
5152
run: cat arrow/r/check/arrow.Rcheck/00install.out
5253
if: always()
@@ -57,5 +58,5 @@ jobs:
5758
if: always()
5859
uses: actions/upload-artifact@v4
5960
with:
60-
name: test-output-{{ "${{ matrix.r_image }}" }}
61+
name: test-output-{{ "${{ matrix.config.r_image }}" }}
6162
path: arrow/r/check/arrow.Rcheck/tests/testthat.Rout*

dev/tasks/tasks.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,6 @@ tasks:
11541154
test-r-linux-as-cran:
11551155
ci: github
11561156
template: r/github.linux.cran.yml
1157-
params:
1158-
MATRIX: {{ "${{ matrix.r_image }}" }}
11591157

11601158
test-r-macos-as-cran:
11611159
ci: github

r/src/filesystem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ std::string fs___SubTreeFileSystem__base_path(
258258

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

263263
std::string out_path;
264264
auto io_context = MainRThread::GetInstance().CancellableIOContext();

0 commit comments

Comments
 (0)