quarto has different `.Rprofile` behavior in Single File mode depending if `--output-dir` is used
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, r
- 领域
- cli
调研方向
Start by reproducing the two quarto render commands with --execute-dir and with both --execute-dir and --output-dir, then trace the CLI's Single File execution-directory handling. Compare how R is launched in each case and verify that both commands load the .Rprofile from the execution directory when done.
由索引模型根据 Issue 内容生成。
描述
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
When using the --execute-dir <dir1> option R will be launched from the target directory <dir1> thus using the .Rprofile of that directory, this is regardless of where the source file lives.
However if you also provide --output-dir <dir2> R will instead be launched from the directory of the source file thus ignoring any .Rprofile file in <dir1> or <dir2>. I'm not 100% sure but I think in this case you are launching R from the source file directory and then internally running setwd() to move the directory to <dir1>. This issue occurs even if <dir1> and <dir2> are the same directory.
Steps to reproduce
> tree -a
.
├── .Rprofile
├── code
│ └── test2.qmd
└── runme.sh
.Rprofile
cat("hi from code/.Rprofile\n")
cat("getwd() = ", getwd(), "\n")
test2.qmd
---
title: "Untitled"
format: html
---
```{r}
getwd()
```
runeme.sh
quarto render \
code/test2.qmd \
--execute-dir $(pwd) \
--metadata "embed-resources: true"
quarto render \
code/test2.qmd \
--output-dir "$(pwd)" \
--execute-dir "$(pwd)" \
--metadata "embed-resources: true"
Actual behavior
The first render attempt (just using --execute-dir) makes use of the .Rprofile and produces stdout of:
> quarto render \
code/test2.qmd \
--execute-dir $(pwd) \
--metadata "embed-resources: true"
hi from .Rprofile
getwd() = /Users/gowercr1/Desktop/Work/xxx-testing-quarto
processing file: test2.qmd
1/3
2/3 [unnamed-chunk-1]
3/3
output file: test2.knit.md
The second render however does not load the .Rprofile
> quarto render \
code/test2.qmd \
--output-dir "$(pwd)" \
--execute-dir "$(pwd)" \
--metadata "embed-resources: true"
processing file: test2.qmd
1/3
2/3 [unnamed-chunk-1]
3/3
output file: test2.knit.md
Expected behavior
Both should use the .Rprofile from the execution directory
Your environment
MacOS - 26.6.2
R version 4.6.1 (2026-06-24) -- "Happy Hop"
quarto --version
1.10.18
Quarto check output
> quarto check
Quarto 1.10.18
[✓] Checking environment information...
Quarto cache location: /Users/gowercr1/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.101.0: OK
Deno version 2.7.14: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.10.18
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /Library/TeX/texbin
Version: 2026
[✓] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Source: MacOS known location
[✓] Checking basic markdown render....OK
[✓] Checking R installation...........OK
Version: 4.6.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.6/Resources/library
knitr: 1.51
rmarkdown: 2.32
[✓] Checking Knitr engine render......OK
[✓] Checking Python 3 installation....OK
Version: 3.9.6
Path: /Library/Developer/CommandLineTools/usr/bin/python3
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking Julia installation...
- 主要语言
- JavaScript
- 星标
- 6.1k
- 派生
- 466
- 平均合并
- 20 小时 28 分钟
- 30 天内合并 PR
- 64
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 60/100
quarto-dev/quarto-cli#15042 ·
维护者通常 1 天内回复
-
accessibility documentation revealjs
难度 2/5 1-3 小时 新手友好度 86/100
quarto-dev/quarto-cli#14971 ·
维护者通常 1 天内回复
-
accessibility revealjs
难度 2/5 1-3 小时 新手友好度 88/100
quarto-dev/quarto-cli#14970 · 1 条评论 ·
维护者通常 1 天内回复
-
accessibility revealjs themes
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto-cli#14963 ·
维护者通常 1 天内回复
-
accessibility revealjs themes
难度 1/5 1 小时以内 新手友好度 88/100
quarto-dev/quarto-cli#14962 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
schmayterling/hibi#245 ·
维护者通常 1 天内回复
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug package:vitest
难度 2/5 1-3 小时 新手友好度 70/100
cloudflare/workers-sdk#16255 · 1 条评论 ·
维护者通常 1 天内回复
-
Proxy and MCP URLs with an empty authority parse as a different host可能已有人在做 @ericcaiwx-star 今天认领。 未关闭clawsweeper:bulk-filed clawsweeper:linked-pr-open clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
难度 2/5 1-3 小时 新手友好度 75/100
openclaw/openclaw-enterprise#2384 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
Access-request approve silently discards the decider's note (decision_note written only on deny)未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
Uuriko/project-room#3378 ·
维护者通常 1 天内回复