Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Nov 14, 2023
1 parent 9374f36 commit 766597a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,42 @@ as opposed to `inputPackageList` and `inputRepositoryList` CLI flags/YAML keys.

Additionally, `inputPackageList`/`inputRepositoryList` CLI flags take precendence over `inputPackages`/`inputRepositories` YAML keys.

## Binary dependencies

In order to request `locksmith` to generate an `renv.lock` with binary R packages, it is necessary to provide an URL to the binary repository in `inputRepositories`/`inputRepositoryList`.

Examples illustrating the expected format of URLs to repositories with binary packages:
* Linux:
* `https://packagemanager.posit.co/cran/__linux__/<distribution-name>/latest`
* Windows:
* `https://cloud.r-project.org/bin/windows/contrib/<r-version>`
* `https://www.bioconductor.org/packages/release/bioc/bin/windows/contrib/<r-version>`
* `https://packagemanager.posit.co/cran/latest/bin/windows/contrib/<r-version>`
* macOS:
* `https://cloud.r-project.org/bin/macosx/contrib/<r-version>`
* `https://www.bioconductor.org/packages/release/bioc/bin/macosx/big-sur-arm64/contrib/<r-version>`
* `https://www.bioconductor.org/packages/release/bioc/bin/macosx/big-sur-x86_64/contrib/<r-version>`
* `https://packagemanager.posit.co/cran/latest/bin/macosx/big-sur-x86_64/contrib/<r-version>`
* `https://packagemanager.posit.co/cran/latest/bin/macosx/big-sur-arm64/contrib/<r-version>`

where `<r-version>` is e.g. `4.2`, `4.3` etc.

As a result, the configuration file could look like this:

* for macOS:
```yaml
inputRepositories:
- CRAN-macOS=https://cloud.r-project.org/bin/macosx/contrib/4.2
- Bioc-macOS=https://www.bioconductor.org/packages/release/bioc/bin/macosx/big-sur-x86_64/contrib/4.3
```

* for Windows:
```yaml
inputRepositories:
- CRAN-Windows=https://cloud.r-project.org/bin/windows/contrib/4.2
- Bioc-Windows=https://www.bioconductor.org/packages/release/bioc/bin/windows/contrib/4.3
```

## Environment variables

`locksmith` reads environment variables with `LOCKSMITH_` prefix and tries to match them with CLI flags.
Expand Down
7 changes: 1 addition & 6 deletions cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,7 @@ func DownloadPackagesFiles(repositoryList []string,
var packagesFileURL string
if strings.Contains(repository, "/bin/windows/") || strings.Contains(repository, "/bin/macosx") {
// If we're dealing with a repository with binary Windows or macOS packages,
// we're expecting it to be in form of:
// https://cloud.r-project.org/bin/windows/contrib/4.2 or
// https://cloud.r-project.org/bin/macosx/contrib/4.2 or
// https://www.bioconductor.org/packages/release/bioc/bin/windows/contrib/4.2 or
// https://www.bioconductor.org/packages/release/bioc/bin/macosx/big-sur-arm64/contrib/4.2 or
// https://www.bioconductor.org/packages/release/bioc/bin/macosx/big-sur-x86_64/contrib/4.2
// we're expecting it to be in a specific format documented in the README.
packagesFileURL = repository + "/PACKAGES"
} else {
packagesFileURL = repository + "/src/contrib/PACKAGES"
Expand Down

0 comments on commit 766597a

Please sign in to comment.