Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Quarto file options not available in RStudio if the RStudio path or app has a space #7032

Closed
ronblum opened this issue Sep 27, 2023 · 6 comments · Fixed by #4980
Closed
Assignees
Labels
bug Something isn't working verify-fixed Already fixed, awaiting verification from the issue reporter to confirm.
Milestone

Comments

@ronblum
Copy link

ronblum commented Sep 27, 2023

Bug description

This issue is from rstudio/rstudio#12902 to link the repositories.
I believe this issue is fixed in Quarto 1.4, but bringing it over to track.

If the name or path of RStudio has a space in it, and hence the same for the path for quarto, the Quarto options aren't available in the File menu.

Steps to reproduce

  1. Install RStudio Desktop.
  2. Change the application's filename so that there's a space in it, e.g. RStudio Cherry Blossom
  3. Start RStudio Desktop.
  4. File -> New File
    • Quarto Document and Quarto Presentation are missing
  5. In the Console Pane: quarto::quarto_version()
    • An error is displayed:

    Error: invalid version specification ‘ERROR: Cannot determine the Quarto source path. This script must be run from the bin or common folder.’
    In addition: Warning message:
    In system2(quarto_bin, "--version", stdout = TRUE) :
    running command ''/Applications/RStudio Cherry Blossom.app/Contents/Resources/app/quarto/bin/quarto' --version' had status 1

Expected behavior

Quarto options should be available even if there's a space in the path or file name.

Actual behavior

If the name or path of RStudio has a space in it, and hence the same for the path for quarto, the Quarto options aren't available in the File menu.

Your environment

RStudio Edition : Desktop
RStudio Version : 2023.03.0+386, 2023.05.0-daily+92, and 2023.09.0+463
OS Version      : MacOS 13.2 and 14
R Version       : 4.2.3 and 4.3.1

Quarto check output

ronblum@Rons-Busy-Bee ~ % /Applications/RStudio\ Cherry\ Blossom.app/Contents/Resources/app/quarto/bin/quarto check 
ERROR: Cannot determine the Quarto source path. This script must be run from the bin or common folder.
ronblum@Rons-Busy-Bee quarto % mv /Applications/RStudio\ Cherry\ Blossom.app /Applications/RStudio-2023.09.0-463.app
ronblum@Rons-Busy-Bee quarto % /Applications/RStudio-2023.09.0-463.app/Contents/Resources/app/quarto/bin/quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.433
      Path: /Applications/RStudio-2023.09.0-463.app/Contents/Resources/app/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.4
      Path: /usr/local/opt/python@3.11/bin/python3.11
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/ronblum/Library/R/x86_64/4.3/library
        - /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
      knitr: 1.44
      rmarkdown: 2.25

[✓] Checking Knitr engine render......OK
@ronblum ronblum added the bug Something isn't working label Sep 27, 2023
@cderv
Copy link
Collaborator

cderv commented Sep 27, 2023

I can definitely reproduce this on Ubutun by moving the quarto folder in a path with space.

Issue is from

# Check if we are running 'Dev Mode' and if so, override values for devs
SCRIPT_BASENAME=$(basename $SCRIPT_PATH)
if [ "${SCRIPT_BASENAME}" == "bin" ]; then
# we can be running dev mode with a symlink to the package/dist/bin folder. In this case, our relative path is two levels up.
export QUARTO_ROOT="`cd "$SCRIPT_PATH/../../.." > /dev/null 2>&1 && pwd`"
elif [ "${SCRIPT_BASENAME}" == "common" ]; then
# we can run this script directly in the source tree. In this case, our relative path is three levels up.
export QUARTO_ROOT="`cd "$SCRIPT_PATH/../../.." > /dev/null 2>&1 && pwd`"
else
echo "ERROR: Cannot determine the Quarto source path. This script must be run from the bin or common folder."
exit 1
fi

cderv added a commit that referenced this issue Sep 27, 2023
@cderv
Copy link
Collaborator

cderv commented Sep 27, 2023

ronblum@Rons-Busy-Bee ~ % /Applications/RStudio\ Cherry\ Blossom.app/Contents/Resources/app/quarto/bin/quarto check 
ERROR: Cannot determine the Quarto source path. This script must be run from the bin or common folder.

@ronblum I push a commit that should fix this, and this should fix the File options in IDE. We were missing a quoting, which lead to wrong path computation.

Thanks a lot for report. I am leaving this open until this is confirmed that this was the issue.

@dragonstyle maybe we should backport this small change ? Quite important and really small change. What do you think ?

@cderv cderv added this to the v1.4 milestone Sep 27, 2023
@mcanouil mcanouil added the verify-fixed Already fixed, awaiting verification from the issue reporter to confirm. label Sep 27, 2023
@dragonstyle
Copy link
Collaborator

@cderv Thanks for fixing this! Unfortunately, I think we'd also want this commit (9f105ce) to fix the issue (I actually thought that did fix the issue ;-) ). We decided not to back port since it was a bigger change to the main script and we rarely have reports of people installing into paths with spaces (since that does unfortunately commonly create problems)...

@cderv
Copy link
Collaborator

cderv commented Sep 27, 2023

All good ! So first step was done in this PR

Just a missing pair of quotes then...

Should we build a pre-release so that @ronblum can test ?

@cderv
Copy link
Collaborator

cderv commented Sep 27, 2023

@ronblum 1.4.388 contains the fix if you want to try it

@dragonstyle
Copy link
Collaborator

This should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verify-fixed Already fixed, awaiting verification from the issue reporter to confirm.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants