"copy_content_to_output_dir: preserve_newest" breaks paket.lock
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 2.1k
- Forks
- 528
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 54
Description
Description
When I put "copy_content_to_output_dir: preserve_newest" into my paket.dependencies file, an incorrect paket.lock is generated. paket.lock is incorrectly generated with "COPY-CONTENT-TO-OUTPUT-DIR: PRESERVE-NEWEST". I can no longer run ".paket/paket install" or build any projects until I update paket.lock to have "PRESERVE_NEWEST"
Note that the difference is a dash versus an underscore.
My team believes the bug is here:
https://github.com/fsprojects/Paket/blob/b2feccc8f9e49f731083d2e2bfc5f47e5328eaa8/src/Paket.Core/PaketConfigFiles/LockFile.fs#L71
Repro steps
Please provide the steps required to reproduce the problem
- Add "copy_content_to_output_dir: preserve_newest" near the beginning of your paket.dependencies file
- Run ".paket/paket install"
- Re-run ".paket/paket install". Observe that it fails
- Try to build any of the .csproj files in your solution. Observe that : The command ""....paket\paket.exe" restore --references-file "..."" exited with code 1. (Edited to remove personal information)
Expected behavior
- paket.lock should have "COPY-CONTENT-TO-OUTPUT-DIR: PRESERVE_NEWEST"
- You should be able to re-run ".paket/paket install"
- You should be able to build your solution
Actual behavior
Re-running ".paket/paket install" fails with:
`Paket version 5.257.0
Performance:
- Runtime: 491 milliseconds
Paket failed with
-> Error during parsing of '...\opti\paket.lock'.
-> Unknown copy_content_to_output_dir settings: "preserve-newest"
`
Projects in my solution fail with:
1> Paket failed with
1> -> Error during parsing of '...\paket.lock'.
1> -> Unknown copy_content_to_output_dir settings: "preserve-newest"
Known workarounds
Manually edit paket.lock to have "COPY-CONTENT-TO-OUTPUT-DIR: PRESERVE_NEWEST"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Paket.Core/PaketConfigFiles/LockFile.fs at the referenced line, then reproduce the issue using paket.dependencies and .paket/paket install. Compare the generated paket.lock value with the expected PRESERVE_NEWEST spelling and verify that install and the affected project builds succeed afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100