r-wasm / rwasm

Build R packages for WebAssembly and create a CRAN-like repo for distribution.
https://r-wasm.github.io/rwasm/
Other
54 stars 4 forks source link

Working with custom repo_dir / out_dir locations does not work. #4

Closed schloerke closed 9 months ago

schloerke commented 10 months ago

I think it is related to this line: https://github.com/r-wasm/rwasm/blob/3aa20118abe329fff05602c42cf36ed01879f700/R/repo.R#L176

Reprex:

base_dir <- file.path(tempfile(), "barret")
repo_dir <- file.path(base_dir, "repo")
vfs_dir <- file.path(base_dir, "vfs")
rwasm::add_pkg("cli", repo_dir = repo_dir)
rwasm::make_vfs_library(repo_dir=repo_dir, out_dir = vfs_dir)

Error:

Processing 1 package(s).
trying URL 'https://packagemanager.posit.co/cran/latest/src/contrib/cli_3.6.1.tar.gz'
Content type 'binary/octet-stream' length 565365 bytes (552 KB)
==================================================
downloaded 552 KB

Warning messages:
1: In normalizePath("repo") : path[1]="repo": No such file or directory
2: In gzfile(tarfile, "wb", compression = compression_level) :
  cannot open compressed file 'repo/src/contrib/cli_3.6.1.tar.gz', probable reason 'No such file or directory'
3: In gzfile(tarfile, "wb", compression = compression_level) :
  cannot open the connection
Packaging: library.data
Error in file_packager(lib_abs, out_dir, out_name = out_name) : 
  An error occurred running `file_packager`:
Remember to build the main file with `-sFORCE_FILESYSTEM` so that it includes support for loading this file package
Nothing to do!
Calls: <Anonymous> -> file_packager
In addition: Warning message:
In system2(file_packager, args = c(data_file, "--preload", sprintf("'%s@/'",  :
  running command ''/opt/emsdk/upstream/emscripten/tools/file_packager' library.data --preload '/tmp/Rtmp3Qy1hw/file16ecf6770@/' --separate-metadata --js-output='library.js' 2>&1' had status 1
Execution halted
georgestagg commented 9 months ago

Thanks, this should now be fixed as a consequence of the changes in 4fe1a741be27cc57afe3e20661d8935eb4602058 and 9a4d8af900addb48bbafa6a0764d6feedde0cfad.