-
Notifications
You must be signed in to change notification settings - Fork 43
feat: Consider QUARTO_PANDOC for Pandoc path lookup #740
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
Conversation
Hi! Thanks for your contribution. Can you reexplain the problem you are trying solve? I understand this is because of Nix specific build and setup for QUarto, right? To remind you of the context, Quarto works with an expected version of Pandoc. Quarto's installer does bundle Pandoc, and the VSCODE extension currently looks in there. Nix package does set So I wonder if the "fix" should be to look for Nix could also add symlink in the expected place. I hope it makes sense. I am trying to prevent side effects if the VSCode extension starts to detect unwanted Pandoc. |
Thank you, Christophe. The problem is that the NixOS quarto package doesn't bundle pandoc inside it like in other distributions. In fact, nixpkgs explicitely deletes it, so the default I like your idea better, though. As far as I can tell, currently nothing in the codebase uses |
Yes, I know they remove it - they set the env var to the real location. They could also have done symlink I guess. The env var is the expected advanced way to change Pandoc used by Quarto, so I would use this instead of trying to detect outside of Quarto. |
Check out the current status of my branch. I reset all my changes to go with just the env variable (plus some auto-formatting apparently). Works for my use. Would love your guidance to eventually get this merged |
I pulled this PR and tested it locally. I built with Looks good to me. |
We know this is used in Nix Packaging (https://github.com/NixOS/nixpkgs/blob/dc9637876d0dcc8c9e5e22986b857632effeb727/pkgs/development/libraries/quarto/default.nix#L62-L66) and in conda-forge packaging (https://github.com/conda-forge/quarto-feedstock) Nix does that by setting the env var Anyhow, they both may not have the expected version where we look for it quarto/packages/quarto-core/src/context.ts Lines 79 to 92 in 57ed6fb
So it seems interesting to make this configurable for those environment configuration. Any thoughts now you know this context ? |
The direct answer here is "yes". But this is more of a foot gun than it is a security issue. The difference is due to the threat models at play. The reason that analogy is important is that That's a real consideration for how you should think about We need to fix this by documenting this behavior in https://quarto.org/docs/advanced/environment-vars.html (same for |
Thanks for the clarification @cscheid ! Still ok to merge this right ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and would make the behavior of the extension match that of quarto-cli.
@fflores97 Thanks for the contribution, we will merge it. Although we don't need a contributor agreement for a small PR like this, you might want to send one so that's one fewer step in the future. If you're willing to do that, we have instructions you can follow in our website. |
More general solution to pandoc path issues I encountered. I re-use path lookup logic that looks for the
quarto
binary to find thepandoc
binary, and added a setting in case the user wants to hardcode it.Would love some help with the frequent paths for the
pandoc
binary and just contributing to this repo in general.Thanks!