-
Notifications
You must be signed in to change notification settings - Fork 3.9k
ARROW-3759: [R][CI] Build and test (no libarrow) on Windows in Appveyor #4538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
#4471 is driven by the configure script, which is ignored on windows |
|
This is ready for review now. This adds the foundations for building the R package on Windows and on Appveyor, and it adds an Appveyor job to check the R package without the C++ library. This includes some refactoring of the configure script (adding Getting the R package to use the C++ library built from source will require integrating the scripts and workflow described there; IIUC we can't just use the C++ library that our current appveyor scripts build and have to compile with the Rtools toolchain. Given that that will be a bit of work, I'd like to separate that effort and get this piece merged now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems OK, the title of the PR is a bit misleading since the R unit tests aren't actually being run in Appveyor yet
| ["-VERSION = #{@release_version}", | ||
| "+VERSION = #{@release_version}.9000"], | ||
| ], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these changes about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 00-prepare.sh does not modify Makevars.win anymore, the generation of this file is now deferred at installation (@nealrichardson please confirm) via the added configure.win.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch makes Makevars.win be generated dynamically, so there's no longer a file that needs to be updated in the release scripts.
|
Title revised--that was the ticket title and original scope, but as I got into it, it made sense to stop short of the grand goal in this iteration. FTR it is running the R package checks, including tests; all tests that require libarrow are skipped, but we are testing that conditional skipping behavior and that the package successfully builds if libarrow isn't found. This fallback behavior is not working on Windows on master, and this PR fixes that. It is important that this behavior work, if for no other reason than to prevent a flaky build failure (on CRAN or elsewhere). |
| echo "*** Writing Makevars.win" | ||
| sed -e "s|@cflags@|$PKG_CFLAGS|" -e "s|@libs@|$PKG_LIBS|" src/Makevars.in > src/Makevars.win | ||
| # Success | ||
| exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small bash nit, exit 0 does not need to be explicited since it's implicit that a script returns 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copypasta from r/configure 🤷♂
| ["-VERSION = #{@release_version}", | ||
| "+VERSION = #{@release_version}.9000"], | ||
| ], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 00-prepare.sh does not modify Makevars.win anymore, the generation of this file is now deferred at installation (@nealrichardson please confirm) via the added configure.win.
| VERSION=$(grep ^Version DESCRIPTION | sed s/Version:\ //) | ||
| "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "tools/winlibs.R" $VERSION | ||
|
|
||
| if [ $? -ne 0 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected? And should you exit immediately if this failure is encountered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools/winlibs.R will exit nonzero if https://github.com/apache/arrow/pull/4538/files/328bc376f9adb2717d1505f96d8d7452ee9d8212#diff-48db18073973d5ea65a7f0023f920145R22 fails to find and download a prebuilt binary. This triggers the fallback build-package-without-libarrow behavior (see #4471).
I can add some comments to explain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok now I understand more clearly. I think this warrants a comment or clearer message, e.g.
"Failed to download and extract libarrow runtime and dependencies. The R arrow package will compile with shim methods. Please run arrow::install_arrow() to install required runtime libraries and recompile this package with proper support."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or separate this message in half, one for users, and a comment for maintainers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed some comments
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| VERSION = 0.13.0.9000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kou did something go wrong, I'd expect the version to be 0.14.0.9000. This is the values Rust and Java uses for example. This should apply to DESCRIPTION.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.13.0.9000 is "correct" (here at least) for the dev version after 0.13 before 0.14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so the inverse of Java?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently so? IDK, the version math makes more sense to me the way that this is done in the R community, 0.13.0 < 0.13.0.9000 < 0.14.0. I'm not familiar with how Java handles this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.13.0.9000 is correct.
Rust and Java use 0.14.0-SNAPSHOT. They don't use 0.14.0.9000.
We use X.Y.Z-SNAPSHOT for languages that support PRE release by tag ("SNAPSHOT").
R doesn't support tag. So we use ".9000". ".9000" is commonly used in R.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cf. http://r-pkgs.had.co.nz/release.html for the R convention.
|
+1 |
This is very much a work-in-progress for running the R package tests on Appveyor. It's an attempt to bring in the "standard" R Appveyor build tooling (https://github.com/krlmlr/r-appveyor, Apache 2.0 licensed) into Arrow's configuration.
I currently have the C++ library building and installing, and R and all R package dependencies installing, and R checks beginning, but they fail. This is because https://github.com/apache/arrow/blob/master/r/tools/winlibs.R is configured only to build with a released [sic] version of the arrow C++ binaries pre-built and hosted on rwinlib. Two immediate to-dos are:
After that, I can reverse-engineer what appveyor does and document it for any Windows developers (https://issues.apache.org/jira/browse/ARROW-3758).
There's obviously some mess I've made of appveyor.yml that I'll clean up before I'm done, and I'll do my best to document and refactor some of the non-obvious features of the setup that I've discovered (e.g. that
ci/appveyor-cpp-build-mingw.batalso installs GLib and Ruby and runs their test suites too) while I'm at it so that the next person might be able to pick things up faster.cc @romainfrancois @javierluraschi