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

fix hash computations #111

Merged
merged 5 commits into from
Nov 27, 2024
Merged

fix hash computations #111

merged 5 commits into from
Nov 27, 2024

Conversation

amtoine
Copy link
Member

@amtoine amtoine commented Nov 25, 2024

with Nushell 0.100.0, to nuon has changed and now quotes strings that contain a ., thus breaking hash computations...

this PR does the following

  1. formats the registry NUON file so that it's easier to read and maintain
  2. relax the "newline" test on registry files, not sure why we want to have newlines in registry files
  3. fix the computation of the hash of pkg files by using to nuon instead of open --raw
  4. pin the Nushell version to 0.100.0 in the CI because having a moving target in a CI is very hard to work with

Note

point 1, 2 and 3 are probably debatable and not mandatory for this PR but it was by far the easiest to get this PR going 😋

because `to nuon` has changed and is not the same as what `open --raw`
returns anymore, need to compute the hash with the output of `to nuon`
manually.

maybe `hash-file` is becoming useless?
having a moving target in the CI is very hard to work with...
@kubouch
Copy link
Contributor

kubouch commented Nov 27, 2024

The newline test was me working around Windows \r\n vs. Unix \n. I guess the nuon route is probably better. Since the tests now pass, let's ship it! Thanks!

@kubouch kubouch merged commit 3bc98fd into nushell:main Nov 27, 2024
3 checks passed
@amtoine amtoine deleted the fix-hash branch December 2, 2024 18:09
@amtoine
Copy link
Member Author

amtoine commented Dec 2, 2024

aaaah yeah, i get it!

if this works, i think it's best for the future, even files like Cargo.lock or package-lock.json don't put everything on a single line, for humans to see diffs when necessary 😉 😋

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.

2 participants