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

Wrong function method in julia environment configuration. #10225

Closed
XLin0mu opened this issue Jul 4, 2024 · 8 comments · Fixed by #10244
Closed

Wrong function method in julia environment configuration. #10225

XLin0mu opened this issue Jul 4, 2024 · 8 comments · Fixed by #10244
Labels
bug Something isn't working

Comments

@XLin0mu
Copy link

XLin0mu commented Jul 4, 2024

Bug description

Codes at the file https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/julia/ensure_environment.jl:

#...
manifest_matches_project_toml = Pkg.is_manifest_current() === true # this returns nothing if there's no manifest

It lead to an error as follow:

quarto preview e:/DESKTOP/test.qmd --no-browser --no-watch-inputs  21:13:54 
Starting julia control server process. This might take a while...
ERROR: LoadError: MethodError: no method matching is_manifest_current()
The function `is_manifest_current` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  is_manifest_current(::Pkg.Types.Context)
   @ Pkg D:\MyTools\julia\share\julia\stdlib\v1.11\Pkg\src\API.jl:489
  is_manifest_current(::AbstractString)
   @ Pkg D:\MyTools\julia\share\julia\stdlib\v1.11\Pkg\src\API.jl:490

Stacktrace:
 [1] top-level scope
   @ D:\MyPrograms\Quarto\share\julia\ensure_environment.jl:17
in expression starting at D:\MyPrograms\Quarto\share\julia\ensure_environment.jl:17
ERROR: Ensuring an updated julia server environment failed

Obviously.

And it'll be solved if modify that line as:

manifest_matches_project_toml = Pkg.is_manifest_current(dirname(Base.active_project())) === true # this returns nothing if there's no manifest

Everything works well till now after modifying.

Steps to reproduce

As above.

Expected behavior

Everyting works.

Actual behavior

Error. As above.

Your environment

VSCode@Windows10
julia: Version 1.11.0-beta2
Quarto: 1.5.53

Quarto check output

Quarto 1.5.53
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.53
      Path: D:\MyPrograms\Quarto\bin
      CodePage: 936

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: Installation From Path
      Path: D:\MyPrograms\texlive\2024\bin\windows
      Version: 2024

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

[>] Checking Python 3 installation....OK
      Version: 3.12.3
      Path: D:/MyPrograms/Python312/python.exe
      Jupyter: (None)

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

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
@XLin0mu XLin0mu added the bug Something isn't working label Jul 4, 2024
@cscheid
Copy link
Collaborator

cscheid commented Jul 4, 2024

(tagging @jkrumbiegel)

@jkrumbiegel
Copy link
Contributor

I assumed this function was relatively stable but seems they changed it in 1.11. Would need branching maybe, or giving the folder argument explicitly might work on older versions as well.

@cscheid
Copy link
Collaborator

cscheid commented Jul 4, 2024

they changed it in 1.11

"They" being the Julia authors, since (again, I'm inferring) 1.11 is the of Julia (and its stdlib) you're referring to? I'm just trying to understand the situation and exposure here.

@jkrumbiegel
Copy link
Contributor

Yes, 1.11 is the upcoming version and this specific Pkg function must have changed signatures. Maybe I misjudged its API status and it was not intended to be used in a stable manner.

@cderv
Copy link
Collaborator

cderv commented Jul 4, 2024

They changed it in

It seems only one tool used it Publicly on Julia package manager. This tool now adapt to it comparing version
https://github.com/oscar-system/Oscar.jl/blob/27ec7aad12afa28e41adafd86f5fef5b86f74b38/src/Oscar.jl#L167-L173

From a github search it seems we are the only other project on Github
https://github.com/search?q=Pkg.is_manifest_current+language:Julia+&type=code

@jkrumbiegel
Copy link
Contributor

Nice find. Yeah I'm not surprised no packages were using it as you usually don't have to do any package management in a package itself. But it will be easy enough to apply the same workaround as the one you linked.

@cscheid
Copy link
Collaborator

cscheid commented Jul 5, 2024

It looks like they're close to shipping: https://github.com/JuliaLang/julia/milestone/46

Ideally, we'd be able to get a fix for this before November. From how you're responding, it seems that this should be no problem. Can you confirm that this is the case? Thanks!

@jkrumbiegel
Copy link
Contributor

I'll try to make a PR on Monday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants