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

check symlinks work on windows on artifact hash mismatch #3745

Closed

Conversation

IanButterworth
Copy link
Member

For if #3643 isn't otherwise fixable

@nhz2
Copy link
Contributor

nhz2 commented Jan 5, 2024

This works on my Windows computer. If I turn off "Developer Mode" and delete the existing artifacts I get:

julia> using Pkg

julia> Pkg.add("NativeFileDialog")
   Resolving package versions...
ERROR: Unable to automatically download/install artifact 'iso_codes' from sources listed in 'C:\Users\nzimm\.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"
Note: Julia cannot create symlinks, which may be the reason for the hash mismatch.
You may need to activate Developer Mode in Windows.

- 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"
Note: Julia cannot create symlinks, which may be the reason for the hash mismatch.
You may need to activate Developer Mode in Windows.

When I turn "Developer Mode" back on I can add NativeFileDialog without any issues.

src/Artifacts.jl Outdated Show resolved Hide resolved
Co-authored-by: Nathan Zimmerberg <39104088+nhz2@users.noreply.github.com>
Co-Authored-By: Nathan Zimmerberg <39104088+nhz2@users.noreply.github.com>
staticfloat
staticfloat previously approved these changes Jan 5, 2024
src/Artifacts.jl Show resolved Hide resolved
src/Artifacts.jl Outdated
Comment on lines 337 to 339
Note: Julia cannot create symlinks, which may be the reason for the hash mismatch.
You may need to activate Developer Mode in Windows.
If you cannot you can set the env var `JULIA_PKG_IGNORE_HASHES=1` to ignore artifact hash mismatches.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note: Julia cannot create symlinks, which may be the reason for the hash mismatch.
You may need to activate Developer Mode in Windows.
If you cannot you can set the env var `JULIA_PKG_IGNORE_HASHES=1` to ignore artifact hash mismatches.
Note: Julia cannot create symlinks, which may be the reason for the hash mismatch.
One solution is to activate Developer Mode in Windows, for instructions on how to do that, see:
https://learn.microsoft.com/en-us/gaming/game-bar/guide/developer-mode
An alternative path is to set the environment variable `JULIA_PKG_IGNORE_HASHES=1`
to ignore artifact hash mismatches, however this is generally not recommended.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that my link has "gaming" in it, but the link you posted is also really confusing because it doesn't actually tell you how to enable developer mode, the only instructions it gives are for responding to a popup inside of visual studio. There's no instructions telling you to go to "updates and security" and flip the toggle, that's why I didn't use it.

Also, there are lots of warnings on that site that say things like If you're not creating your own applications on your PC, you don't need to enable Developer Mode., or If you're using your computer for ordinary day-to-day activities (such as gaming, web browsing, email, or Office apps), you don't need to activate Developer Mode, and in fact, you shouldn't activate it..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah fair

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to tell people to set an environment variable on Windows, stating ENV["JULIA_PKG_IGNORE_HASHES"] = 1 explicitly, might be good. Otherwise, we will need to get into the details on how to do that in either the Cmd.exe shell or PowerShell.

  • Cmd.exe: set JULIA_PKG_IGNORE_HASHES=1
  • PowerShell: $env:JULIA_PKG_IGNORE_HASHES=1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add an easier way to do it given we're changing julia in adding this message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tweaked the wording to make it clearer to users and guide them to use ENV so they're more likely to do it temporarily

IanButterworth and others added 2 commits January 5, 2024 19:40
Co-authored-by: Elliot Saba <staticfloat@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants