Skip to content

Commit 36b4f54

Browse files
committed
Revert "allow artifact string macro to take an explicit path to the artifact file (JuliaLang#46755)"
This reverts commit 1720a54.
1 parent a35e53d commit 36b4f54

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

stdlib/Artifacts/src/Artifacts.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -654,18 +654,13 @@ access a single file/directory within an artifact. Example:
654654
!!! compat "Julia 1.6"
655655
Slash-indexing requires at least Julia 1.6.
656656
"""
657-
macro artifact_str(name, platform=nothing, artifacts_toml_path=nothing)
657+
macro artifact_str(name, platform=nothing)
658658
# Find Artifacts.toml file we're going to load from
659659
srcfile = string(__source__.file)
660660
if ((isinteractive() && startswith(srcfile, "REPL[")) || (!isinteractive() && srcfile == "none")) && !isfile(srcfile)
661661
srcfile = pwd()
662662
end
663-
# Sometimes we know the exact path to the Artifacts.toml file, so we can save some lookups
664-
local artifacts_toml = if artifacts_toml_path === nothing || artifacts_toml_path == :(nothing)
665-
find_artifacts_toml(srcfile)
666-
else
667-
eval(artifacts_toml_path)
668-
end
663+
local artifacts_toml = find_artifacts_toml(srcfile)
669664
if artifacts_toml === nothing
670665
error(string(
671666
"Cannot locate '(Julia)Artifacts.toml' file when attempting to use artifact '",
@@ -695,7 +690,7 @@ macro artifact_str(name, platform=nothing, artifacts_toml_path=nothing)
695690

696691
# If `name` is a constant, (and we're using the default `Platform`) we can actually load
697692
# and parse the `Artifacts.toml` file now, saving the work from runtime.
698-
if isa(name, AbstractString) && (platform === nothing || platform == :(nothing))
693+
if isa(name, AbstractString) && platform === nothing
699694
# To support slash-indexing, we need to split the artifact name from the path tail:
700695
platform = HostPlatform()
701696
artifact_name, artifact_path_tail, hash = artifact_slash_lookup(name, artifact_dict, artifacts_toml, platform)

stdlib/Artifacts/test/runtests.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ end
9191
HelloWorldC_exe_path = joinpath(HelloWorldC_dir, "bin", "hello_world$(exeext)")
9292
@test isfile(HelloWorldC_exe_path)
9393

94-
HelloWorldC_dir_explicit_artifact = eval(:(@artifact_str "HelloWorldC" nothing joinpath(@__DIR__, "Artifacts.toml")))
95-
@test isdir(HelloWorldC_dir_explicit_artifact)
96-
9794
# Simple slash-indexed lookup
9895
HelloWorldC_bin_path = artifact"HelloWorldC/bin"
9996
@test isdir(HelloWorldC_bin_path)

0 commit comments

Comments
 (0)