Skip to content

Bug fix on unloading loaded packages#390

Open
joshuamarie wants to merge 1 commit intoklmr:mainfrom
joshuamarie:main
Open

Bug fix on unloading loaded packages#390
joshuamarie wants to merge 1 commit intoklmr:mainfrom
joshuamarie:main

Conversation

@joshuamarie
Copy link

Hi. I've been working on a rather new tool to manage modules, built in Rust (this is the only tool that I know of). It's called carrier and here's the details on how to use it. Then, I tried the following new tool, and successfully installed modules throughout the system, though I acknowledged that the following tool I made is far far from perfect. Then, I modified {box}, where it is able to read "installed" .rmbx modules, also a success.

Let's put this aside, for now. When I am busy reverse engineering this package to sync with the tool I've been working on, I detected some kind of bug, where it throws an error when unloading R packages you loaded with box::use().

Error details:

box::unload(dplyr)
#> Error in `get0()`:
#> ! use of NULL environment is defunct
#> Hide Traceback
#>     ▆
#>  1. └─box::unload(dplyr)
#>  2.   └─box:::unload_mod(mod_ns, attr(mod, "info"))
#>  3.     └─box:::call_hook(mod_ns, ".on_unload", mod_ns)
#>  4.       └─box:::namespace_info(ns, "legacy", FALSE)
#>  5.         └─base::get0(which, ns$.__module__., inherits = FALSE, ifnotfound = default)

This occurs only for packages, not for the loaded local modules, or even on the "installed modules" I've been working on.

I don't know if you are aware this kind of problem and I don't know if this is a bug or a feature (if it is really intended for packages), but I believe this is kind of worth noting. Thus, I made a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant