Fix quarto inspect standalone file project emission for RStudio#14307
Open
Fix quarto inspect standalone file project emission for RStudio#14307
Conversation
Current RStudio releases assume project.dir in quarto inspect output implies a _quarto.yml exists. Since f6a0f89 (v1.9.35), standalone files always get a project context for engine extension resolution, which causes inspect to emit project.dir for standalone files. RStudio then adds _quarto.yml to the deploy list, file.info() returns NA, and the publishing wizard crashes. Gate the project emission on !(isSingleFile && isRStudio()) so current RStudio releases continue to work. The RStudio-side fix is in rstudio/rstudio#17336. Fixes rstudio/rstudio#17333
2 tasks
Collaborator
Author
|
@cscheid is that what you add in mind as a fix ? I wanted to try gate this for RStudio Version, but I don't think it can be accessed easily unfortunately. So I just have a scoped build to hide project from inspect in rstudio. But maybe you want to remove singleFile project info from inspect in all cases ? I hesitated doing this, so happy to get your thought. Also I have made the backport so current release 1.9 works in existing and old RStudio IDE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When publishing a standalone Quarto document from RStudio's publishing wizard with Quarto >= 1.9.35, the wizard crashes with "missing value where TRUE/FALSE needed".
Root Cause
Commit f6a0f89 (v1.9.35, fix for #14208) moved
result.config = result.config || { project: {} }outside theif (renderOptions)block insingleFileProjectContextso Julia engine extensions resolve correctly during preview. Side effect:context.configis now always truthy for standalone files, soinspectDocumentConfigemits aprojectfield withdirset to the file's parent directory.RStudio's C++ bridge (
SessionQuarto.cpp) readsproject.dirfromquarto inspectoutput and assumes_quarto.ymlexists there. It adds the config file to the deploy list,file.info()returns NA for the non-existent file, and the size comparison crashes.Fix
Gate
projectemission ininspectDocumentConfigon!(isSingleFile && isRStudio()). This preserves the "everything is a project" direction for non-RStudio consumers while maintaining compatibility with current RStudio releases.Alternative Considered
Unconditionally suppressing
projectfor all single-file contexts (!context.isSingleFile) would also fix the issue without RStudio detection. However, single-file projects are intentional internal behavior and other consumers may rely on the project metadata. The RStudio-specific gate is more targeted.The RStudio-side fix is in rstudio/rstudio#17336 (merged) but will not be backported to older releases. This Quarto-side workaround protects users on older RStudio versions that upgrade Quarto independently.
Also adds
_setIsRStudioForTest()override inplatform.tsto avoidDeno.env.set()race conditions in parallel tests (#14218).Test Plan
quarto inspect standalone.qmdwith RStudio override: noprojectfield in outputquarto inspect standalone.qmdwithout override:projectfield present withdirRef: rstudio/rstudio#17333