Artifacts

Julia 1.6以降、アーティファクトのサポートはPkg.jlからJulia本体に移行しました。ここに適切なドキュメントが追加されるまでは、アーティファクトについてPkg.jlマニュアルの'h': ASCII/Unicode U+0068 (category Ll: Letter, lowercase)'t': ASCII/Unicode U+0074 (category Ll: Letter, lowercase)'t': ASCII/Unicode U+0074 (category Ll: Letter, lowercase)'p': ASCII/Unicode U+0070 (category Ll: Letter, lowercase)'s': ASCII/Unicode U+0073 (category Ll: Letter, lowercase)':': ASCII/Unicode U+003A (category Po: Punctuation, other)'/': ASCII/Unicode U+002F (category Po: Punctuation, other)'/': ASCII/Unicode U+002F (category Po: Punctuation, other)'j': ASCII/Unicode U+006A (category Ll: Letter, lowercase)'u': ASCII/Unicode U+0075 (category Ll: Letter, lowercase)'l': ASCII/Unicode U+006C (category Ll: Letter, lowercase)'i': ASCII/Unicode U+0069 (category Ll: Letter, lowercase)'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)'l': ASCII/Unicode U+006C (category Ll: Letter, lowercase)'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)'n': ASCII/Unicode U+006E (category Ll: Letter, lowercase)'g': ASCII/Unicode U+0067 (category Ll: Letter, lowercase)'.': ASCII/Unicode U+002E (category Po: Punctuation, other)'g': ASCII/Unicode U+0067 (category Ll: Letter, lowercase)'i': ASCII/Unicode U+0069 (category Ll: Letter, lowercase)'t': ASCII/Unicode U+0074 (category Ll: Letter, lowercase)'h': ASCII/Unicode U+0068 (category Ll: Letter, lowercase)'u': ASCII/Unicode U+0075 (category Ll: Letter, lowercase)'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase)'.': ASCII/Unicode U+002E (category Po: Punctuation, other)'i': ASCII/Unicode U+0069 (category Ll: Letter, lowercase)'o': ASCII/Unicode U+006F (category Ll: Letter, lowercase)'/': ASCII/Unicode U+002F (category Po: Punctuation, other)'P': ASCII/Unicode U+0050 (category Lu: Letter, uppercase)'k': ASCII/Unicode U+006B (category Ll: Letter, lowercase)'g': ASCII/Unicode U+0067 (category Ll: Letter, lowercase)'.': ASCII/Unicode U+002E (category Po: Punctuation, other)'j': ASCII/Unicode U+006A (category Ll: Letter, lowercase)'l': ASCII/Unicode U+006C (category Ll: Letter, lowercase)'/': ASCII/Unicode U+002F (category Po: Punctuation, other)'v': ASCII/Unicode U+0076 (category Ll: Letter, lowercase)'1': ASCII/Unicode U+0031 (category Nd: Number, decimal digit)'/': ASCII/Unicode U+002F (category Po: Punctuation, other)'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)'r': ASCII/Unicode U+0072 (category Ll: Letter, lowercase)'t': ASCII/Unicode U+0074 (category Ll: Letter, lowercase)'i': ASCII/Unicode U+0069 (category Ll: Letter, lowercase)'f': ASCII/Unicode U+0066 (category Ll: Letter, lowercase)'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)'c': ASCII/Unicode U+0063 (category Ll: Letter, lowercase)'t': ASCII/Unicode U+0074 (category Ll: Letter, lowercase)'s': ASCII/Unicode U+0073 (category Ll: Letter, lowercase)'/': ASCII/Unicode U+002F (category Po: Punctuation, other)で詳しく確認できます。

Julia 1.6

JuliaのアーティファクトAPIを利用するには、Julia 1.6以降が必要です。Julia 1.3〜1.5では、代わりにPkg.Artifactsを使用できます。

Artifacts.artifact_meta — Function
artifact_meta(name::String, artifacts_toml::String;
              platform::AbstractPlatform = HostPlatform(),
              pkg_uuid::Union{Base.UUID,Nothing}=nothing)

指定された (Julia)Artifacts.toml ファイルに格納されている、名前で識別されるアーティファクトのメタデータを取得します。アーティファクトがプラットフォーム固有の場合は、最適なマッピングを選択するために platform を使用します。該当するものが見つからない場合は、nothing を返します。

Julia 1.3

この関数を使用するには、Julia 1.3 以降が必要です。

source
Artifacts.artifact_hash — Function
artifact_hash(name::String, artifacts_toml::String;
              platform::AbstractPlatform = HostPlatform())

指定されたプラットフォームに対応するアーティファクトのハッシュを返す、artifact_meta() の薄いラッパーです。対応するマッピングが見つからない場合は nothing を返します。

Julia 1.3

この関数を使用するには、Julia 1.3 以降が必要です。

source
Artifacts.find_artifacts_toml — Function
find_artifacts_toml(path::String)

.jl ファイルのパス(マクロのコンテキストで __source__.file が返すパスなど)が与えられた場合、そのファイルを含むプロジェクト内に存在すれば (Julia)Artifacts.toml を探して返し、存在しなければ nothing を返します。

Julia 1.3

この関数を使用するには、Julia 1.3 以降が必要です。

source
Artifacts.@artifact_str — Macro
macro artifact_str(name)

アーティファクトのディスク上のパスを返します。プロジェクトの(Julia)Artifacts.tomlファイルから、名前をもとにアーティファクトを自動的に検索します。指定したアーティファクトが見つからない場合はエラーをスローします。REPLで実行した場合は、カレントディレクトリからtomlファイルを検索します。詳しくはfind_artifacts_toml()を参照してください。

アーティファクトが「lazy」としてマークされており、パッケージでusing LazyArtifactsが定義されている場合、このマクロが初めてパスを計算しようとしたときに、Pkgを使ってアーティファクトがオンデマンドでダウンロードされます。ダウンロードされたファイルはローカルにインストールされ、その後も利用できます。

nameにスラッシュ(/または\)が含まれている場合、最初のスラッシュ以降の各要素は、アーティファクト内のパスを指定するものとして扱われます。これにより、アーティファクト内の単一のファイルやディレクトリに簡単なワンライナーでアクセスできます。例:

ffmpeg_path = @artifact"FFMPEG/bin/ffmpeg"
Julia 1.3

このマクロを使用するには、Julia 1.3以降が必要です。

Julia 1.6

スラッシュによるインデックス指定には、Julia 1.6以降が必要です。

source
Artifacts.artifact_exists — Function
artifact_exists(hash::SHA1; honor_overrides::Bool=true)

指定されたアーティファクト(sha1 の Git ツリーハッシュで識別)がディスク上に存在するかどうかを返します。指定されたアーティファクトが複数の場所(複数のデポ内など)に存在する場合もあります。

Julia 1.3

この関数を使用するには、Julia 1.3 以降が必要です。

source
Artifacts.artifact_path — Function
artifact_path(hash::SHA1; honor_overrides::Bool=true)

SHA1 Gitツリーハッシュで識別されるアーティファクトを指定すると、そのインストール先のパスを返します。アーティファクトが存在しない場合は、インストールされる予定の場所を返します。

Julia 1.3

この関数を使用するには、Julia 1.3 以降が必要です。

source
Artifacts.select_downloadable_artifacts — Function
select_downloadable_artifacts(artifacts_toml::String;
                              platform = HostPlatform,
                              include_lazy = false,
                              pkg_uuid = nothing)

指定されたプラットフォーム向けにダウンロードすべきアーティファクトをすべて含む辞書を返します。各エントリは、指定されたArtifacts.tomlのアーティファクトです。include_lazyが設定されている場合は、遅延アーティファクトも含まれます。

source