# Artifacts help

**URL:** <https://discourse.julialang.org/t/artifacts-help/83249>\
**Category:** Package Management\
**Created:** [June 23, 2022, 2:55pm UTC](https://discourse.julialang.org/t/artifacts-help/83249 "2022-06-23T14:55:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDeepPhase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandeepphase/32/24076_2.png) [@DanDeepPhase](https://discourse.julialang.org/u/DanDeepPhase)\
**Post date:** [June 23, 2022, 2:55pm UTC](https://discourse.julialang.org/t/artifacts-help/83249/1 "2022-06-23T14:55:49Z")

</div>

I’m struggling with Artifacts. Any help would be appreciated.

1. I implemented Pkg.Artifacts, but got a deprecation warning saying the stdlib Artifacts is preferred. I had followed [Julia Artifacts for Dummies. A clever system to make images… | by Erik Engheim | Level Up Coding](https://levelup.gitconnected.com/julia-artifacts-for-dummies-f2eef4fc193a) , which also used Pkg.Artifacts. Given that there is no help file for stdlib.Artifacts, is there any resource/ walkthrough, or just need to read the code?

2. is there a feature parity? I can’t find for instance archive\_artifact(). also, there seem to be more recent commits to Pkg.Artifacts. Is preference swinging back in that direction?

3. I’d be fine with using Pkg.Artifacts while stdlib gets developed, but i’m stuck on some SHA issue, where create\_artifact generates a SHA, but then archive\_artifact seems to change the SHA (which i didn’t find out until someone else tried to use the artifact… It’s working fine on my computer with the a1b hash)

```julia
┌ Error: Tree Hash Mismatch!
│ Expected git-tree-sha1: a1b99b3136ce849ae
│ Calculated git-tree-sha1: 68a1945011b7f819739

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 24, 2022, 12:52am UTC](https://discourse.julialang.org/t/artifacts-help/83249/2 "2022-06-24T00:52:03Z")

</div>

It isn’t clear what you’re asking (didn’t even explain what you’re trying to accomplish), but if you want to create an artifact my suggestion is to use

> **[GitHub - JuliaPackaging/ArtifactUtils.jl: A tool for package developers for...](https://github.com/JuliaPackaging/ArtifactUtils.jl)**
>
> A tool for package developers for working with artifacts. - GitHub - JuliaPackaging/ArtifactUtils.jl: A tool for package developers for working with artifacts.

---

<div class="post-metadata">

**Author:** ![DanDeepPhase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandeepphase/32/24076_2.png) [@DanDeepPhase](https://discourse.julialang.org/u/DanDeepPhase)\
**Post date:** [June 24, 2022, 12:59pm UTC](https://discourse.julialang.org/t/artifacts-help/83249/3 "2022-06-24T12:59:53Z")

</div>

Thanks for the reply and the link. I’ve read through that package over the last few days. It doesn’t quite solve my problem, but I’ll try to rephrase and simplfy:

1. should I be using “Artifacts” or “Pkg.Artifacts” for my artifacting needs? The Pkg version seems better fleshed out, but i get a deprecation warning:

```julia
┌ Warning: using Pkg instead of using LazyArtifacts is deprecated

```

and also the [Artifacts · The Julia Language](https://docs.julialang.org/en/v1/stdlib/Artifacts/) says " Starting with Julia 1.6, the artifacts support has moved from `Pkg.jl` to Julia itself." However, I just don’t see the features in the stdlib version.

1. I’ve better isolated my issue with Artifact creation. I saw the git copy issue in the artifactutils, but i think its unrelated. in the cycle of creating and opening the tar file, the git-tree-sha changes. It seems that when I create a tar.gz file with archive\_artifact then it adds a containing folder before zipping and compressing. That’s my leading suspicion, but haven’t figured out how to stop it. Since artifactutils is doing the same thing, i’ll see if i can find some guidance there. However, for my use, i don’t want to store files on gist, so i need my own functions.

What i want to do is I think a fairly straightforward artifact usage:

1. create artifacts from files - done
2. create tar files - seems like its working, but maybe not
3. host tar files (on a personal server) - done
4. add info to Artifacts.toml - done
5. get tar files and convert to artifacts - failing on mismatched Git tree SHA
6. open them / read data - works on the artifacts i create, but not through the tar file

Thanks

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 24, 2022, 2:00pm UTC](https://discourse.julialang.org/t/artifacts-help/83249/4 "2022-06-24T14:00:43Z")

</div>

Maybe this post

> **[Artifacts!](https://www.juliafordatascience.com/artifacts/)**
>
> In this article we'll cover what artifacts are and how to use them, both as a
> package user and a package developer.
> 
> What is an Artifact?
> In Julia, an artifact is simply a fixed/immutable something that a package needs
> (that isn't Julia code)....

just published by @joshday can help?

---

<div class="post-metadata">

**Author:** ![DanDeepPhase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandeepphase/32/24076_2.png) [@DanDeepPhase](https://discourse.julialang.org/u/DanDeepPhase)\
**Post date:** [June 24, 2022, 3:11pm UTC](https://discourse.julialang.org/t/artifacts-help/83249/5 "2022-06-24T15:11:02Z")

</div>

Thanks for finding that… very timely!

It’s a pretty straightforward walkthrough of artifactutils. I’ll take it as a vote to continue using Pkg and ignore the deprecation warning. I don’t see much different in the implementations, but I’ll keep hacking at it.

---

<div class="post-metadata">

**Author:** ![DanDeepPhase](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dandeepphase/32/24076_2.png) [@DanDeepPhase](https://discourse.julialang.org/u/DanDeepPhase)\
**Post date:** [June 24, 2022, 6:09pm UTC](https://discourse.julialang.org/t/artifacts-help/83249/6 "2022-06-24T18:09:42Z")

</div>

I think the culprit is file permissions of the originals. permissions for me are stable. The only difference is that the new files now have an “Everyone” user with read permissions.

Using ArtifactUtils.artifact\_from\_directory() i generate one hash. Then by archive\_artifact() and Pkg.PlatformEngines.unpack() i get a different hash. When i run artifact\_from\_directory on the new folder I get the second hash… so at that point the permissions are stable.

This permissioning happens with both ArtifactUtils and straight Pkg.Artifacts usage
