fsprojects / fsprojects/Paket

"copy_content_to_output_dir: preserve_newest" breaks paket.lock

Open
#4,017 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Add "copy_content_to_output_dir: preserve_newest" near the beginning of your paket.dependencies file
  2. Run ".paket/paket install"
  3. Re-run ".paket/paket install". Observe that it fails
  4. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.