Skip to content

Instantly share code, notes, and snippets.

@Lin936
Created March 12, 2020 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lin936/dc3ba5ea6d36ea34e77f6e06d452a6f7 to your computer and use it in GitHub Desktop.
Save Lin936/dc3ba5ea6d36ea34e77f6e06d452a6f7 to your computer and use it in GitHub Desktop.
julia> using Pkg, Pkg.Artifacts, Pkg.BinaryPlatforms, Pkg.PlatformEngines
julia>
julia> # Initialize Pkg code
julia> probe_platform_engines!(; verbose=true)
[ Info: Probing for download engine...
[ Info: Probing powershell as a possibility...
[ Info: Probe successful for powershell
[ Info: Found download engine powershell
[ Info: Probing for compression engine...
[ Info: Probing C:\Users\user\Julia-1.3.1\bin\..\libexec\7z.exe as a possibility
...
[ Info: Probe successful for C:\Users\user\Julia-1.3.1\bin\..\libexec\7z.exe
[ Info: Found compression engine C:\Users\user\Julia-1.3.1\bin\..\libexec\7z.exe
true
julia>
julia> # Change these to whatever you need them to be, to debug your artifacts c
ode
julia> artifacts_toml_url = "https://raw.githubusercontent.com/JuliaBinaryWrappe
rs/OpenSpecFun_jll.jl/master/Artifacts.toml"
"https://raw.githubusercontent.com/JuliaBinaryWrappers/OpenSpecFun_jll.jl/master
/Artifacts.toml"
julia> artifact_name = "OpenSpecFun"
"OpenSpecFun"
julia>
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
julia> mktempdir() do tmp_dir
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
override this)
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
override this)
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
override this)
platform = platform_key_abi()
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
override this)
platform = platform_key_abi()
@info("Extracting artifact info for platform $(triplet(pl
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
override this)
platform = platform_key_abi()
@info("Extracting artifact info for platform $(triplet(pl
atform))...")
julia> mktempdir() do tmp_dir
# First, download Artifacts.toml file to temporary directory
artifacts_toml = joinpath(tmp_dir, "Artifacts.toml")
@info("Downloading Artifacts.toml to $(artifacts_toml)...")
Pkg.PlatformEngines.download(artifacts_toml_url, artifacts_toml;
verbose=true)
# Extract artifact metadata for the current platform (you can
override this)
platform = platform_key_abi()
@info("Extracting artifact info for platform $(triplet(pl
atform))...")
artifact_dict = Pkg.Artifacts.load_artifacts_toml(artif
acts_toml)
meta = artifact_meta(artifact_name, artifact_dict, ar
tifacts_toml; platform=platform)
treehash = meta["git-tree-sha1"]
tarball_url = first(meta["download"])["url"]
tarball_hash = first(meta["download"])["sha25
6"]
@info("Found meta object with git-tree-sha1
$(treehash), attempting download...")
destdir = joinpath(tmp_dir, "unpacked")
download_verify_unpack(tarball_url, tarball_hash, destdir; verbose=true
)
if !Sys.iswindows()
@info("Double-checking git-tree-sha (this is skipped on Windows)")
calc_treehash = bytes2hex(Pkg.GitTools.tree_hash(destdir))
if calc_treehash != treehash
@warn("Calculated treehash ($(calc_treehash)) != promised treehash
($(treehash))!")
end
end
ERROR: syntax: incomplete: "do" at REPL[7]:1 requires end
Stacktrace:
[1] top-level scope at REPL[6]:0
julia>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment