cryspen / hacl-packages

The Cryspen HACL Distribution
https://cryspen.com/hacl-packages
Other
13 stars 18 forks source link

[ocaml] Cannot restore extended attributes: com.apple.provenance com.apple.provenance #428

Closed mgstoyanov closed 8 months ago

mgstoyanov commented 9 months ago

I have this strange issue with the latest release package and bsdtar. There is a file in the archive:

-rw-r--r--  0 victor staff     163 Jun  1 08:29 ./tests/._dune

file tests/._dune
tests/._dune: AppleDouble encoded Macintosh file

which I don't think should be there and is giving me the following error message.

#=== ERROR while fetching sources for hacl-star.0.7.1 =========================#
OpamSolution.Fetch_fail("path       ~/tezos-65cc800
command     /usr/bin/tar xfz /tmp/opam-31270-6dca3d/hacl-star.0.7.1.tar.gz -C /tmp/opam-31270-4f2b7d
exit-code   1
env-file    ~/tezos-65cc800/_root/log/log-31270-13d62e.env
output-file ~/tezos-65cc800/_root/log/log-31270-13d62e.out
### output ###
./tests/dune: Cannot restore extended attributes: com.apple.provenance com.apple.provenance: No such file or directory# tar: Error exit delayed from previous errors.")

If I attempt to build hacl-star from an archive without that file, everything builds successfully. I suppose the archive was created on OSX and whoever is doing the next release should add the following options to their tar command:

--no-mac-metadata --no-xattr
franziskuskiefer commented 9 months ago

I don't see that file in the archive. Maybe it's created on your machine while building? @victor-dumitrescu can you have a look at this?

mgstoyanov commented 9 months ago

I suppose you're using tar on OSX?

mgs@nixos:/tmp/ > uname -a
Linux nixos 6.1.46 #1-NixOS SMP Wed Aug 16 16:27:31 UTC 2023 aarch64 GNU/Linux
mgs@nixos:/tmp/ > tar -tvzf hacl-star.0.7.1.tar.gz | grep _dune
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
-rw-r--r-- victor/staff    163 2023-06-01 08:29 ./tests/._dune
franziskuskiefer commented 9 months ago

I'm afraid tar -tvzf hacl-star.0.7.1.tar.gz | grep _dune doesn't find anything in there. Maybe you got your tarball somewhere else?

mgstoyanov commented 9 months ago

It is from the releases page in github. The file doesn't show if you do this on an Apple Mac because the version of tar there knows how to interpret the extended attribute

mgs@nixos:/tmp/ > curl -L https://github.com/cryspen/hacl-packages/releases/download/ocaml-v0.7.1/hacl-star.0.7.1.tar.gz -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  538k  100  538k    0     0   882k      0 --:--:-- --:--:-- --:--:--  882k
mgs@nixos:/tmp/ > shasum -a 256 hacl-star.0.7.1.tar.gz
40e0708d0e44b4febb864d14a185f2901cd997b30001ed3c24064c127ece88db  hacl-star.0.7.1.tar.gz
mgs@nixos:/tmp/ > md5sum hacl-star.0.7.1.tar.gz
192bca3819b9e21b39a0d38f02081d39  hacl-star.0.7.1.tar.gz
mgs@nixos:/tmp/ > tar -tvzf hacl-star.0.7.1.tar.gz | grep _dune
tar: -rw-r--r-- victor/staff    163 2023-06-01 08:29 ./tests/._dune
Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.provenance'
mgs@nixos:/tmp/ > tar --version
tar (GNU tar) 1.35
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
victor-dumitrescu commented 8 months ago

Hi, thanks for your report. tar -tvzf hacl-star.0.7.1.tar.gz | grep _dune comes back empty for me too, but digging a bit deeper it does seem that bsdtar on Mac can keep these files and metadata. From my understanding they are supposed to be removed upon archive extraction in most cases? Either way, I'll package the archive for the next release with --no-mac-metadata, thanks for the suggestion!

victor-dumitrescu commented 8 months ago

Closing, feel free to reopen if there is more to discuss