Artifacts!
What is an Artifact?
In Julia, an artifact is simply a fixed/immutable something that a package needs (that isn’t Julia code). Examples include executable binaries, text files, or other immutable data.
Rules for Artifacts:
- Must be immutable
- Must be a (optionally gzipped) tarfile (
.taror.tar.gz) - Must be publicly available on the internet
What’s the Point of Artifacts?
Problems with Alternatives
Storing binary data in git repos: Git handles text files, not binary files. Each binary change requires saving an entire new version.
Using deps/build.jl scripts: The previous Julia approach had several downsides:
- Duplicate downloads when multiple packages share artifacts
- Incompatibility with PackageCompiler.jl
- Difficulty managing platform-specific dependencies
- Manual artifact hosting requirements
Benefits of Artifact Support
- Prevents git repository bloat
- Maintains source code immutability
- Enables dependency sharing between packages
- Supports PackageCompiler compatibility
- Provides robust platform-specific installation
- Leverages Pkg server infrastructure
Using Artifacts as a Package User
Users need no involvement — Julia’s package manager automatically downloads required artifacts during installation.
Creating Artifacts as a Developer
The recommended approach uses the ArtifactUtils package.
Step 1: Create a Package
Step 3: Create Artifact Content
Step 4: Generate Artifact ID
Step 5: Upload Artifact
Note
Requires SSH key setup with GitHub.