question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Imporouvment] beeing warned if paket.lock was edited

See original GitHub issue

Description

In some scenario we found out that paket.lock has been edited. It could be for good or bad reason, this is not the point. The thing that we found out that constraints were edited instead of pinning third part for example This issue is that when you try to rollback to these previous state, removing paket.lock and redo a paket install it took us few hours to understand that it was in fact a manual edit that was the origin

I was wondering if there was a way to add a Hash in the very first lines of the paket.lock, that way, when using paket restore paket install paket add paket update … We would have a WARN or even ERROR(a paramter of the paket.dependencies

Repro steps

  1. create a project with package that have dependencies + transitie
  2. manually edit paket.lock : the version constrains of the transitive packages
  3. make sure constrains make no sense (like skip a major)
  4. run a paket restore ==> no idea it was edited
  5. backup paket.lock and remove it (rename it ?)
  6. run a paket install
  7. compare new and old paket.lock

Expected behavior

Got warn or failure when any action reading / modifing paket.lock that does not match An idea would be to add a line wish HASH of the resulted paket.lock It would only required to rehash the paket.lock (expection of this line for evident reason) then we could have warnings about manual edition

Bonus: Beeing able to choose warning or error (just like WARN AS ERROR)

Actual behavior

silent

Known workarounds

None, we could try to see in Source control, but if the same commit contains both install+edit Depending on constraints it is impossible to be sur that running paket install will endup with the same lock

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
matthidcommented, Aug 26, 2017

I think we have some change-detection in place. But it didn’t seem to catch your use case. Usually paket warns when it detects that the dependencies-file doesn’t match with the lockfile. However, this can really only go so far…

Consider if someone edits the lockfile and updates the hash-file by hand. What to do now? Add another hash file for the hash file? IMHO Basically if users edit the file you need to assume they know what they are doing, such things need to be detected by code-reviews or other means.

0reactions
tebecocommented, Sep 3, 2017

i though i closed it, my bad

conclusion is, we got no way to detect that or remove paket.lock, run a paket install and compare both paket.lock and do a review (That won’t happen i guess)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Confusion between "paket install" and "paket update" #848
Delete paket.lock if it exists, therefore discarding the currently used versions of the packages (UpdateProcess.Update). · Compute a new paket.
Read more >
release-notes
USABILITY: Better error message when paket.lock an paket.dependencies are out of sync. USABILITY: Content:once doesn't add paket flags to the csproj file in ......
Read more >
The paket.lock file
The paket.lock file records the concrete dependency resolution of all direct and transitive dependencies of your project: ...
Read more >
Paket error: "Package was referenced, but it was not found ...
Option 1. The easiest way to fix this error is to delete the file paket.lock , and force Paket to regenerate this file...
Read more >
Is it possible to remove irrelevant restrictions from paket.lock?
Paket is resolving the package and correctly serializing the resolution rules. Should you do something like multi-target in the future, and one ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found