rattlerthis is the "rattler" backend of
condathis. It solves, installs
and activates 'Conda' environments inside the R process, through the Rust
library rattler (the engine behind
pixi), bound to R with rextendr. There
is no package manager binary to download.
rattlerthis exports no functions. Everything a user does goes through
condathis with method = "rattler": the arguments, checks, messages,
results and error classes are those of condathis.
Building from source needs a Rust toolchain, rustc >= 1.88.0 and cargo
(https://rustup.rs), plus:
pkg-config and the OpenSSL development headers (libssl-dev or
openssl-devel);rustup default stable-x86_64-pc-windows-gnu). With the MSVC host, the
C code of the zstd-sys crate would need an x86_64-w64-mingw32-gcc
that Rtools45 does not have;aarch64-pc-windows-gnullvm
(rustup target add aarch64-pc-windows-gnullvm);# install.packages("pak")
# pak::pak("luciorq/rattlerthis")
install.packages("rattlerthis", repos = c('https://luciorq.r-universe.dev', 'https://cloud.r-project.org'))
This also installs the condathis version that rattlerthis needs. The
build downloads the Rust crates it needs from crates.io and GitHub.
WebAssembly (webR) is not supported: rattler cannot be built for it, and
webR cannot run the commands of an environment. There, rattlerthis
installs without its Rust library, and method = "rattler" fails with an
error of class rattlerthis_rust_unavailable (also
condathis_backend_unsupported) that says so.
library(condathis)
create_env("ripgrep", env_name = "rg", method = "rattler")
run("rg", "--version", env_name = "rg")
list_envs(method = "rattler")
remove_env("rg", method = "rattler")
condathis loads rattlerthis when method = "rattler" is used, and when
rattler environments exist, so method = "auto" finds them without loading
anything by hand.
The environments and rattler's caches live in
condathis::backend_root_dir("rattler"), the rattler directory inside
condathis's data directory. condathis::with_sandbox_dir() moves it with
the rest of condathis's directories, and condathis::clean_cache()
cleans rattler's caches too.
rattlerthis has no options and no environment variables of its own.
condathis's settings apply, and the generic Conda variables
CONDA_OVERRIDE_* are honored, as micromamba honors them.
Both backends behave the same wherever possible: commands run in the
same activated environment (also one given by env_path()), activations
are cached, pip sections of environment files are installed and listed
alike, and condathis lets one R session at a time change an
environment. The main differences:
pre-link, post-link and pre-unlink scripts
of packages; condathis warns and names the packages
(condathis_link_scripts_skipped). micromamba runs them. activate.d
scripts run with both..pyc compilation of noarch Python packages at install time."cmd" prints a one-line
description, and the results of create_env() and install_packages()
have NA in cmd and pid, and in stderr unless pip steps ran (then
pip's standard error).condathis's classes; the parent condition has rattler's
(rattlerthis_rattler_<kind>) instead of micromamba's status classes.MAMBA_EXE, a condabin directory on PATH; LC_ALL on
Linux and macOS; PYTHONUTF8 and others on Windows).CACHEDIR.TAG in every environment, and
paths 8 characters longer than micromamba's.~/.mamba/auth/authentication.json, .netrc); retries and time-outs
differ.?rattlerthis lists the differences a user may notice.
The test suite runs with NOT_CRAN=true and must end with 0 failures, 0
errors and exactly 2 skips: the two wheel tests, which skip because the
wheels Cargo feature is off by default. The parity tests compare both
backends with the micromamba binary named by CONDATHIS_MICROMAMBA_PATH;
some download from conda-forge. CI (.github/workflows/) runs the check
and that test step on Linux, macOS, Windows x64 and Windows on ARM64.
The vendored Rust crates, src/rust/vendor.tar.xz (written by
just update-vendor), are not in git. A build without them downloads
the crates from crates.io, as CI and r-universe do; with them, the build
is offline. The tarball is made only before a CRAN submission and for
major releases, and each one is to be archived on Zenodo. PLAN.md
("Releasing the vendored tarball") has the policy and the checksum
tooling it still needs.