From d61d8bcf4d2c14cfcb199a37ad77309a447d0ed0 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 13 Dec 2021 09:30:11 +0900 Subject: [PATCH 1/8] Add -lbcrypt --- inst/templates/Makevars.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/templates/Makevars.win b/inst/templates/Makevars.win index 56e189c2..bb570f87 100644 --- a/inst/templates/Makevars.win +++ b/inst/templates/Makevars.win @@ -3,7 +3,7 @@ TOOLCHAIN = stable-msvc TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/lib{{{pkg_name}}}.a -PKG_LIBS = -L$(LIBDIR) -l{{{pkg_name}}} -lws2_32 -ladvapi32 -luserenv +PKG_LIBS = -L$(LIBDIR) -l{{{pkg_name}}} -lws2_32 -ladvapi32 -luserenv -lbcrypt all: C_clean From da4a7b070acec560fee115b26729e04c11a7d1ba Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 13 Dec 2021 09:42:20 +0900 Subject: [PATCH 2/8] Update snapshot --- tests/testthat/_snaps/use_extendr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/_snaps/use_extendr.md b/tests/testthat/_snaps/use_extendr.md index 2a273b7d..9d0fd41c 100644 --- a/tests/testthat/_snaps/use_extendr.md +++ b/tests/testthat/_snaps/use_extendr.md @@ -62,7 +62,7 @@ TARGET_DIR = ./rust/target LIBDIR = $(TARGET_DIR)/$(TARGET)/release STATLIB = $(LIBDIR)/libtestpkg.a - PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv + PKG_LIBS = -L$(LIBDIR) -ltestpkg -lws2_32 -ladvapi32 -luserenv -lbcrypt all: C_clean From 986fd16c135c27c0f50f0bbaf9171057f1df1bb2 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 13 Dec 2021 14:20:16 +0900 Subject: [PATCH 3/8] Try an older version of testthat --- .github/workflows/R-CMD-check.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9c9b5904..65c7cf90 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -82,6 +82,8 @@ jobs: run: | remotes::install_deps(dependencies = TRUE) remotes::install_cran("rcmdcheck") + #TODO: remove this when testthat is fixed + remotes::install_version("testthat", "3.1.0") shell: Rscript {0} - name: Check From 1d9e328d6a01f98d89d85f83fe72dab8ddb13efa Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 13 Dec 2021 23:15:06 +0900 Subject: [PATCH 4/8] Revert --- .github/workflows/R-CMD-check.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 65c7cf90..9c9b5904 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -82,8 +82,6 @@ jobs: run: | remotes::install_deps(dependencies = TRUE) remotes::install_cran("rcmdcheck") - #TODO: remove this when testthat is fixed - remotes::install_version("testthat", "3.1.0") shell: Rscript {0} - name: Check From 656214a1f83e9a33b49416b658d8809b7adc237a Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 13 Dec 2021 23:51:01 +0900 Subject: [PATCH 5/8] Clear cache --- .github/workflows/R-CMD-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9c9b5904..66aa76f8 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -59,8 +59,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2- - name: Configure Windows if: startsWith(runner.os, 'Windows') From 6de65bc7c113839157c4c52b58f8e26c18c7d10f Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Tue, 14 Dec 2021 08:55:01 +0900 Subject: [PATCH 6/8] Try check-pak-based workflow --- .github/workflows/R-CMD-check.yaml | 84 +++++++----------------------- 1 file changed, 20 insertions(+), 64 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 66aa76f8..b67c2d76 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,12 +1,8 @@ on: push: - branches: - - main - - master + branches: [main, master] pull_request: - branches: - - main - - master + branches: [main, master] name: R-CMD-check @@ -14,86 +10,46 @@ jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }} / ${{ matrix.config.rust-version }}) + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) strategy: fail-fast: false matrix: config: - {os: windows-latest, r: 'release', rust-version: 'stable-msvc'} - - {os: macOS-latest, r: 'release', rust-version: 'stable'} - - {os: ubuntu-20.04, r: 'release', rust-version: 'stable', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', rust-version: 'stable', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: macOS-latest, r: 'release', rust-version: 'stable' } + - {os: ubuntu-20.04, r: 'release', rust-version: 'stable' } + - {os: ubuntu-20.04, r: 'devel', rust-version: 'stable' } env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - uses: actions/checkout@v2 - + + - uses: r-lib/actions/setup-pandoc@v1 + - name: Set up Rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.config.rust-version }} default: true - - name: Set up R - uses: r-lib/actions/setup-r@v1 - with: - r-version: ${{ matrix.config.r }} - windows-path-include-mingw: false - - - name: Set up pandoc - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages (not Windows) - if: startsWith(runner.os, 'Windows') == false - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-2- - - name: Configure Windows if: startsWith(runner.os, 'Windows') run: | rustup target add x86_64-pc-windows-gnu rustup target add i686-pc-windows-gnu - shell: pwsh - - - name: Configure Linux - if: startsWith(runner.os, 'Linux') - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - id: rcmd_check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--force-multiarch"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/setup-r-dependencies@v1 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-rust${{ matrix.config.rust-version }}-results - path: check + extra-packages: rcmdcheck + + - uses: r-lib/actions/check-r-package@v1 From bf93a1db3d84b0db9fdce82336fae8d3dbaa4ca3 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Tue, 14 Dec 2021 09:13:26 +0900 Subject: [PATCH 7/8] Confirm the snapshot test fails as expected --- tests/data/test-knitr-engine-source-01.Rmd | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/data/test-knitr-engine-source-01.Rmd b/tests/data/test-knitr-engine-source-01.Rmd index a25b53dd..62c30be8 100644 --- a/tests/data/test-knitr-engine-source-01.Rmd +++ b/tests/data/test-knitr-engine-source-01.Rmd @@ -10,6 +10,7 @@ knitr::opts_chunk$set( Basic use example: ```{r} +# foo library(rextendr) # create a Rust function From bec2ac40ab016c66432d6b144a2043f99d21e2c0 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Tue, 14 Dec 2021 09:15:07 +0900 Subject: [PATCH 8/8] Revert --- tests/data/test-knitr-engine-source-01.Rmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/data/test-knitr-engine-source-01.Rmd b/tests/data/test-knitr-engine-source-01.Rmd index 62c30be8..07476704 100644 --- a/tests/data/test-knitr-engine-source-01.Rmd +++ b/tests/data/test-knitr-engine-source-01.Rmd @@ -10,7 +10,6 @@ knitr::opts_chunk$set( Basic use example: ```{r} -# foo library(rextendr) # create a Rust function @@ -82,4 +81,4 @@ The quick brown fox **jumps over** the lazy dog. The quick *brown fox* jumps over the lazy dog." md_to_html(md_text) -``` \ No newline at end of file +```