quarto-dev / quarto-dev/quarto-cli
Quarto does not respect execute-dir in Google Drive Shared Directories
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
When my working directory on my Mac is within a Google Drive folder that is shared with my Google Drive account (reached via shortcut), Quarto does not respect the execute-dir: project option. This can cause problems with rendering if you have referenced other files assuming the main project directory is the working directory. I suspect this is a larger issue than just the execute-dir option (Google Drive does weird things with these shortcut folders), and it might not even be fixable on your end, but I wanted to flag it just in case. Also, just using execute-dir: file and changing all my file references isn't a great option, because then the code doesn't work interactively, when my working directory IS the project directory.
Reprex
-
Install the Google Drive desktop app for Mac
-
Create a Quarto project within a directory that is shared with your google drive account (access it by creating a shortcut to that directory in your Google Drive 'My Drive' folder), add the following to the
_quarto.ymlfile:project: title: "test" execute-dir: project -
To demonstrate the issue, create a subdirectory called
codewithin the project folder. Create two files within this subdirectory, with the following contents:test.R
print("hello, world")test.qmd
--- title: "test" format: html execute-dir: project --- ```{r} source("code/test.R") ``` -
Attempt to render this
.qmdfile (or project). The render will fail with the following error:Quitting from lines 8-9 (test.qmd) Error in file(filename, "r", encoding = encoding) : cannot open the connection Calls: .main ... eval_with_user_handlers -> eval -> eval -> source -> file Execution halted
System Stats
Results of quarto check:
[✓] Checking Quarto installation......OK
Version: 0.9.637
Path: /Applications/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.9.6 (Conda)
Path: /Users/connor/opt/miniforge/bin/python
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with conda install jupyter
[✓] Checking R installation...........OK
Version: 4.2.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
rmarkdown: 2.14
[✓] Checking Knitr engine render......OK
RStudio Version 2022.02.3 Build 492. Session Info:
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-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.2.1 tools_4.2.1
Checklist
- formatted your issue so it is easier for us to read?
- included a minimal, self-contained, and reproducible example?
- documented the quarto version you're running, by providing the output produced by
quarto checkin a terminal in your issue? - documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the project _quarto.yml, code/test.qmd, and code/test.R on macOS using a Google Drive shared-directory shortcut. Check how execute-dir: project is applied during the render and compare it with the paths used by source("code/test.R"). Done means the example renders successfully with the project directory as its working directory, or the limitation is documented if the shortcut path cannot be handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100