Skip to content

Commit b7dc5f1

Browse files
authored
Merge pull request #912 from RcppCore/feature/stable-attributes-listing
Sort the files scanned for attributes in the C locale
2 parents 302a371 + c7076cb commit b7dc5f1

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2018-09-18 JJ Allaire <[email protected]>
2+
3+
* R/Attributes.R: Sort the files scanned for attributes in the C locale
4+
for stable output across systems.
5+
16
2018-10-07 Ralf Stubner <[email protected]>
27

38
* vignettes/Rcpp-extending.Rmd: Correct EXPORT to EXPOSED in displays

R/Attributes.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,12 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
424424
# get a list of all source files
425425
cppFiles <- list.files(srcDir, pattern = "\\.((c(c|pp)?)|(h(pp)?))$", ignore.case = TRUE)
426426

427+
# locale independent sort for stable output
428+
locale <- Sys.getlocale(category = "LC_COLLATE")
429+
Sys.setlocale(category = "LC_COLLATE", locale = "C")
430+
cppFiles <- sort(cppFiles)
431+
Sys.setlocale(category = "LC_COLLATE", locale = locale)
432+
427433
# derive base names (will be used for modules)
428434
cppFileBasenames <- tools::file_path_sans_ext(cppFiles)
429435

inst/NEWS.Rd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
test flag (for release versions) inside the container (Dirk).
2020
\item Correct the \code{R CMD check} call to skip vignettes (Dirk).
2121
}
22+
\item Changes in Rcpp Attributes:
23+
\itemize{
24+
\item Sort the files scanned for attributes in the C locale for
25+
stable output across systems.
26+
}
2227
\item Changes in Rcpp Documentation:
2328
\itemize{
2429
\item The 'Rcpp Extending' vignette was corrected and refers to

0 commit comments

Comments
 (0)