- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.7k
 
allow artifact string macro to take an explicit path to the artifact file #46755
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
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.
Can we call the value “artifacts_toml_path” or something like that, to avoid confusion with the actual path of the artifact we want to return?
can be used by JLLs to avoid scour throgh the file system for the Artifacts.toml when it already knows where it is
We must provide the `platform` argument here before we provide the `artifacts_toml_path` argument.
4013bc5    to
    02f3df8      
    Compare
  
    | 
           @staticfloat, good to go?  | 
    
| find_artifacts_toml(srcfile) | ||
| else | ||
| artifacts_toml_path | ||
| eval(artifacts_toml_path) | 
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.
Did you try this @staticfloat? It seems to error for me:
In [3]: using Vulkan_Headers_jll
[ Info: Precompiling Vulkan_Headers_jll [8d446b21-f3ad-5576-a034-752265b9b6f9]
ERROR: LoadError: Evaluation into the closed module `Artifacts` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `Artifacts` with `eval` during precompilation - don't do this.
Stacktrace:
 [1] eval
   @ ./boot.jl:370 [inlined]
 [2] eval(x::String)
   @ Artifacts ~/julia/usr/share/julia/stdlib/v1.9/Artifacts/src/Artifacts.jl:3
 [3] var"@artifact_str"(__source__::LineNumberNode, __module__::Module, name::Any, platform::Any, artifacts_toml_path::Any)
   @ Artifacts ~/julia/usr/share/julia/stdlib/v1.9/Artifacts/src/Artifacts.jl:665
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.
No, I only tried it with the test set, which doesn't hit this error, apparently. @vtjnash what is the correct fix here? I don't really understand how to properly "get" the value of a string at compile-time I guess.
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.
What was it that failed before this change? I tried it with JLLWrappers and it seemed to work ok without the eval.
This causes the eval to be invoked in user scope, rather than in the `Artifacts` module itself. X-ref: #46755 (review)
This causes the eval to be invoked in user scope, rather than in the `Artifacts` module itself. X-ref: #46755 (review)
…rtifact file (JuliaLang#46755)" This reverts commit 1720a54.
…rtifact file (JuliaLang#46755)" This reverts commit 1720a54.
can be used by JLLs to avoid scouring through the file system for the Artifacts.toml when it already knows where it is
JLLWrappers PR at JuliaPackaging/JLLWrappers.jl#45