Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#### Unreleased

* `paket pack --symbols` no longer fails on a project with Compile entries without an `Include` or `Update` attribute, such as `<Compile Remove="..." />` or a Compile item definition in an `ItemDefinitionGroup`, and leaves out of the symbols package the files that a Remove names without wildcards - https://github.com/fsprojects/Paket/issues/4222
* `paket update --no-install` no longer fails when a group has `generate_load_scripts: true` and the packages of the new paket.lock aren't all restored, as on a fresh checkout or for a package that the update adds: it leaves the load scripts to the next restore, which downloads the packages that they load - https://github.com/fsprojects/Paket/issues/2785

#### 12.0.0-alpha005 - 2026-11-07

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,24 @@ let ``#3238 restore regenerates load scripts when .paket/load folder is missing`

nHibernate35Expectations |> assertExpectations scenario ExpectationType.ShouldContain

[<Test; Category("scriptgen")>]
let ``#2785 update --no-install leaves the load scripts to the restore`` () =
// generate_load_scripts: true, and nothing restored yet
let scenario = "issue-2939"
let cleanup, output = paket "update --no-install" scenario
use __ = cleanup
StringAssert.Contains("The load scripts will be generated by the next paket restore", output)

let tempPath = scenarioTempPath scenario
Assert.IsTrue(File.Exists(Path.Combine(tempPath, "paket.lock")), "update should write paket.lock")
Assert.IsFalse(Directory.Exists(Path.Combine(tempPath, "packages", "Newtonsoft.Json")), "--no-install should not download the packages")
Assert.IsFalse((scriptRoot scenario).Exists, "--no-install should not generate the load scripts")

directPaket "restore" scenario |> ignore<string>

let newtonsoftScript = Path.Combine((scriptRoot scenario).FullName, "Newtonsoft.Json.fsx")
Assert.IsTrue(File.Exists newtonsoftScript, "restore should generate the load scripts")

[<Test; Category("scriptgen dependencies")>]
let ``issue 2156 netstandard`` () =
let scenario = "issue-2156"
Expand Down
7 changes: 6 additions & 1 deletion src/Paket.Core/Installation/UpdateProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ let SmartInstall(dependenciesFile:DependenciesFile, updateMode, options : Update
|> Seq.tryHead
|> Option.isSome

if shouldGenerateScripts then
// --no-install doesn't download the packages that the scripts load. When the lock file changes,
// the restore cache no longer matches it, so the next restore downloads them and generates the scripts (#2785)
if shouldGenerateScripts && options.NoInstall then
if hasChanged then
tracefn "The load scripts will be generated by the next paket restore, which downloads the packages."
elif shouldGenerateScripts then
let groupsToGenerate =
if options.Common.GenerateLoadScripts then [] else
dependenciesFile.Groups
Expand Down