Skip to content
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

Macos binaries #6421

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 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
7 changes: 4 additions & 3 deletions .ci/ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ mirror.packages <-
function(pkgs,
which = c("Depends", "Imports", "LinkingTo"),
repos = getOption("repos"),
type = c("source", "mac.binary", "win.binary"),
type = c("source", "mac.binary.big-sur-arm64", "win.binary"),
repodir,
except.repodir = repodir,
except.priority = "base",
Expand Down Expand Up @@ -169,7 +169,8 @@ function(pkgs,
newpkgs <- newpkgs[availpkgs]
}

pkgsext <- switch(type,
typeshort <- if (substr(type, 1L, 11L) == "mac.binary.") "mac.binary" else type
ben-schwen marked this conversation as resolved.
Show resolved Hide resolved
pkgsext <- switch(typeshort,
"source" = "tar.gz",
"mac.binary" = "tgz",
"win.binary" = "zip")
Expand All @@ -181,7 +182,7 @@ function(pkgs,
dp <- utils::download.packages(pkgs = newpkgs, destdir = destdir,
available = db, contriburl = repos.url,
type = type, method = method, quiet = quiet)
tools::write_PACKAGES(dir = destdir, type = type, ...)
tools::write_PACKAGES(dir = destdir, type = typeshort, ...)
dp
}

40 changes: 36 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ variables:
R_OLD_WIN_BIN: "https://cloud.r-project.org/bin/windows/base/old/4.2.3/R-4.2.3-win.exe"
RTOOLS_OLD_BIN: "https://cloud.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5355-5357.exe"
RTOOLS42_HOME: "/c/rtools"
R_REL_MAC_BIN: "https://cloud.r-project.org/bin/macosx/big-sur-arm64/base/R-4.3.3-arm64.pkg"
R_DEV_MAC_BIN: "https://cloud.r-project.org/bin/macosx/big-sur-arm64/base/R-4.4.0-arm64.pkg"
R_OLD_MAC_BIN: "https://cloud.r-project.org/bin/macosx/big-sur-arm64/base/R-4.2.3-arm64.pkg"

stages:
- dependencies
Expand Down Expand Up @@ -56,6 +59,7 @@ mirror-packages:
- mkdir -p bus/$CI_JOB_NAME/cran/src/contrib
- Rscript -e 'mirror.packages(dcf.dependencies("DESCRIPTION", "all"), repos=Sys.getenv("CRAN_MIRROR"), repodir="bus/mirror-packages/cran")'
- Rscript -e 'sapply(simplify=FALSE, setNames(nm=Sys.getenv(c("R_REL_VERSION","R_DEV_VERSION","R_OLD_VERSION"))), function(binary.ver) mirror.packages(type="win.binary", dcf.dependencies("DESCRIPTION", "all"), repos=Sys.getenv("CRAN_MIRROR"), repodir="bus/mirror-packages/cran", binary.ver=binary.ver))'
- Rscript -e 'sapply(simplify=FALSE, setNames(nm=Sys.getenv(c("R_REL_VERSION","R_DEV_VERSION","R_OLD_VERSION"))), function(binary.ver) mirror.packages(type="mac.binary.big-sur-arm64", dcf.dependencies("DESCRIPTION", "all"), repos=Sys.getenv("CRAN_MIRROR"), repodir="bus/mirror-packages/cran", binary.ver=binary.ver))'
<<: *artifacts

## install deps alias
Expand Down Expand Up @@ -272,9 +276,13 @@ test-win-old:
tags:
- saas-macos-medium-m1
before_script:
- if ! command -v R &> /dev/null || ! command -v Rscript &> /dev/null; then brew install r; fi
- curl -O $R_BIN
- sudo installer -pkg "$(ls -1t R-*-arm64.pkg | head -n 1)" -target /
- *install-deps
- cp $(ls -1t bus/build/data.table_*.tar.gz | head -n 1) .
script:
- R CMD check --no-manual $(ls -1t data.table_*.tar.gz | head -n 1)
- R CMD INSTALL --build $(ls -1t data.table_*.tar.gz | head -n 1)
after_script:
- mkdir -p bus/$CI_JOB_NAME
- '[ -d data.table.Rcheck ] && mv data.table.Rcheck bus/$CI_JOB_NAME/'
Expand All @@ -288,9 +296,21 @@ test-mac-rel:
<<: *test-mac
variables:
R_VERSION: "$R_REL_VERSION"
script:
- R CMD check --no-manual $(ls -1t data.table_*.tar.gz | head -n 1)
- R CMD INSTALL --build $(ls -1t data.table_*.tar.gz | head -n 1)
R_BIN: "$R_REL_MAC_BIN"

## R-devel on MacOS
test-mac-dev:
<<: *test-mac
variables:
R_VERSION: "$R_DEV_VERSION"
R_BIN: "$R_DEV_MAC_BIN"

## R-oldrel on MacOS
test-mac-old:
<<: *test-mac
variables:
R_VERSION: "$R_OLD_VERSION"
R_BIN: "$R_OLD_MAC_BIN"

## integrate artifacts
# merging package tarballs and binaries into single R repository
Expand Down Expand Up @@ -345,8 +365,20 @@ integration:
- Rscript -e 'tools::write_PACKAGES(contrib.url("bus/integration/cran", type="win.binary", ver=Sys.getenv("R_DEV_VERSION")), type="win.binary", fields="Revision", addFiles=TRUE)'
- Rscript -e 'tools::write_PACKAGES(contrib.url("bus/integration/cran", type="win.binary", ver=Sys.getenv("R_OLD_VERSION")), type="win.binary", fields="Revision", addFiles=TRUE)'
#### macos mkdir cran/bin/.../contrib/...
- mkdir -p bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_REL_VERSION/
- mkdir -p bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_DEV_VERSION/
- mkdir -p bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_OLD_VERSION/
#### macos move binaries
- '[ -f bus/test-mac-rel/data.table_*.tgz ] && cp bus/test-mac-rel/data.table_*.tgz bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_REL_VERSION/'
- ls -1 "bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_REL_VERSION"/data.table_*.tgz || true
- '[ -f bus/test-mac-dev/data.table_*.tgz ] && cp bus/test-mac-dev/data.table_*.tgz bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_DEV_VERSION/'
- ls -1 "bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_DEV_VERSION"/data.table_*.tgz || true
- '[ -f bus/test-mac-old/data.table_*.tgz ] && cp bus/test-mac-old/data.table_*.tgz bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_OLD_VERSION/'
- ls -1 "bus/integration/cran/bin/macosx/big-sur-arm64/contrib/$R_OLD_VERSION"/data.table_*.tgz || true
#### macos write_PACKAGES
- Rscript -e 'tools::write_PACKAGES(contrib.url("bus/integration/cran", type="mac.binary.big-sur-arm64", ver=Sys.getenv("R_REL_VERSION")), type="mac.binary.big-sur-arm64", fields="Revision", addFiles=TRUE)'
- Rscript -e 'tools::write_PACKAGES(contrib.url("bus/integration/cran", type="mac.binary.big-sur-arm64", ver=Sys.getenv("R_DEV_VERSION")), type="mac.binary.big-sur-arm64", fields="Revision", addFiles=TRUE)'
- Rscript -e 'tools::write_PACKAGES(contrib.url("bus/integration/cran", type="mac.binary.big-sur-arm64", ver=Sys.getenv("R_OLD_VERSION")), type="mac.binary.big-sur-arm64", fields="Revision", addFiles=TRUE)'
## install pkg to render html
- mkdir -p /tmp/opencran/library /tmp/opencran/doc/html
- Rscript -e 'install.packages("data.table", lib="/tmp/opencran/library", repos=file.path("file:",normalizePath("bus/integration/cran")), INSTALL_opts="--html", quiet=TRUE)'
Expand Down
Loading