Repository navigation
Handling a sess installed by conda / pixi #1854
Replies: 1 comment 4 replies
|
Thanks for the proposal and your work on conda-forge! I would prefer not to relax the source revision check. Also, sess installation is optional when starting an R terminal. Longer term, I'd like to explore eliminating sess's R package dependencies entirely, potentially by moving backend functionality to an external executable such as arf. However, I agree that installing sess into user-managed R libraries is undesirable. Contributions toward that approach would be very welcome! |
Uh oh!
There was an error while loading. Please reload this page.
Heyo!
I maintain rpix, an R interface to the pixi package manager, which installs R and R packages from conda-forge into per-project environments. I'd like VS Code users of rpix to get a working session watcher out of the box. To that end I've submitted
r-sess(3.0.1) andr-jgdto conda-forge (conda-forge/staged-recipes#35105, conda-forge/staged-recipes#35104).With 3.0.1 this works: the extension accepts an installed sess whose version is at least the bundled one. The source-revision check on
main(#1819, #1840) changes that, and I'd like to raise it before it ships.What will happen
A conda-built sess never matches. conda-forge builds from the release tarball (
archive/refs/tags/vX.Y.Z.tar.gz), which has no Git checkout. Sobootstrap.Rcan't run, and the installed DESCRIPTION keeps@VSCODE_R_SESS_SOURCE_REVISION@.sess_installed_source_revision()returnsNULL, and the user is asked to install the bundled copy.The bundled copy gets installed into a library the package manager owns.
install_sess.Rinstalls to.libPaths()[1]when it's writable. In a conda/pixi environment that's one of two places:conda-ecosystem-user-package-isolation, which rpix adds by default,R_LIBS_USERpoints to a folder that doesn't exist..libPaths()[1]is then$CONDA_PREFIX/lib/R/library.R CMD INSTALLoverwrites the files of the conda-managedr-sesspackage, and conda/pixi no longer know what's on disk.Even a matching stamp would not be enough on its own. The extension updates automatically, and the conda-forge package follows a few hours or days later. During that gap every conda user would see a mismatch, with the same result as in point 2.
Possible directions
These aren't mutually exclusive, and you'll know better which fit the design:
sess_source.Rdescribes the source revision as "deployment identity only", while runtime compatibility is checked byprotocol_versionduring attach. One option is to skip the install prompt, or make it optional, when the installed sess has the sameprotocol_versionbut a missing or different stamp. A setting such asr.sessionWatcher.requireBundledSess, defaulting to the current behaviour, would also work.dist/resources/sess/. Downstream packagers could then build the exact same files with the same identity, without needing Git. It doesn't fix the timing gap in point 3, but it would make the conda package match whenever versions line up.file.exists(file.path(Sys.getenv("CONDA_PREFIX"), "conda-meta"))), the bundled copy could go into a private, extension-managed library instead of.libPaths()[1]. The Interactive runtime already does this viaVSCODE_R_SESS_LIBRARY.I'm happy to test any of these with pixi/conda environments, or to help with a PR if one direction looks right to you.
Environment
mainat 2a6ab2a (behaviour described above); 3.0.1 is finer-sess3.0.1 (pending in staged-recipes)I drafted this with help from an AI assistant (Claude Code), which read the vscode-R sources to check the behaviour described. I reviewed it before posting.
All reactions