Skip to content

Avoid validation failures when performing operations like install #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2023
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
4 changes: 2 additions & 2 deletions src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ proc processLockedDependencies(pkgInfo: PackageInfo, options: Options, onlyNim =
# cache. If a package with required checksum is missing from the local cache
# installs it by downloading it from its repository.

let developModeDeps = getDevelopDependencies(pkgInfo, options)
let developModeDeps = getDevelopDependencies(pkgInfo, options, raiseOnValidationErrors = false)

for name, dep in pkgInfo.lockedDeps.lockedDepsFor(options):
if onlyNim and not name.isNim:
Expand Down Expand Up @@ -1651,7 +1651,7 @@ proc lock(options: Options) =
let
includeNim =
pkgInfo.lockedDeps.contains("compiler") or
pkgInfo.getDevelopDependencies(options).contains("nim")
pkgInfo.getDevelopDependencies(options, raiseOnValidationErrors = false).contains("nim")
deps = pkgInfo.processFreeDependencies(pkgInfo.requires, options, includeNim)
var fullDeps = deps # Deps shared by base and tasks

Expand Down
4 changes: 2 additions & 2 deletions src/nimblepkg/developfile.nim
Original file line number Diff line number Diff line change
Expand Up @@ -734,14 +734,14 @@ proc processDevelopDependencies*(dependentPkg: PackageInfo, options: Options):
for _, pkg in data.nameToPkg:
result.add pkg[]

proc getDevelopDependencies*(dependentPkg: PackageInfo, options: Options):
proc getDevelopDependencies*(dependentPkg: PackageInfo, options: Options, raiseOnValidationErrors = true):
Table[string, ref PackageInfo] =
## Returns a table with a mapping between names and `PackageInfo`s of develop
## mode dependencies of package `dependentPkg` and recursively all of their
## develop mode dependencies.

let loadGlobalDeps = not dependentPkg.getPkgDevFilePath.fileExists
let data = load(dependentPkg, options, true, true, loadGlobalDeps)
let data = load(dependentPkg, options, true, raiseOnValidationErrors, loadGlobalDeps)
return data.nameToPkg

type
Expand Down