R Under development (unstable) (2025-06-15 r88316 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(packrat) > > (function() { + + # Disable R_TESTS within this scope (we don't want the R + # subprocess to attempt to call startup.Rs) + R_TESTS <- Sys.getenv("R_TESTS", unset = NA) + if (!is.na(R_TESTS)) { + Sys.unsetenv("R_TESTS") + on.exit(Sys.setenv(R_TESTS = R_TESTS), add = TRUE) + } + # Force tar to internal to avoid xattr errors on macOS when building and + # installing our test packages. The default macOS tar binary produces + # AppleDouble archives. + TAR <- Sys.getenv("TAR", unset = NA) + Sys.setenv(TAR = "internal") + if (!is.na(TAR)) { + on.exit(Sys.setenv(TAR = TAR), add = TRUE) + } else { + on.exit(Sys.unsetenv("TAR"), add = TRUE) + } + + dir <- tempdir() + owd <- setwd(dir) + on.exit(setwd(owd), add = TRUE) + + # Save repos + repos <- getOption("repos") + on.exit(options(repos = repos), add = TRUE) + + # Create the local repo + localCRAN <- file.path(dir, "sushi") + packrat::repos_create(localCRAN) + on.exit(unlink(localCRAN, recursive = TRUE), add = TRUE) + + # Use only the 'sushi' repository + options(repos = getOption("repos")["sushi"]) + + # Create an example package. + env <- new.env(parent = emptyenv()) + env$sashimi <- function() {} + suppressMessages( + utils::package.skeleton("sashimi", path = dir, environment = env) + ) + on.exit(unlink(file.path(dir, "sashimi"), recursive = TRUE), add = TRUE) + + # tidy up the broken package + unlink(file.path(dir, "sashimi/man"), recursive = TRUE) + + # Try uploading the package from the directory itself (requires building) + message("\nBuilding sashimi:\n") + packrat::repos_upload(file.path(dir, "sashimi"), "sushi") + + # Try building and uploading a tarball + system2(file.path(R.home("bin"), "R"), + c("--vanilla", + "CMD", + "build", + file.path(dir, "sashimi")), + env = c(COPYFILE_DISABLE = "1")) + tarball <- list.files(dir, pattern = "\\.tar\\.gz$")[[1]] + packrat::repos_upload(file.path(dir, tarball), "sushi") + + # Try installing the package as normal + tempLib <- file.path(dir, "library") + if (!file.exists(tempLib)) { + dir.create(tempLib) + on.exit(unlink(tempLib, recursive = TRUE), add = TRUE) + } + install.packages("sashimi", lib = tempLib, type = "source") + + # avoid bogus warning from R CMD check + eval(call("library", "sashimi", lib.loc = tempLib)) + detach("package:sashimi", unload = TRUE) + + })() Local CRAN repository 'sushi' created at: - "D:/temp/2025_06_16_21_45_17_768/RtmpOkcYcA/sushi" Building sashimi: "D:/RCompile/recent/R/bin/x64/R" --vanilla CMD build \ "D:\temp\2025_06_16_21_45_17_768\RtmpOkcYcA\sashimi-ER8015JM8b7wAfQX" \ --no-manual --no-resave-data * checking for file 'D:\temp\2025_06_16_21_45_17_768\RtmpOkcYcA\sashimi-ER8015JM8b7wAfQX/DESCRIPTION' ... OK * preparing 'sashimi': * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories * building 'sashimi_1.0.tar.gz' Package 'sashimi_1.0.tar.gz' successfully uploaded. * checking for file 'D:\temp\2025_06_16_21_45_17_768\RtmpOkcYcA/sashimi/DESCRIPTION' ... OK * preparing 'sashimi': * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories * building 'sashimi_1.0.tar.gz' Package 'sashimi_1.0.tar.gz' successfully uploaded. * installing *source* package 'sashimi' ... ** this is package 'sashimi' version '1.0' ** using staged installation ** R ** byte-compile and prepare package for lazy loading ** help No man pages found in package 'sashimi' *** installing help indices ** building package indices ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (sashimi) > > proc.time() user system elapsed 0.48 0.15 2.85