insightsengineering / insightsengineering/teal.code

[Feature Request]: Explore and implement robust sandboxing mechanism

Open
#201 1 comment 0 reactions 0 assignees View on GitHub
core enhancement
Dominant language
R
Stars
12
Forks
11
Avg merge
1d 17h
Merged PRs (30d)
1

Description

### Feature description

Currently `eval_code` evaluates each call in the new (cloned) environment where `parent.env(env) <- parent.env(.GlobalEnv)`. When executing `library` via `eval_code` new `library` is added over each `qenv@env` - i.e. all `qenv` objects have the same package-namespaces in the search path.

We would like to separate `@env` as much as possible.

### Separate search path for each `env@env`

So that each `qenv` is a child of libraries which have been attached in this `eval_code`

![Namnlöst diagram drawio](https://github.com/insightsengineering/teal.code/assets/6959016/abfff3ce-372b-43ff-a177-91bde89f3ab3)

### Separate `qenv` sessions

Other solution is to separate sessions where `eval_code` is executed [rlang::r_session](https://callr.r-lib.org/reference/r_session.html)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.