Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between <pkg>?source and <pkg>=?source ? #708

Closed
MichaelChirico opened this issue Oct 22, 2024 · 8 comments
Closed

Difference between <pkg>?source and <pkg>=?source ? #708

MichaelChirico opened this issue Oct 22, 2024 · 8 comments

Comments

@MichaelChirico
Copy link

pak/man/chunks/FAQ.Rmd

Lines 37 to 56 in b940875

## How do I install a package from source?
To force the installation of a source package (instead of a binary
package), use the `?source` parameter:
```{asciicast faq-source}
pak::pkg_install("tibble?source")
```
## How do I install the latest version of a dependency?
If you want to always install a dependency from source, because you want
the latest version or some other reason, you can use the `source`
parameter with the `<package>=` form: `<package>=?source`.
For example to install tibble, with its cli dependency installed from
source you could write:
```{asciicast faq-source-dep}
pak::pkg_install(c("tibble", "cli=?source"))
```

These paragraphs are next to each other but I can't tell if there's any difference between <pkg>?source and <pkg>?=source

@gaborcsardi
Copy link
Member

@MichaelChirico
Copy link
Author

Thanks for the reference, but sorry, the exposition is still not clear.

For example, there's a transition to discussing "downstream" packages that doesn't make much sense to me. The FAQ by contrast uses the term "dependency" -- in my mind those terms are not the same.

@gaborcsardi
Copy link
Member

  • pkg?source = install pkg from source, plus its dependencies according to the dependencies argument.
  • pkg=?source = if pkg will be installed, install it from source.

@MichaelChirico
Copy link
Author

OK so in my case for {bit64}, suppose {bit} (in Depends: of {bit64}) also has Imports: pkgA

bit64?source  : installs bit64, bit, and pkgA from source
bit64=?source : install bit64 from source, bit and pkgA can be installed from binary
bit?source    : bit64 might be installed from binary, bit and pkgA are installed from source
bit?=source   : bit64 and pkgA might be installed from binary, bit will be installed from source

Does that look right to you?

@gaborcsardi
Copy link
Member

It does not look right. But I don't really understand what you are installing? What is the command line? Or the code that calls the action?

@MichaelChirico
Copy link
Author

I am "just" trying to run r-lib/actions/check-r-package.

Plain bit?source did work for my purposes. I am trying to understand better in the hopes of improving the documentation with that clarity.

@gaborcsardi
Copy link
Member

Oh, for check-r-package this does not matter at all, it doesn't have anything to do with package installation, just runs R CMD check.

Anyway, improvements are welcome, sure.

@MichaelChirico
Copy link
Author

Oh, for check-r-package this does not matter at all

Maybe I need more context. This is about the setup-r-dependencies step that feeds check-r-package.

Here I followed your advice to use bit?source: r-lib/bit64@fae213b

The result is R CMD check begins to pass because the WARNING about mismatched "built" version for {bit} and {bit64} went away (e.g. https://github.com/r-lib/bit64/actions/runs/11464927713/job/31902265368).

I still don't really understand the impact of = so I can't offer any improvements as of now.

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

No branches or pull requests

2 participants