Skip to content

Install pak from the stable repo so Windows gets a Windows binary - #43

Open
VincentGuyader wants to merge 2 commits into
masterfrom
fix/pak-stable-repo
Open

Install pak from the stable repo so Windows gets a Windows binary#43
VincentGuyader wants to merge 2 commits into
masterfrom
fix/pak-stable-repo

Conversation

@VincentGuyader

Copy link
Copy Markdown
Member

Contexte

`R-CMD-check` était rouge sur `windows-latest (release)` :

```
trying URL 'https://r-lib.github.io/p/pak/dev/src/contrib/../../../stable/linux/x86_64/pak_0.9.4_R-4-6_x86_64-linux.tar.gz'
...
installation of package 'pak' had non-zero exit status
##[error]Error in loadNamespace(x) : there is no package called 'pak'
```

Cause

L'install de pak utilisait `https://r-lib.github.io/p/pak/dev/\`. Sur le runner Windows R 4.6, cette URL retourne un tarball Linux x86_64 au lieu d'un binaire Windows. `install.packages()` télécharge donc un .tar.gz Linux, échoue à l'installer côté Windows, et l'étape suivante `pak::pkg_deps(...)` ne trouve plus le namespace `pak`.

Fix

Utiliser le repo stable, paramétré par `.Platform$pkgType`, `R.Version()$os` et `R.Version()$arch`, qui sert le bon binaire selon le runner. C'est la recette officielle documentée sur https://pak.r-lib.org/ et utilisée par les templates r-lib/actions courants.

```r
install.packages("pak", repos = sprintf(
"https://r-lib.github.io/p/pak/stable/%s/%s/%s\",
.Platform$pkgType, R.Version()$os, R.Version()$arch
))
```

Pas fixé : windows-latest (R 3.6)

Cause différente sur ce job — pak s'installe correctement (binaire mingw32 dispo) puis `pak::pkg_deps("local::.")` échoue à résoudre l'arbre :

```
Error in pak subprocess
Caused by error: Could not solve package dependencies
```

R 3.6 date de 2019 ; plusieurs deps transitives n'ont plus de binaires R 3.6 sur CRAN. Pas un bug de la CI, c'est une limite externe : pas de fix possible sans changer la matrice. Comme demandé, je ne supprime pas le check.

Until now the workflow installed pak from
  https://r-lib.github.io/p/pak/dev/
On the windows-latest (release) runner with R 4.6, that URL serves the
Linux x86_64 tarball:

  trying URL '.../stable/linux/x86_64/pak_0.9.4_R-4-6_x86_64-linux.tar.gz'
  installation of package 'pak' had non-zero exit status

so install.packages() fails and the next step errors with
"there is no package called 'pak'".

Switch to the stable repo, parameterised by .Platform$pkgType and
R.Version()$os/$arch, so each runner pulls a binary it can actually
install. This is the form documented at https://pak.r-lib.org/ and
used in current r-lib/actions templates.
R 3.6 is from 2019 and several transitive dependencies no longer ship
binaries for it on CRAN, so pak::pkg_deps() can't resolve a working
solution. The job has no path back to green without pinning the entire
dep tree to ancient versions, which is not worth the cost.
@VincentGuyader

Copy link
Copy Markdown
Member Author

Suite à la review : ajout d'un commit qui retire windows-latest (R 3.6) de la matrice. Cause détaillée dans le commit message — pas de chemin retour au vert sans pinner tout l'arbre des deps. La section "Pas fixé" de la description initiale n'est plus à jour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant