Artifacts help

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 , 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)

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

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

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:
┌ Warning: using Pkg instead of using LazyArtifacts is deprecated

and also the Artifacts · The Julia Language 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

Maybe this post

just published by @joshday can help?

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.

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