diff --git a/src/Paket.Core/Dependencies/PackageResolver.fs b/src/Paket.Core/Dependencies/PackageResolver.fs index d4377e1c1e..b5d4d9366c 100644 --- a/src/Paket.Core/Dependencies/PackageResolver.fs +++ b/src/Paket.Core/Dependencies/PackageResolver.fs @@ -209,6 +209,9 @@ module ResolutionRaw = match req.Parent with | DependenciesFile _ -> sprintf " - Dependencies file requested package %O: %s%s%s" req.Name vr pr tp + | DependenciesLock(_,path) -> + let lock = try IO.Path.GetFileName(path) with | ex -> path + sprintf " - External \"%s\" requested package %O: %s%s%s" lock req.Name vr pr tp | Package (parentName,version,_) -> sprintf " - %O %O requested package %O: %s%s%s" parentName version req.Name vr pr tp @@ -479,7 +482,7 @@ let private explorePackageConfig (getPackageDetailsBlock:PackageDetailsSyncFunc) let settings = match dependency.Parent with - | DependenciesFile _ -> dependency.Settings + | DependenciesFile _ | DependenciesLock _ -> dependency.Settings | Package _ -> match pkgConfig.RootDependencies.TryGetValue packageDetails.Name with | true, r -> r.Settings + dependency.Settings @@ -938,8 +941,9 @@ let Resolve (getVersionsRaw : PackageVersionsFunc, getPreferredVersionsRaw : Pre rootDependencies |> Seq.choose (fun r -> match r.Parent with - | PackageRequirementSource.DependenciesFile _ when (r.Kind = PackageRequirementKind.DotnetCliTool) -> - Some r.Name + | PackageRequirementSource.DependenciesFile _ | PackageRequirementSource.DependenciesLock _ + when (r.Kind = PackageRequirementKind.DotnetCliTool) -> + Some r.Name | _ -> None) |> Set.ofSeq diff --git a/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs b/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs index 8d0e107c96..dc7d9451c5 100644 --- a/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs +++ b/src/Paket.Core/PaketConfigFiles/DependenciesFile.fs @@ -258,13 +258,13 @@ type DependenciesFile(fileName,groups:Map, textRepr folder.Create() let fileName = Path.Combine(folder.FullName,"paket.lock") client.DownloadFile(x,fileName) - LockFile.LoadFrom fileName + x, LockFile.LoadFrom fileName else let fi = try FileInfo x with | exn -> failwithf "The external lock file %s that was referenced in group %O has invalid path. Message: %s" x group.Name exn.Message if not (File.Exists fi.FullName) then failwithf "The external lock file %s that was referenced in group %O does not exist." fi.FullName group.Name - LockFile.LoadFrom fi.FullName) - |> Seq.collect (fun lockFile -> + x, LockFile.LoadFrom fi.FullName) + |> Seq.collect (fun (lockName, lockFile) -> match lockFile.Groups |> Map.tryFind group.Name with | None -> Seq.empty | Some externalGroup -> @@ -272,10 +272,15 @@ type DependenciesFile(fileName,groups:Map, textRepr |> Seq.map (fun kv -> let p = kv.Value { Name = p.Name - VersionRequirement = VersionRequirement.VersionRequirement(VersionRange.Specific p.Version,if p.Version.PreRelease = None then PreReleaseStatus.No else PreReleaseStatus.All) + VersionRequirement = + VersionRequirement.VersionRequirement( + VersionRange.Specific p.Version, + match p.Version.PreRelease with + | Some pre -> PreReleaseStatus.All // common dependencies must be present in the same paket.lock anyway + | None -> PreReleaseStatus.No ) ResolverStrategyForDirectDependencies = Some ResolverStrategy.Max ResolverStrategyForTransitives = Some ResolverStrategy.Max - Parent = PackageRequirementSource.DependenciesFile(fileName,0) + Parent = PackageRequirementSource.DependenciesLock(fileName,lockName) Graph = Set.empty Sources = group.Sources Kind = PackageRequirementKind.Package diff --git a/src/Paket.Core/Versioning/Requirements.fs b/src/Paket.Core/Versioning/Requirements.fs index 140edec1a0..a66818b24a 100644 --- a/src/Paket.Core/Versioning/Requirements.fs +++ b/src/Paket.Core/Versioning/Requirements.fs @@ -1071,15 +1071,17 @@ type RemoteFileInstallSettings = type PackageRequirementSource = | DependenciesFile of string * int +| DependenciesLock of string * string | Package of PackageName * SemVerInfo * PackageSource member this.IsRootRequirement() = match this with - | DependenciesFile _ -> true + | DependenciesFile _ | DependenciesLock _ -> true | _ -> false override this.ToString() = match this with | DependenciesFile(x,_) -> x + | DependenciesLock(_,x) -> x | Package(name,version,_) -> sprintf "%O %O" name version