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

Unexpected platform mismatch on Linux #122

Closed
jeroen opened this issue Jan 7, 2025 · 5 comments · Fixed by #123
Closed

Unexpected platform mismatch on Linux #122

jeroen opened this issue Jan 7, 2025 · 5 comments · Fixed by #123

Comments

@jeroen
Copy link
Member

jeroen commented Jan 7, 2025

I am getting a platform mismatch error on Linux for a package that has Platform: x86_64-pc-linux-gnu.

Reproduce

Run for example in this container:

docker run --rm -it ghcr.io/r-wasm/webr:main bash

And then run:

options(repos = c(getOption('repos'), 'https://paws-r.r-universe.dev/bin/linux/noble/4.4/'))
pak::pak("paws")
> pak::pak("paws")
v Updated metadata database: 3.92 MB in 9 files.
v Updating metadata database ... done
Error:
! error in pak subprocess
Caused by error:
! Could not solve package dependencies:
* paws: dependency conflict
* paws: Can't install dependency paws.storage (>= 0.8.0)
* paws.storage: Platform mismatch
Type .Last.error to see the more details.
@gaborcsardi
Copy link
Member

gaborcsardi commented Jan 7, 2025

Seems like a bug in pkgcache. A workaround is to remove the extra newline from the end of https://paws-r.r-universe.dev/bin/linux/noble/4.4/src/contrib/PACKAGES (+ PACKAGES.gz, etc.)

@jeroen
Copy link
Member Author

jeroen commented Jan 7, 2025

OK thank you. FFR I have implemented another temporary workaround which adds an unimportant field at the end of each dcf entry, such that the Platform field does not appear at the end.

This indeed fixes the issue, so fortunately the Platform field itself is OK and it is only a bug in the dcf parser.

Should I open an issue in pkgcache or can you transfer the current issue?

@gaborcsardi gaborcsardi transferred this issue from r-lib/pak Jan 7, 2025
@gaborcsardi
Copy link
Member

Reprex:

writeLines(c("Package: foo", ""), tmp <- tempfile())
pkgcache::parse_packages(tmp)
# A data frame: 1 × 1
  Package
  <chr>
1 "foo\n"

@gaborcsardi
Copy link
Member

Smaller reprex:

❯ .Call(pkgcache:::pkgcache_parse_packages_raw, charToRaw("Package: foo\n\n"))
$Package
[1] "foo\n"

@jeroen
Copy link
Member Author

jeroen commented Jan 9, 2025

Thank you

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 a pull request may close this issue.

2 participants