`sources` should include `Cargo.lock`

Open
#218 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
38/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
r, rust
Domain
build-system

Research direction

Start at the pkgbuild:::sources entry point and inspect how files under src/ are collected, with particular attention to src/rust/Cargo.lock. Confirm the existing DESCRIPTION workaround and verify that Cargo.lock files are included in the returned sources list without needing that workaround.

Written by the indexing model from the issue text.

Description

Currently, pkgbuild:::sources tracks many files under src/, but it ignores Cargo.lock. The practical advice is generally that Cargo.lock ought to be tracked (via version control) in the case of a binary, and not in the case of a library. That's because you cannot cargo install a library. But a rust crate embedded in an R package is regarded as a binary in this instance, as we can install an r-package. Cargo.lock helps with tracking dependencies, and aid in reproducible builds, and also it is something that changes irrespective of rust crates' source files .rs, and the Cargo.toml file. A lockfile is changed through a call to cargo update for instance. See https://doc.rust-lang.org/cargo/commands/cargo-generate-lockfile.html for details.

For now, to circumvent the lack of rebuilding behaviour through devtools (facilitated by pkgbuild) one may write this in the DESCRIPTION file:

Config/build/extra-sources: src/rust/Cargo.lock

I would love it if pkgbuild:::sources were changed so it would also include Cargo.lock files.

Dominant language
R
Stars
77
Forks
43
Avg merge
17m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/pkgbuild

All issues in r-lib/pkgbuild

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.