Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Globalenv variables are not picked up by future::getGlobalsAndPackages

未关闭
#548 4 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
r

调研方向

首先使用 future::getGlobalsAndPackages 和 multisession 计划运行已报告的 R 复现,然后跟踪函数如何发现通过 env$a 引用的 globals。当检测到 globalenv 中的变量 d,并且示例在没有 object-not-found 错误的情况下返回 2 时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug

Describe the bug

I found variables in the globalenv are not correctly picked up. Not sure if this is on purpose

Reproduce example

env <- new.env()
d <- 1
env$a <- function(b){
  b + d
}
future::plan("multisession")
f <- future::future({
  env$a(1)
})
future::value(f)
#> Error in env$a(1) : object 'd' not found

Expected behavior

Variable d is not picked up by future::getGlobalsAndPackages, otherwise the result should be 2

Session information
Please share your session information after the error has occurred so that we also see which packages and versions are involved, e.g.

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.5.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.1    parallelly_1.28.1 parallel_4.1.1    tools_4.1.1      
[5] listenv_0.8.0     codetools_0.2-18  digest_0.6.27     globals_0.14.0   
[9] future_1.22.1 
主要语言
R
星标
1k
派生
93
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

futureverse/future 的其他 Issue

查看 futureverse/future 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。