Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (test_mode && is.na(VERSION)) {
dev_version <- package_version(VERSION)[1, 4]

# Small dev versions are added for R-only changes during CRAN submission.
if (is.na(dev_version) || dev_version < 100) {
if (is.na(dev_version) || dev_version < "100") {
VERSION <- package_version(VERSION)[1, 1:3]
arrow_repo <- paste0(getOption("arrow.repo", sprintf("https://apache.jfrog.io/artifactory/arrow/r/%s", VERSION)), "/libarrow/")
} else {
Expand Down
2 changes: 1 addition & 1 deletion r/tools/winlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (!file.exists(sprintf("windows/arrow-%s/include/arrow/api.h", VERSION))) {
dev_version <- package_version(VERSION)[1, 4]

# Small dev versions are added for R-only changes during CRAN submission.
if (is.na(dev_version) || dev_version < 100) {
if (is.na(dev_version) || dev_version < "100") {
Copy link
Member

Choose a reason for hiding this comment

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

Does the logic still work? gt/lt string comparisons can be funky iirc. Maybe we should explicitly convert it to a version object (or what ever it's called)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what was recommended in the email from CRAN, but you're right, i.e. "10" > "2" == FALSE.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, nope, it doesn't matter; because dev_version is a package_version object, it's fine (i.e. in this case testing that a dev version of 10 is higher than the string "2" returns TRUE in the above comparison when done with the right classes)

Copy link
Member Author

Choose a reason for hiding this comment

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

x <- package_version("0.0.0.10")[1, 4]
x
#> [1] '10'
x > 2
#> [1] TRUE

Created on 2023-07-27 with reprex v2.0.2

Copy link
Member

Choose a reason for hiding this comment

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

Ah nice, yay for implicit casts :D

VERSION <- package_version(VERSION)[1, 1:3]
get_file(rwinlib, VERSION)

Expand Down