Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifact hash mismatch with P4est_jll on Julia v1.10 #3643

Closed
stillyslalom opened this issue Oct 4, 2023 · 100 comments
Closed

Artifact hash mismatch with P4est_jll on Julia v1.10 #3643

stillyslalom opened this issue Oct 4, 2023 · 100 comments

Comments

@stillyslalom
Copy link
Contributor

I'm encountering an error when trying to install P4est_jll in Julia v1.10-beta2 (installed via juliaup) on two different Windows 10 machines - the issue is not encountered on v1.9.3:

(jl_tdZRQD) pkg> add P4est_jll
   Resolving package versions...
  Downloaded artifact: P4est
  Downloaded artifact: P4est
ERROR: Unable to automatically download/install artifact 'P4est' from sources listed in 'C:\Users\Alex\.julia\packages\P4est_jll\kfjxs\Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/89a337ea6f60a4fd58999ab73dea099e41032138
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   89a337ea6f60a4fd58999ab73dea099e41032138
  Calculated git-tree-sha1: ed75b82e0dd9b53c4ac4e70376f3e6f330c72767
- https://github.com/JuliaBinaryWrappers/P4est_jll.jl/releases/download/P4est-v2.8.1+2/P4est.v2.8.1.x86_64-w64-mingw32-mpi+microsoftmpi.tar.gz
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   89a337ea6f60a4fd58999ab73dea099e41032138
  Calculated git-tree-sha1: ed75b82e0dd9b53c4ac4e70376f3e6f330c72767

Troubleshooting on Slack with @sloede and @fredrikekre:

julia> using Tar, CodecZlib, Downloads, SHA

julia> artifact = Downloads.download("https://pkg.julialang.org/artifact/89a337ea6f60a4fd58999ab73dea099e41032138")
"C:\\Users\\Alex\\AppData\\Local\\Temp\\jl_glqlGnAL6b"

julia> shasum = bytes2hex(open(SHA.sha256, artifact))
"1abe2cd4e2c31d34c840d3042f94d6b34d85762c6be0fbd480eaf52136b566e1"

julia> open(GzipDecompressorStream, artifact) do io
           tree_hash = Tar.tree_hash(io)
       end
"89a337ea6f60a4fd58999ab73dea099e41032138"

julia> open(GzipDecompressorStream, artifact) do io
           mktempdir() do tmp
               Tar.extract(io, tmp)
               tree_hash = bytes2hex(Pkg.GitTools.tree_hash(tmp))
           end
       end
"ed75b82e0dd9b53c4ac4e70376f3e6f330c72767"
julia> versioninfo()
Julia Version 1.10.0-beta2
Commit a468aa198d (2023-08-17 06:27 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 24 × 12th Gen Intel(R) Core(TM) i9-12900K
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
  Threads: 1 on 24 virtual cores
@StefanKarpinski
Copy link
Sponsor Member

StefanKarpinski commented Oct 5, 2023

I want to ask you to do this:

open(GzipDecompressorStream, artifact) do io
    mktempdir() do tmp
        Tar.extract(io, tmp)
        run(`ls -Rl $tmp`)
    end
end

However, I don't know if you have GNU ls available to run. I've asked ChatGPT what the equivalent on Windows is and it's told me that it's this in PowerShell:

Get-ChildItem -Recurse | ForEach-Object { 
    $acl = Get-Acl $_.FullName 
    [PSCustomObject]@{
        Path = $_.FullName
        Access = $acl.AccessToString
    }
} | Format-List

which, is cool, but man that's a lot of text to replicate ls -lR. If you have a better way to see the names and permissions of files in the directory, that's what I'd like to see. Maybe something with walkdir...

@stillyslalom
Copy link
Contributor Author

Blessedly, I have ls available.

julia> open(GzipDecompressorStream, artifact) do io
           mktempdir() do tmp
               Tar.extract(io, tmp)
               run(`ls -Rl $tmp`)
           end
       end
'C:\Users\355547\AppData\Local\Temp\jl_UxWajc':
total 48
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 bin
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 etc
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 include
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 lib
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 share

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/bin':
total 20580
-rwxr-xr-x 1 355547 1049089 5000947 Oct  5 10:45 libp4est-0.dll
-rwxr-xr-x 1 355547 1049089 1484704 Oct  5 10:45 libsc-0.dll
-rwxr-xr-x 1 355547 1049089  348593 Oct  5 10:45 p4est_balance_seeds.exe
-rwxr-xr-x 1 355547 1049089  349393 Oct  5 10:45 p4est_bricks.exe
-rwxr-xr-x 1 355547 1049089  348695 Oct  5 10:45 p4est_loadconn.exe
-rwxr-xr-x 1 355547 1049089  367400 Oct  5 10:45 p4est_mesh.exe
-rwxr-xr-x 1 355547 1049089  525780 Oct  5 10:45 p4est_particles.exe
-rwxr-xr-x 1 355547 1049089  354389 Oct  5 10:45 p4est_points.exe
-rwxr-xr-x 1 355547 1049089  342534 Oct  5 10:45 p4est_read_conn.exe
-rwxr-xr-x 1 355547 1049089  363179 Oct  5 10:45 p4est_simple.exe
-rwxr-xr-x 1 355547 1049089  425164 Oct  5 10:45 p4est_spheres.exe
-rwxr-xr-x 1 355547 1049089  352976 Oct  5 10:45 p4est_step1.exe
-rwxr-xr-x 1 355547 1049089  344928 Oct  5 10:45 p4est_step2.exe
-rwxr-xr-x 1 355547 1049089  398509 Oct  5 10:45 p4est_step3.exe
-rwxr-xr-x 1 355547 1049089  410119 Oct  5 10:45 p4est_step4.exe
-rwxr-xr-x 1 355547 1049089  377076 Oct  5 10:45 p4est_timings.exe
-rwxr-xr-x 1 355547 1049089  346793 Oct  5 10:45 p4est_write_conn.exe
-rwxr-xr-x 1 355547 1049089  349613 Oct  5 10:45 p8est_balance_seeds.exe
-rwxr-xr-x 1 355547 1049089  350417 Oct  5 10:45 p8est_bricks.exe
-rwxr-xr-x 1 355547 1049089  349719 Oct  5 10:45 p8est_loadconn.exe
-rwxr-xr-x 1 355547 1049089  367924 Oct  5 10:45 p8est_mesh.exe
-rwxr-xr-x 1 355547 1049089  526289 Oct  5 10:45 p8est_particles.exe
-rwxr-xr-x 1 355547 1049089  338854 Oct  5 10:45 p8est_periodicity.exe
-rwxr-xr-x 1 355547 1049089  355421 Oct  5 10:45 p8est_points.exe
-rwxr-xr-x 1 355547 1049089  343558 Oct  5 10:45 p8est_read_conn.exe
-rwxr-xr-x 1 355547 1049089  348076 Oct  5 10:45 p8est_read_tetgen.exe
-rwxr-xr-x 1 355547 1049089  358196 Oct  5 10:45 p8est_simple.exe
-rwxr-xr-x 1 355547 1049089  431071 Oct  5 10:45 p8est_spheres.exe
-rwxr-xr-x 1 355547 1049089  353484 Oct  5 10:45 p8est_step1.exe
-rwxr-xr-x 1 355547 1049089  345440 Oct  5 10:45 p8est_step2.exe
-rwxr-xr-x 1 355547 1049089  397485 Oct  5 10:45 p8est_step3.exe
-rwxr-xr-x 1 355547 1049089  411915 Oct  5 10:45 p8est_step4.exe
-rwxr-xr-x 1 355547 1049089  378810 Oct  5 10:45 p8est_timings.exe
-rwxr-xr-x 1 355547 1049089  439973 Oct  5 10:45 p8est_tsearch.exe
-rwxr-xr-x 1 355547 1049089  347305 Oct  5 10:45 p8est_write_conn.exe
-rwxr-xr-x 1 355547 1049089  333415 Oct  5 10:45 sc_b64dec.exe
-rwxr-xr-x 1 355547 1049089  334105 Oct  5 10:45 sc_b64enc.exe
-rwxr-xr-x 1 355547 1049089  345619 Oct  5 10:45 sc_function.exe
-rwxr-xr-x 1 355547 1049089  339716 Oct  5 10:45 sc_logging.exe
-rwxr-xr-x 1 355547 1049089  347320 Oct  5 10:45 sc_options.exe
-rwxr-xr-x 1 355547 1049089  356141 Oct  5 10:45 sc_test_shmem.exe

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/etc':
total 8
-rw-r--r-- 1 355547 1049089 845 Oct  5 10:45 Makefile.p4est.mk
-rw-r--r-- 1 355547 1049089 689 Oct  5 10:45 Makefile.sc.mk

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/include':
total 1280
-rw-r--r-- 1 355547 1049089 23307 Oct  5 10:45 p4est.h
-rw-r--r-- 1 355547 1049089 16731 Oct  5 10:45 p4est_algorithms.h
-rw-r--r-- 1 355547 1049089  2966 Oct  5 10:45 p4est_balance.h
-rw-r--r-- 1 355547 1049089 20031 Oct  5 10:45 p4est_base.h
-rw-r--r-- 1 355547 1049089 34567 Oct  5 10:45 p4est_bits.h
-rw-r--r-- 1 355547 1049089  4641 Oct  5 10:45 p4est_build.h
-rw-r--r-- 1 355547 1049089 30523 Oct  5 10:45 p4est_communication.h
-rw-r--r-- 1 355547 1049089  8860 Oct  5 10:45 p4est_config.h
-rw-r--r-- 1 355547 1049089 38830 Oct  5 10:45 p4est_connectivity.h
-rw-r--r-- 1 355547 1049089  2499 Oct  5 10:45 p4est_empty.h
-rw-r--r-- 1 355547 1049089 34898 Oct  5 10:45 p4est_extended.h
-rw-r--r-- 1 355547 1049089  4509 Oct  5 10:45 p4est_geometry.h
-rw-r--r-- 1 355547 1049089 19546 Oct  5 10:45 p4est_ghost.h
-rw-r--r-- 1 355547 1049089  3508 Oct  5 10:45 p4est_io.h
-rw-r--r-- 1 355547 1049089 12167 Oct  5 10:45 p4est_iterate.h
-rw-r--r-- 1 355547 1049089 15629 Oct  5 10:45 p4est_lnodes.h
-rw-r--r-- 1 355547 1049089 16553 Oct  5 10:45 p4est_mesh.h
-rw-r--r-- 1 355547 1049089  5737 Oct  5 10:45 p4est_nodes.h
-rw-r--r-- 1 355547 1049089  4177 Oct  5 10:45 p4est_plex.h
-rw-r--r-- 1 355547 1049089  3561 Oct  5 10:45 p4est_points.h
-rw-r--r-- 1 355547 1049089 26698 Oct  5 10:45 p4est_search.h
-rw-r--r-- 1 355547 1049089  3174 Oct  5 10:45 p4est_spheres.h
-rw-r--r-- 1 355547 1049089 29012 Oct  5 10:45 p4est_to_p8est.h
-rw-r--r-- 1 355547 1049089  1291 Oct  5 10:45 p4est_to_p8est_empty.h
-rw-r--r-- 1 355547 1049089  1621 Oct  5 10:45 p4est_to_p8est_spheres.h
-rw-r--r-- 1 355547 1049089 17264 Oct  5 10:45 p4est_vtk.h
-rw-r--r-- 1 355547 1049089 18227 Oct  5 10:45 p4est_wrap.h
-rw-r--r-- 1 355547 1049089 29274 Oct  5 10:45 p6est.h
-rw-r--r-- 1 355547 1049089  4407 Oct  5 10:45 p6est_communication.h
-rw-r--r-- 1 355547 1049089  1297 Oct  5 10:45 p6est_empty.h
-rw-r--r-- 1 355547 1049089 15984 Oct  5 10:45 p6est_extended.h
-rw-r--r-- 1 355547 1049089  9520 Oct  5 10:45 p6est_ghost.h
-rw-r--r-- 1 355547 1049089 10719 Oct  5 10:45 p6est_lnodes.h
-rw-r--r-- 1 355547 1049089  4175 Oct  5 10:45 p6est_profile.h
-rw-r--r-- 1 355547 1049089  7595 Oct  5 10:45 p6est_vtk.h
-rw-r--r-- 1 355547 1049089 23489 Oct  5 10:45 p8est.h
-rw-r--r-- 1 355547 1049089 16778 Oct  5 10:45 p8est_algorithms.h
-rw-r--r-- 1 355547 1049089  3394 Oct  5 10:45 p8est_balance.h
-rw-r--r-- 1 355547 1049089 40686 Oct  5 10:45 p8est_bits.h
-rw-r--r-- 1 355547 1049089  4641 Oct  5 10:45 p8est_build.h
-rw-r--r-- 1 355547 1049089 29749 Oct  5 10:45 p8est_communication.h
-rw-r--r-- 1 355547 1049089 47887 Oct  5 10:45 p8est_connectivity.h
-rw-r--r-- 1 355547 1049089  1297 Oct  5 10:45 p8est_empty.h
-rw-r--r-- 1 355547 1049089 35147 Oct  5 10:45 p8est_extended.h
-rw-r--r-- 1 355547 1049089  5571 Oct  5 10:45 p8est_geometry.h
-rw-r--r-- 1 355547 1049089 19619 Oct  5 10:45 p8est_ghost.h
-rw-r--r-- 1 355547 1049089  3512 Oct  5 10:45 p8est_io.h
-rw-r--r-- 1 355547 1049089 16860 Oct  5 10:45 p8est_iterate.h
-rw-r--r-- 1 355547 1049089 18891 Oct  5 10:45 p8est_lnodes.h
-rw-r--r-- 1 355547 1049089 19357 Oct  5 10:45 p8est_mesh.h
-rw-r--r-- 1 355547 1049089  6731 Oct  5 10:45 p8est_nodes.h
-rw-r--r-- 1 355547 1049089  4177 Oct  5 10:45 p8est_plex.h
-rw-r--r-- 1 355547 1049089  3561 Oct  5 10:45 p8est_points.h
-rw-r--r-- 1 355547 1049089 26743 Oct  5 10:45 p8est_search.h
-rw-r--r-- 1 355547 1049089  3185 Oct  5 10:45 p8est_spheres.h
-rw-r--r-- 1 355547 1049089  3769 Oct  5 10:45 p8est_tets_hexes.h
-rw-r--r-- 1 355547 1049089 17263 Oct  5 10:45 p8est_vtk.h
-rw-r--r-- 1 355547 1049089 17253 Oct  5 10:45 p8est_wrap.h
-rw-r--r-- 1 355547 1049089 32738 Oct  5 10:45 sc.h
-rw-r--r-- 1 355547 1049089  8122 Oct  5 10:45 sc3_mpi_types.h
-rw-r--r-- 1 355547 1049089  2114 Oct  5 10:45 sc_allgather.h
-rw-r--r-- 1 355547 1049089  6175 Oct  5 10:45 sc_amr.h
-rw-r--r-- 1 355547 1049089  7362 Oct  5 10:45 sc_avl.h
drwxr-xr-x 1 355547 1049089     0 Oct  5 10:45 sc_builtin
-rw-r--r-- 1 355547 1049089 11071 Oct  5 10:45 sc_config.h
-rw-r--r-- 1 355547 1049089 48282 Oct  5 10:45 sc_containers.h
-rw-r--r-- 1 355547 1049089  5085 Oct  5 10:45 sc_flops.h
-rw-r--r-- 1 355547 1049089  4504 Oct  5 10:45 sc_functions.h
-rw-r--r-- 1 355547 1049089  1215 Oct  5 10:45 sc_getopt.h
-rw-r--r-- 1 355547 1049089 13983 Oct  5 10:45 sc_io.h
-rw-r--r-- 1 355547 1049089 10382 Oct  5 10:45 sc_keyvalue.h
-rw-r--r-- 1 355547 1049089 19929 Oct  5 10:45 sc_mpi.h
-rw-r--r-- 1 355547 1049089 17838 Oct  5 10:45 sc_notify.h
-rw-r--r-- 1 355547 1049089 18418 Oct  5 10:45 sc_options.h
-rw-r--r-- 1 355547 1049089  8133 Oct  5 10:45 sc_polynom.h
-rw-r--r-- 1 355547 1049089  1787 Oct  5 10:45 sc_private.h
-rw-r--r-- 1 355547 1049089  2917 Oct  5 10:45 sc_random.h
-rw-r--r-- 1 355547 1049089  5727 Oct  5 10:45 sc_ranges.h
-rw-r--r-- 1 355547 1049089  2685 Oct  5 10:45 sc_reduce.h
-rw-r--r-- 1 355547 1049089  5021 Oct  5 10:45 sc_refcount.h
-rw-r--r-- 1 355547 1049089  3262 Oct  5 10:45 sc_search.h
-rw-r--r-- 1 355547 1049089  6341 Oct  5 10:45 sc_shmem.h
-rw-r--r-- 1 355547 1049089  2436 Oct  5 10:45 sc_sort.h
-rw-r--r-- 1 355547 1049089 13504 Oct  5 10:45 sc_statistics.h
-rw-r--r-- 1 355547 1049089  4834 Oct  5 10:45 sc_string.h
-rw-r--r-- 1 355547 1049089 10903 Oct  5 10:45 sc_uint128.h
-rw-r--r-- 1 355547 1049089  3193 Oct  5 10:45 sc_unique_counter.h
-rw-r--r-- 1 355547 1049089  4979 Oct  5 10:45 sc_v4l2.h

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/include/sc_builtin':
total 16
-rw-r--r-- 1 355547 1049089 6125 Oct  5 10:45 getopt.h
-rw-r--r-- 1 355547 1049089 4766 Oct  5 10:45 getopt_int.h

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/lib':
total 800
-rw-r--r-- 1 355547 1049089 532658 Oct  5 10:45 libp4est.dll.a
-rw-r--r-- 1 355547 1049089 279814 Oct  5 10:45 libsc.dll.a
drwxr-xr-x 1 355547 1049089      0 Oct  5 10:45 pkgconfig

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/lib/pkgconfig':
total 2
-rw-r--r-- 1 355547 1049089 414 Oct  5 10:45 libsc-2.8.3.pc
-rw-r--r-- 1 355547 1049089 447 Oct  5 10:45 p4est-2.8.pc

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/share':
total 12
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 aclocal
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 data
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 ini
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 licenses

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/share/aclocal':
total 96
-rw-r--r-- 1 355547 1049089  8195 Oct  5 10:45 ax_prefix_config_h.m4
-rw-r--r-- 1 355547 1049089  1671 Oct  5 10:45 ax_split_version.m4
-rw-r--r-- 1 355547 1049089  2752 Oct  5 10:45 p4est_include.m4
-rw-r--r-- 1 355547 1049089  1406 Oct  5 10:45 p4est_metis.m4
-rw-r--r-- 1 355547 1049089  5561 Oct  5 10:45 p4est_petsc.m4
-rw-r--r-- 1 355547 1049089  1413 Oct  5 10:45 sc_builtin.m4
-rw-r--r-- 1 355547 1049089 11537 Oct  5 10:45 sc_include.m4
-rw-r--r-- 1 355547 1049089  3340 Oct  5 10:45 sc_memalign.m4
-rw-r--r-- 1 355547 1049089 16651 Oct  5 10:45 sc_mpi.m4
-rw-r--r-- 1 355547 1049089  1890 Oct  5 10:45 sc_openmp.m4
-rw-r--r-- 1 355547 1049089  5318 Oct  5 10:45 sc_package.m4
-rw-r--r-- 1 355547 1049089  1735 Oct  5 10:45 sc_pthread.m4
-rw-r--r-- 1 355547 1049089  2275 Oct  5 10:45 sc_qsort.m4
-rw-r--r-- 1 355547 1049089  1946 Oct  5 10:45 sc_v4l2.m4

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/share/data':
total 394
-rw-r--r-- 1 355547 1049089  12762 Oct  5 10:45 hole_2d_cubit.inp
-rwxr-xr-x 1 355547 1049089    333 Oct  5 10:45 hole_2d_cubit.jou
-rw-r--r-- 1 355547 1049089    541 Oct  5 10:45 hole_2d_gmsh.geo
-rw-r--r-- 1 355547 1049089   8143 Oct  5 10:45 hole_2d_gmsh.inp
-rw-r--r-- 1 355547 1049089 179294 Oct  5 10:45 hole_3d_cubit.inp
-rwxr-xr-x 1 355547 1049089    335 Oct  5 10:45 hole_3d_cubit.jou
-rw-r--r-- 1 355547 1049089    626 Oct  5 10:45 hole_3d_gmsh.geo
-rw-r--r-- 1 355547 1049089 127609 Oct  5 10:45 hole_3d_gmsh.inp
-rw-r--r-- 1 355547 1049089  42424 Oct  5 10:45 p8est_box_tetgen.ele
-rw-r--r-- 1 355547 1049089   8560 Oct  5 10:45 p8est_box_tetgen.node

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/share/ini':
total 6
-rw-r--r-- 1 355547 1049089 1235 Oct  5 10:45 sc_iniparser_twisted.ini
-rw-r--r-- 1 355547 1049089  239 Oct  5 10:45 sc_options_example.ini
-rw-r--r-- 1 355547 1049089   80 Oct  5 10:45 sc_options_preload.ini

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/share/licenses':
total 0
drwxr-xr-x 1 355547 1049089 0 Oct  5 10:45 P4est

'C:\Users\355547\AppData\Local\Temp\jl_UxWajc/share/licenses/P4est':
total 20
-rw-r--r-- 1 355547 1049089 18092 Oct  5 10:45 COPYING
Process(`ls -Rl 'C:\Users\355547\AppData\Local\Temp\jl_UxWajc'`, ProcessExited(0))

@stillyslalom
Copy link
Contributor Author

The same error was reportedly encountered by @jmark on the Trixi.jl Slack.

@sloede
Copy link

sloede commented Oct 25, 2023

I'm getting similar tree hash mismatch errors when running PackageCompiler.jl CI tests on Windows, e.g. here

@revolutionflourlake772
Copy link

As @giordano linked above, I'm encountering a similar error trying to use 1.10 for the first time today. In addition to the adwaita_icon_theme_jll error, I'm also getting one on iso_codes_jll upon re-trying to instantiate an hour later:

(JL1XVENV) pkg> up
    Updating registry at `C:\1\.julia\registries\General.toml`
  Downloaded artifact: iso_codes
  Downloaded artifact: iso_codes
ERROR: Unable to automatically download/install artifact 'iso_codes' from sources listed in 'C:\1\.julia\packages\iso_codes_jll\wcUPz\Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/71f68a3d55d73f2e15a3969c241fae2349b1feb5
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   71f68a3d55d73f2e15a3969c241fae2349b1feb5
  Calculated git-tree-sha1: 409d6ac4c02dae43ff4fe576b5c5820d0386fb3f
- https://github.com/JuliaBinaryWrappers/iso_codes_jll.jl/releases/download/iso_codes-v4.11.0+0/iso_codes.v4.11.0.any.tar.gz
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   71f68a3d55d73f2e15a3969c241fae2349b1feb5
  Calculated git-tree-sha1: 409d6ac4c02dae43ff4fe576b5c5820d0386fb3f

@lmiq
Copy link

lmiq commented Jan 3, 2024

I would also like to add that this is preventing the installation of the NativeFileDialog.jl and Gtk.jl packages in Julia 1.10. It is preventing the installation of a package of mine (Packmol.jl), which uses that such to help newbie users. Path to reproduce:

  1. Remove the .julia/artifacts folder
  2. Install (on Julia 1.10) the `NativeFileDialog" package.

Currently the workaround I'm suggesting to users is to use Julia 1.9.

@lmiq
Copy link

lmiq commented Jan 3, 2024

I'd also note that iso_codes_jll is an artifact with ~1.6k monthly downloads, so this issue might be causing problems for a lot of 1.10 users on Windows. If I can provide any info that helps solving the issue, please let me know.

@IanButterworth
Copy link
Sponsor Member

As a workaround in the interim you should be able to set env var JULIA_PKG_IGNORE_HASHES=1 but I'd use it sparingly.

@lmiq
Copy link

lmiq commented Jan 3, 2024

Yes, I know. But for the kind of user I'm suggesting the pop-up of a file dialog that's unfortunately not an option.

@nhz2
Copy link
Contributor

nhz2 commented Jan 3, 2024

I was able to work around this issue by turning on "Developer Mode" in the "For developers" settings on Windows 11. The issue with iso_codes_jll is that it contains symlinks. On Windows from what I can tell creating symlinks requires "Developer Mode" to be on.

@giordano
Copy link
Contributor

giordano commented Jan 3, 2024

But why is that not a problem until Julia v1.9?

@IanButterworth
Copy link
Sponsor Member

Seems we need to bisect this?

@nhz2
Copy link
Contributor

nhz2 commented Jan 3, 2024

The main change affecting this from v1.9 is #3349

@IanButterworth
Copy link
Sponsor Member

As in you've tested 1.10.0 with and without that commit?
fyi @staticfloat

@nhz2
Copy link
Contributor

nhz2 commented Jan 3, 2024

No, I haven't tested 1.10.0 without that commit.

@lmiq
Copy link

lmiq commented Jan 3, 2024

I've tested with 1.10.0-alpha1 and the error is there (and not on 1.9.4).

@IanButterworth
Copy link
Sponsor Member

A helpful thing to do would be to open a PR that adds a failing test for this

@IanButterworth
Copy link
Sponsor Member

Has anyone tried a reproducer with JULIA_DEBUG=Pkg on? There's a debug log in the artifact install step that might shed some light.

@nhz2
Copy link
Contributor

nhz2 commented Jan 5, 2024

I'm able to reproduce the bad hash for iso_codes on Linux using ENV["BINARYPROVIDER_COPYDEREF"]="true":

julia> ENV["BINARYPROVIDER_COPYDEREF"]="true"
"true"

julia> using Pkg

julia> Pkg.add("iso_codes_jll")
   Resolving package versions...
  Downloaded artifact: iso_codes
  Downloaded artifact: iso_codes
ERROR: Unable to automatically download/install artifact 'iso_codes' from sources listed in '/home/nathan/.julia/packages/iso_codes_jll/wcUPz/Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/71f68a3d55d73f2e15a3969c241fae2349b1feb5
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   71f68a3d55d73f2e15a3969c241fae2349b1feb5
  Calculated git-tree-sha1: 409d6ac4c02dae43ff4fe576b5c5820d0386fb3f
- https://github.com/JuliaBinaryWrappers/iso_codes_jll.jl/releases/download/iso_codes-v4.11.0+0/iso_codes.v4.11.0.any.tar.gz
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   71f68a3d55d73f2e15a3969c241fae2349b1feb5
  Calculated git-tree-sha1: 409d6ac4c02dae43ff4fe576b5c5820d0386fb3f

@mkitti
Copy link
Contributor

mkitti commented Jan 5, 2024

Reverting 0fb323e seems to have resolved the problem.

~/src/Pkg.jl $ ../../julia/usr/bin/julia
(@v1.11) pkg> activate --temp
  Activating new project at `D:\msys64\tmp\jl_riX32k`

(jl_riX32k) pkg> add P4est_jll
   Resolving package versions...
ERROR: Unable to automatically download/install artifact 'P4est' from sources listed in 'C:\Users\kittisopikulm\.julia
\packages\P4est_jll\kfjxs\Artifacts.toml'.
Sources attempted:
- https://pkg.julialang.org/artifact/89a337ea6f60a4fd58999ab73dea099e41032138
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   89a337ea6f60a4fd58999ab73dea099e41032138
  Calculated git-tree-sha1: ed75b82e0dd9b53c4ac4e70376f3e6f330c72767
- https://github.com/JuliaBinaryWrappers/P4est_jll.jl/releases/download/P4est-v2.8.1+2/P4est.v2.8.1.x86_64-w64-mingw32
-mpi+microsoftmpi.tar.gz
    Error: Tree Hash Mismatch!
  Expected git-tree-sha1:   89a337ea6f60a4fd58999ab73dea099e41032138
  Calculated git-tree-sha1: ed75b82e0dd9b53c4ac4e70376f3e6f330c72767

~/src/Pkg.jl $ git revert 0fb323e57b4569e105a1bb47bf1975d3c60b4197

~/src/Pkg.jl $ ../../julia/usr/bin/julia --project=.
(Pkg) pkg> activate --temp
  Activating new project at `D:\msys64\tmp\jl_lIrCJs`

(jl_lIrCJs) pkg> add P4est_jll
   Resolving package versions...
    Updating `D:\msys64\tmp\jl_lIrCJs\Project.toml`
  [6b5a15aa] + P4est_jll v2.8.1+2

@IanButterworth

This comment was marked as resolved.

@IanButterworth
Copy link
Sponsor Member

So before 0fb323e which landed in 1.10.0 we didn't check the treehash of artifacts on Windows.

I think there are two ways forward:

  1. Revert 0fb323e and go back to not checking treehashes of artifacts on Windows
  2. Go with guiding the user to fix the symlink issue check symlinks work on windows on artifact hash mismatch #3745 which mentions JULIA_PKG_IGNORE_HASHES if symlinks aren't working, in case the user cannot turn developer mode on.

@staticfloat

@StefanKarpinski
Copy link
Sponsor Member

Yeah, I'll change it so the error messages are different.

StefanKarpinski added a commit that referenced this issue Jan 18, 2024
@ArseniyKholod
Copy link

ArseniyKholod commented Jan 20, 2024

Part 1 has dropped: #3764.

Great, thanks a lot! Ideally, anyone testing this should probably first verify that installing P4est_jll as-is actually does fail on their system...

I'm not sure, that I understood correctly, but adding the P4est_jll doesn't fail by me using Julia 1.10.0. The only difference with original issue I see, that I'm using Julia 1.10 and not beta version, and I use Windows 11, not 10th.

(@v1.10) pkg> add P4est_jll
    Updating registry at C:\Users\Lenovo\.julia\registries\General.toml
   Resolving package versions...
    Updating C:\Users\Lenovo\.julia\environments\v1.10\Project.toml
  [6b5a15aa] + P4est_jll v2.8.1+2
    Updating C:\Users\Lenovo\.julia\environments\v1.10\Manifest.toml
  [3da0fdf6] + MPIPreferences v0.1.10
  [e33a78d0] + Hwloc_jll v2.10.0+0
  [7cb0a576] + MPICH_jll v4.1.2+1
  [f1f71cc9] + MPItrampoline_jll v5.3.1+1
  [9237b28f] + MicrosoftMPI_jll v10.1.4+1
  [fe0851c0] + OpenMPI_jll v5.0.1+0
  [6b5a15aa] + P4est_jll v2.8.1+2
  [32165bc3] + PMIx_jll v4.2.7+0
  [1080aeaf] + libevent_jll v2.1.13+1
  [eb928a42] + prrte_jll v3.0.2+0
  [4af54fe1] + LazyArtifacts
Precompiling project...
  10 dependencies successfully precompiled in 11 seconds. 151 already precompiled.
julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 6 × AMD Ryzen 5 4500U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
  Threads: 1 on 6 virtual cores

Did I understand correctly what I suppose to do?

@mkitti
Copy link
Contributor

mkitti commented Jan 20, 2024

@ArseniyKholod are you running as administrator or have you enabled Windows developer mode?

IanButterworth added a commit that referenced this issue Jan 22, 2024
* ignore tree hashes on Windows w/o symlink capability

Step one of addressing #3643

* avoid test setting ENV to "nothing"

* Revert "avoid test setting ENV to "nothing""

This reverts commit 5d98110.

* fix logic on ignore_hash_env_set

---------

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>
IanButterworth pushed a commit that referenced this issue Jan 22, 2024
* ignore tree hashes on Windows w/o symlink capability

Step one of addressing #3643

* avoid test setting ENV to "nothing"

* Revert "avoid test setting ENV to "nothing""

This reverts commit 5d98110.

* fix logic on ignore_hash_env_set

---------

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>
(cherry picked from commit b431875)
@IanButterworth
Copy link
Sponsor Member

#3764 is now queued up for 1.10.1 JuliaLang/julia#52755

@StefanKarpinski
Copy link
Sponsor Member

Thanks to @IanButterworth we now have Part 1 ready to go into 1.10.1 which means the time-critical part is done. 🥳 🎉 🎈

The next step that would be nice to do soonish would be to add unconditional checking of Tar.tree_hash for all tarballs that we download. I'm not sure if that warrants changing anything that was done in part 1; after all, it's still something of an issue that some tarballs get created with copied files instead of symlinks, so warning might be good. Then again, there's no attack vector since we know the tarballs is right, it just can't be extracted faithfully. I think the best option is probably to leave the warning so that people complain about artifacts with symlinks that end up on Windows systems.

@ArseniyKholod
Copy link

@ArseniyKholod are you running as administrator or have you enabled Windows developer mode?

No, as long as I understand, Developer Mode is disabled in settings, Windows Powershell is running in user mode, not like administrator (in Task Manager Powershell has NO in Elevated column).

@nhz2
Copy link
Contributor

nhz2 commented Jan 23, 2024

#3764 introduces a new bug on Windows where installing an artifact can delete an existing artifact.
Steps to reproduce:
In one julia environment run ]add iso_codes_jll@4.15.1.

Then in a second environment run

(jl_tANRC2) pkg> add iso_codes_jll@4.15.0
   Resolving package versions...
┌ Error: Tree Hash Mismatch!
│   Expected git-tree-sha1:   695a3abd0af051dab62687501b9a61ad91c831a3
│   Calculated git-tree-sha1: 1719102ef324df43b9fe123a231c2ee630931a03
│ 
│ System is Windows and user cannot create symlinks: ignoring hash mismatch and moving artifact to the expected location   
└ @ Pkg.Artifacts C:\Users\nzimm\github\nhz2\Pkg.jl\src\Artifacts.jl:346

Finally back in the first environment:

julia> using iso_codes_jll
ERROR: InitError: Artifact "iso_codes" was not found by looking in the paths:
  C:\Users\nzimm\.julia\artifacts\1719102ef324df43b9fe123a231c2ee630931a03
  C:\Users\nzimm\Downloads\julia-latest-win64\julia-ec686c3cb7\local\share\julia\artifacts\1719102ef324df43b9fe123a231c2ee630931a03
  C:\Users\nzimm\Downloads\julia-latest-win64\julia-ec686c3cb7\share\julia\artifacts\1719102ef324df43b9fe123a231c2ee630931a03
Try `using Pkg; Pkg.instantiate()` to re-install all missing resources if the artifact is part of a package or call `Pkg.ensure_artifact_installed` (https://pkgdocs.julialang.org/v1/api/#Pkg.Artifacts.ensure_artifact_installed) if not.

This happens because if the hash is ignored.

mv(src, dst; force=true)

will delete src which can be a valid artifact.

@IanButterworth
Copy link
Sponsor Member

This issue should be fixed on master and the upcoming v1.10.1 but if anyone wants to double check https://discourse.julialang.org/t/julia-1-10-1-testing-period/109805

@lmiq
Copy link

lmiq commented Feb 6, 2024

Is there a windows binary for the release candidate available anywhere?

@Devansh1106
Copy link

Devansh1106 commented Mar 24, 2024

The same error was reportedly encountered by @jmark on the Trixi.jl Slack.

I also the same in Trixi.jl . Where can I get the solution for this? I am using Julia v1.10

@mkitti
Copy link
Contributor

mkitti commented Mar 24, 2024

Which point release of Julia? 1.10.2 shod have addressed this.

@Devansh1106
Copy link

I am using v1.10.2 . The issue occurred when I was setting up Trixi.jl in my local machine. I ran this command.
julia> using Pkg
julia> Pkg.add(["Trixi", "Trixi2Vtk", "OrdinaryDiffEq", "Plots"])
This is what I got:
Screenshot_20240325_190620

@IanButterworth
Copy link
Sponsor Member

That issue appears to be an unrelated issue with permissions of your known_hosts file.

@IanButterworth
Copy link
Sponsor Member

I think this issue can be closed. There are some next steps proposed here #3643 (comment) but the current situation seems reasonable of a warning that will work but be noisy enough to promote people not using symlinks in windows artifacts.

@Devansh1106
Copy link

That issue appears to be an unrelated issue with permissions of your known_hosts file.

Do you have any idea for how can I rectify the permission issue? I think the error I am getting maybe related to the warning.

@IanButterworth
Copy link
Sponsor Member

Please open another issue for that

@StefanKarpinski
Copy link
Sponsor Member

Actually, please don't open an issue, post a question on Julia discourse.

@Devansh1106
Copy link

I have posted in Julia discourse.

@giordano
Copy link
Contributor

giordano commented Mar 25, 2024

@jgreener64 has just run into the "Tree Hash Mismatch!" error with Julia v1.10.2 in NVTX_jll@v3.1.0+2, I thought this was solved in Julia v1.10.2?

Edit: actually, I don't see symlinks in https://github.com/JuliaBinaryWrappers/NVTX_jll.jl/releases/download/NVTX-v3.1.0%2B2/NVTX.v3.1.0.x86_64-w64-mingw32.tar.gz, so the problem may be different 🤔

@StefanKarpinski
Copy link
Sponsor Member

@giordano: can you open a new issue for that one with info about the tree hash and how to reproduce?

@jgreener64
Copy link

I opened a new issue at #3856.

KristofferC pushed a commit that referenced this issue May 9, 2024
* ignore tree hashes on Windows w/o symlink capability

Step one of addressing #3643

* avoid test setting ENV to "nothing"

* Revert "avoid test setting ENV to "nothing""

This reverts commit 5d98110.

* fix logic on ignore_hash_env_set

---------

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet