Skip to content

Commit

Permalink
Merge branch 'main' into fix/fake-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Nov 15, 2024
2 parents 2829345 + 397a525 commit 9a42c72
Show file tree
Hide file tree
Showing 180 changed files with 373,037 additions and 214 deletions.
69 changes: 68 additions & 1 deletion .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ on:
- 'yes'
- 'no'
default: 'yes'
bsd:
description: '*BSD'
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
deploy:
description: 'Deploy'
required: true
Expand Down Expand Up @@ -76,6 +84,7 @@ jobs:
echo "linux: ${{ github.event.inputs.linux == 'yes' }}"
echo "macos-arm64: ${{ github.event.inputs.macos-arm64 == 'yes' }}"
echo "linux-arm64: ${{ github.event.inputs.linux-arm64 == 'yes' }}"
echo "bsd: ${{ github.event.inputs.bsd == 'yes' }}"
echo "deploy: ${{ github.event.inputs.deploy == 'yes' }}"
# -----------------------------------------------------------------------
Expand Down Expand Up @@ -134,7 +143,7 @@ jobs:
if: ${{ github.event.inputs.macos-arm64 == '' || github.event.inputs.macos-arm64 == 'yes' }}
name: macos arm64
env:
RVERSIONS: "4.1-arm64 4.2-arm64 4.3-arm64 4.5-arm64"
RVERSIONS: "4.1-arm64 4.2-arm64 4.3-arm64 4.4-arm64 4.5-arm64"
RVERSION_DEFAULT: "4.3-x86_64"

steps:
Expand Down Expand Up @@ -319,6 +328,64 @@ jobs:

# ------------------------------------------------------------------------

bsd:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.bsd == '' || github.event.inputs.bsd == 'yes' }}
name: BSD

strategy:
fail-fast: false
matrix:
config:
- { os: 'freebsd', release: '15.0' }
- { os: 'freebsd', release: '14.2-pre' }
- { os: 'freebsd', release: '14.1' }
- { os: 'freebsd', release: '13.4' }
- { os: 'openbsd', release: '7.6' }
- { os: 'openbsd', release: '7.5' }
- { os: 'openbsd', release: '7.4' }
- { os: 'netbsd' }
- { os: 'dragonflybsd' }

steps:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10

- uses: r-hub/actions/setup-r-freebsd@main
if: ${{ matrix.config.os == 'freebsd' }}
with:
release: ${{ matrix.config.release }}

- uses: r-hub/actions/setup-r-openbsd@v1
if: ${{ matrix.config.os == 'openbsd' }}
with:
release: ${{ matrix.config.release }}

- uses: r-hub/actions/setup-r-netbsd@v1
if: ${{ matrix.config.os == 'netbsd' }}

- uses: r-hub/actions/setup-r-dragonflybsd@v1
if: ${{ matrix.config.os == 'dragonflybsd' }}

- name: Build pak binary
run: |
# this runs on the VM
install.packages(".", repos = NULL, type = "source", INSTALL_opts = "--build")
shell: Rscript {0}

- name: Deploy pak binary
run: |
make -f tools/build/docker-deploy/Makefile
env:
PAK_GHCR_TOKEN: ${{ secrets.PAK_GHCR_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
shell: bash

# ------------------------------------------------------------------------

deploy:
runs-on: ubuntu-latest
if: ${{ (github.event.inputs.deploy == '' || github.event.inputs.deploy == 'yes') && always() }}
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Config/build/extra-sources: configure*
Config/needs/dependencies:
callr,
desc,
cli,
r-lib/cli,
curl,
filelock,
jsonlite,
Expand Down
49 changes: 48 additions & 1 deletion R/push-packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ push_packages <- local({

canonize_arch <- function(platform) {
arch <- strsplit(platform, "-", fixed = TRUE)[[1]][1]
c("aarch64" = "arm64", "x86_64" = "amd64")[[arch]]
c("aarch64" = "arm64", "x86_64" = "amd64", "arm64" = "arm64", "amd64" = "amd64")[[arch]]
}

canonize_os <- function(platform) {
Expand Down Expand Up @@ -641,6 +641,14 @@ create_pak_repo <- local({
# - darwin17.0/x86_64
# - darwin20/aarch64
# - mingw32/x86_64
# - freebsd15.0/x86_64
# - freebsd14.1/x86_64
# - freebsd13.3/x86_64
# - openbsd7.6/x86_64
# - openbsd7.5/x86_64
# - openbsd7.4/x86_64
# - netbsd/x86_64
# - dragonfly6.4/x86_64

# ## New form of the install command will use these repo URL and paths:
# ```
Expand All @@ -658,6 +666,22 @@ create_pak_repo <- local({
# mingw32/x86_64
# win.binary/mingw32/i386 + /bin/windows/contrib/4.1 ->
# mingw32/x86_64
# source/freebsd15.0/amd64 + /src/contrib ->
# freebsd15.0/x86_64
# source/freebsd14.1/amd64 + /src/contrib ->
# freebsd14.1/x86_64
# source/freebsd13.3/amd64 + /src/contrib ->
# freebsd13.3/x86_64
# source/openbsd7.6/x86_64 + /src/contrib ->
# openbsd7.6/x86_64
# source/openbsd7.5/x86_64 + /src/contrib ->
# openbsd7.5/x86_64
# source/openbsd7.4/x86_64 + /src/contrib ->
# openbsd7.4/x86_64
# source/netbsd/x86_64 + /src/contrib ->
# netbsd/x86_64
# source/dragonfly6.4/x86_64 + /src/contrib ->
# dragonfly6.4/x86_64
# ```
#
# Unsupported platforms will get a non-existant path, e.g. homebrew R
Expand Down Expand Up @@ -706,6 +730,29 @@ create_pak_repo <- local({
"source/linux-dietlibc/aarch64/src/contrib" = "../../../../../linux/aarch64",
"source/linux-unknown/aarch64/src/contrib" = "../../../../../linux/aarch64",

"source/freebsd15.6/amd64/src/contrib" = "../../../../../freebsd15.6/x86_64",
"source/freebsd15.5/amd64/src/contrib" = "../../../../../freebsd15.5/x86_64",
"source/freebsd15.4/amd64/src/contrib" = "../../../../../freebsd15.4/x86_64",
"source/freebsd15.3/amd64/src/contrib" = "../../../../../freebsd15.3/x86_64",
"source/freebsd15.2/amd64/src/contrib" = "../../../../../freebsd15.2/x86_64",
"source/freebsd15.1/amd64/src/contrib" = "../../../../../freebsd15.1/x86_64",
"source/freebsd15.0/amd64/src/contrib" = "../../../../../freebsd15.0/x86_64",
"source/freebsd14.6/amd64/src/contrib" = "../../../../../freebsd14.6/x86_64",
"source/freebsd14.5/amd64/src/contrib" = "../../../../../freebsd14.5/x86_64",
"source/freebsd14.4/amd64/src/contrib" = "../../../../../freebsd14.4/x86_64",
"source/freebsd14.3/amd64/src/contrib" = "../../../../../freebsd14.3/x86_64",
"source/freebsd14.2/amd64/src/contrib" = "../../../../../freebsd14.2/x86_64",
"source/freebsd14.1/amd64/src/contrib" = "../../../../../freebsd14.1/x86_64",
"source/freebsd13.6/amd64/src/contrib" = "../../../../../freebsd13.6/x86_64",
"source/freebsd13.5/amd64/src/contrib" = "../../../../../freebsd13.5/x86_64",
"source/freebsd13.4/amd64/src/contrib" = "../../../../../freebsd13.4/x86_64",
"source/freebsd13.3/amd64/src/contrib" = "../../../../../freebsd13.3/x86_64",
"source/openbsd7.6/x86_64/src/contrib" = "../../../../../openbsd7.6/x86_64",
"source/openbsd7.5/x86_64/src/contrib" = "../../../../../openbsd7.5/x86_64",
"source/openbsd7.4/x86_64/src/contrib" = "../../../../../openbsd7.4/x86_64",
"source/netbsd/x86_64/src/contrib" = "../../../../../netbsd/x86_64",
"source/dragonfly6.4/x86_64/src/contrib" = "../../../../../dragonfly6.4/x86_64",

# Map the pkgType/os/arch form binaries of other OSes to the right place.
"win.binary/mingw32/x86_64/src/contrib" = "../../../../../mingw32/x86_64",
"mac.binary.big-sur-arm64/darwin20/aarch64/src/contrib" = "../../../../../darwin20/aarch64",
Expand Down
18 changes: 11 additions & 7 deletions man/chunks/install.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ install.packages("pak", repos = sprintf(

This is supported for the following systems:

| OS | CPU | R version |
|---------------------|-----------|-------------------|
| Linux | x86_64 | R 3.4.0 - R-devel |
| Linux | aarch64 | R 3.4.0 - R-devel |
| macOS High Sierra+ | x86_64 | R 3.4.0 - R-devel |
| macOS Big Sur+ | aarch64 | R 4.1.0 - R-devel |
| Windows | x86_64 | R 3.4.0 - R-devel |
| OS | CPU | R version |
|-----------------------|-----------|-----------------------------------|
| Linux | x86_64 | R 3.4.0 - R-devel |
| Linux | aarch64 | R 3.4.0 - R-devel |
| macOS High Sierra+ | x86_64 | R 3.4.0 - R-devel |
| macOS Big Sur+ | aarch64 | R 4.1.0 - R-devel |
| Windows | x86_64 | R 3.4.0 - R-devel |
| FreeBSD 13.x or later | x86_64 | R 4.4.x |
| OpenBSD 7.4, 7.5, 7.6 | x86_64 | R 4.2.x (7.4, 7.5), R 4.4.x (7.6) |
| NetBSD 10.0 | x86_64 | R 4.4.x |
| DragonFly BSD 6.4 | x86_64 | R 4.3.x |

### Notes

Expand Down
4 changes: 4 additions & 0 deletions man/install.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions src/library/cli/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cli
Title: Helpers for Developing Command Line Interfaces
Version: 3.6.2
Version: 3.6.3.9000
Authors@R: c(
person("Gábor", "Csárdi", , "[email protected]", role = c("aut", "cre")),
person("Hadley", "Wickham", role = "ctb"),
Expand All @@ -21,22 +21,20 @@ BugReports: https://github.com/r-lib/cli/issues
Depends: R (>= 3.4)
Imports: utils
Suggests: callr, covr, crayon, digest, glue (>= 1.6.0), grDevices,
htmltools, htmlwidgets, knitr, methods, mockery, processx, ps
(>= 1.3.4.9000), rlang (>= 1.0.2.9003), rmarkdown, rprojroot,
rstudioapi, testthat, tibble, whoami, withr
htmltools, htmlwidgets, knitr, methods, processx, ps (>=
1.3.4.9000), rlang (>= 1.0.2.9003), rmarkdown, rprojroot,
rstudioapi, testthat (>= 3.2.0), tibble, whoami, withr
Config/Needs/website: r-lib/asciicast, bench, brio, cpp11, decor, desc,
fansi, prettyunits, sessioninfo, tidyverse/tidytemplate,
usethis, vctrs
Config/testthat/edition: 3
Encoding: UTF-8
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
NeedsCompilation: yes
Packaged: 2023-12-10 22:38:10 UTC; gaborcsardi
Packaged: 2024-11-08 08:17:43 UTC; gaborcsardi
Author: Gábor Csárdi [aut, cre],
Hadley Wickham [ctb],
Kirill Müller [ctb],
Salim Brüggemann [ctb] (<https://orcid.org/0000-0002-5329-5987>),
Posit Software, PBC [cph, fnd]
Maintainer: Gábor Csárdi <[email protected]>
Repository: CRAN
Date/Publication: 2023-12-11 07:40:13 UTC
8 changes: 8 additions & 0 deletions src/library/cli/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,27 @@ export(hash_emoji)
export(hash_file_md5)
export(hash_file_sha1)
export(hash_file_sha256)
export(hash_file_xxhash)
export(hash_file_xxhash64)
export(hash_md5)
export(hash_obj_animal)
export(hash_obj_emoji)
export(hash_obj_md5)
export(hash_obj_sha1)
export(hash_obj_sha256)
export(hash_obj_xxhash)
export(hash_obj_xxhash64)
export(hash_raw_animal)
export(hash_raw_emoji)
export(hash_raw_md5)
export(hash_raw_sha1)
export(hash_raw_sha256)
export(hash_raw_xxhash)
export(hash_raw_xxhash64)
export(hash_sha1)
export(hash_sha256)
export(hash_xxhash)
export(hash_xxhash64)
export(is_ansi_tty)
export(is_dynamic_tty)
export(is_utf8_output)
Expand Down
30 changes: 30 additions & 0 deletions src/library/cli/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# cli (development version)

* `cli_progress_bar()` now accepts `total` = Inf or -Inf which mimics the behavior of when `total` is NA.

* `num_ansi_colors()` now does not warn in Emacs if the `INSIDE_EMACS`
environment variable is not a proper version number (@rundel, #689).

* `ansi_collapse()` and inline collapsing now uses `last` as the separator
(without the serial comma) for two-element vectors if `sep2` is not
given (@rundel, #681).

* `ansi_collapse()` is now correct for length-1 vectors with style "head"
if width is specified (@rundel, #590).

* New `hash_xxhash()` etc. functions to calculate the xxHash of strings,
raw vectors, objects, files.

# cli 3.6.3

* cli now builds on ARM Windows.

* "Solarized Dark" is now the default syntax highlighting theme in
terminals.

* The `{.obj_type_friendly}` inline style now only shows the first class
name (#669 @olivroy).

* Syntax highlighting now does not fail in RStudio if the rstudioapi
package is not installed (#697).

# cli 3.6.2

* `ansi_collapse(x, trunc = 1, style = "head")` now indeed shows one
Expand Down
2 changes: 1 addition & 1 deletion src/library/cli/R/aaa-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ tail_na <- function(x, n = 1) {
}

dedent <- function(x, n = 2) {
first_n_char <- strsplit(ansi_substr(x, 1, n), "")[[1]]
first_n_char <- strsplit(ansi_substr(x, 1, n), "", fixed = TRUE)[[1]]
n_space <- cumsum(first_n_char == " ")
d_n_space <- diff(c(0, n_space))
first_not_space <- utils::head(c(which(d_n_space == 0), n + 1), 1)
Expand Down
11 changes: 8 additions & 3 deletions src/library/cli/R/aab-rstudio-detect.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ rstudio <- local({
args = commandArgs(),
search = search()
)
d$ver <- if (d$api) asNamespace("rstudioapi")$getVersion()
d$desktop <- if (d$api) asNamespace("rstudioapi")$versionInfo()$mode

if (d$api) {
ns <- asNamespace("rstudioapi")
d$ver <- if (d$api) ns$getVersion()
new_api <- package_version(getNamespaceVersion(ns)) >= "0.17.0"
d$desktop <- if (new_api) ns$getMode() else ns$versionInfo()$mode
}

d
}
Expand Down Expand Up @@ -164,7 +169,7 @@ rstudio <- local({
"rstudio_build_pane"

} else if (new$envs[["RSTUDIOAPI_IPC_REQUESTS_FILE"]] != "" &&
grepl("rstudio", new$envs[["XPC_SERVICE_NAME"]])) {
grepl("rstudio", new$envs[["XPC_SERVICE_NAME"]], fixed = TRUE)) {
# RStudio job, XPC_SERVICE_NAME=0 in the subprocess of a job
# process. Hopefully this is reliable.
"rstudio_job"
Expand Down
4 changes: 2 additions & 2 deletions src/library/cli/R/ansi-hyperlink.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ abs_path1 <- function(x) {
# -- {.fun} ---------------------------------------------------------------

make_link_fun <- function(txt) {
tolink <- grepl("::", txt)
tolink <- grepl("::", txt, fixed = TRUE)
linked <- grepl("\007|\033\\\\", txt)
todo <- tolink & !linked
if (!any(todo)) return(txt)
Expand Down Expand Up @@ -409,7 +409,7 @@ ansi_hyperlink_types <- function() {
vignette = FALSE
)

} else if (rs$hyperlink) {
} else if (isTRUE(rs$hyperlink)) {
list(
href = TRUE,
run = structure(run, type = "rstudio"),
Expand Down
2 changes: 1 addition & 1 deletion src/library/cli/R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ is_border_style <- function(x) {
}

is_padding_or_margin <- function(x) {
is.numeric(x) && length(x) %in% c(1, 4) && all(!is.na(x)) &&
is.numeric(x) && length(x) %in% c(1, 4) && !anyNA(x) &&
all(as.integer(x) == x)
}

Expand Down
5 changes: 3 additions & 2 deletions src/library/cli/R/cliapp-docs.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
#' * `run` is an R expression, that is potentially clickable if the terminal
#' supports ANSI hyperlinks to runnable code (e.g. RStudio).
#' It supports link text. See [links] for more information about cli hyperlinks.
#' * `str` for a double quoted string escaped by [base::encodeString()].#' * `strong` for strong importance.
#' * `str` for a double quoted string escaped by [base::encodeString()].
#' * `strong` for strong importance.
#' * `topic` is a help page of a _topic_.
#' If the terminal supports ANSI hyperlinks to help pages (e.g. RStudio),
#' then cli creates a clickable link. It supports link text.
Expand Down Expand Up @@ -543,7 +544,7 @@ NULL
#' convert relative paths, and paths starting with `~` to aboslute path.
#'
#' ```{asciicast links-file-1}
#' cli_text("... edit your {.file ~/.Rprofile} file.}")
#' cli_text("... edit your {.file ~/.Rprofile} file.")
#' ```
#'
#' ## Link text
Expand Down
Loading

0 comments on commit 9a42c72

Please sign in to comment.