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

basilisk.R needs to actually create the BasiliskEnvironment objects #66

Closed
LTLA opened this issue Jun 8, 2022 · 4 comments
Closed

basilisk.R needs to actually create the BasiliskEnvironment objects #66

LTLA opened this issue Jun 8, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@LTLA
Copy link
Contributor

LTLA commented Jun 8, 2022

When BASILISK_USE_SYSTEM_DIR=1, basilisk will attempt to provision the Conda environments in the R package's installation directory at install time. This is useful in shared installations, to avoid each user provisioning their own environments; it is also helpful in situations where the filesystem is to be considered read-only after all packages are installed.

System installation relies on the package's configure calling configureBasiliskEnv(), which in turn looks at R/basilisk.R to find the definitions of the BasiliskEnvironments. These definitions are retrieved and used to provision the environments before the package itself is fully installled. However, as the latest version of zellkonverter does not create the environments inside R/basilisk.R (instead defining a function to do so), this is breaking system installations.

The simple fix is to evaluate the function twice for each version inside basilisk.R:

old_anndata_env <-  zellkonverterAnnDataEnv(old_version)
new_anndata_env <- zellkonverterAnnDataEnv(new_version)

So that configureBasiliskEnv() knows what to do.

@lazappi lazappi added the bug Something isn't working label Jun 9, 2022
@lazappi lazappi closed this as completed in 3d23d5f Jun 9, 2022
@lazappi
Copy link
Member

lazappi commented Jun 9, 2022

I thought I was being clever with how I set this up but obviously I overlooked some things. I have made the suggested fix in release and devel, re-open this if there are still issues.

@LTLA
Copy link
Contributor Author

LTLA commented Jun 21, 2022

The commit almost fixes it, but not quite. basilisk.R needs to be able to evaluate without errors, i.e., running source("basilisk.R") should yield valid results. Unfortunately, the function makes a reference to .get_verbose(), which is not defined in the same file; this causes installation errors such as:

* installing *source* package ‘zellkonverter’ ...
** using non-staged installation via StagedInstall field
Error in .get_verbose(parent.frame()) : 
  could not find function ".get_verbose"
Calls: <Anonymous> -> eval -> eval -> zellkonverterAnnDataEnv
Execution halted

@lazappi
Copy link
Member

lazappi commented Jun 22, 2022

Ah. I fixed that when loading the package but I didn't realise the file needs to be sourced directly. Will fix that.

@lazappi
Copy link
Member

lazappi commented Jun 23, 2022

I moved all the printing out of this file so shouldn't be any issues sourcing it by itself now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants