Skip to content

Commit

Permalink
Treats compiler as Nim (#1325)
Browse files Browse the repository at this point in the history
* Treats compiler as Nim

 #Compiler needs to be treated as Nim as long as it isnt a separated package. See nim-lang/Nim#23049
  #Also notice compiler and nim are aliases.

* removes fragile check
  • Loading branch information
jmgomez authored Jan 3, 2025
1 parent db1b76f commit b7d37e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nimblepkg/nimblesat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ func addUnique*[T](s: var seq[T], x: sink T) =

proc isNim*(pv: PkgTuple): bool = pv.name.isNim

proc convertNimrodToNim*(pv: PkgTuple): PkgTuple =
if pv.name != "nimrod": pv
proc convertNimAliasToNim*(pv: PkgTuple): PkgTuple =
#Compiler needs to be treated as Nim as long as it isnt a separated package. See https://github.com/nim-lang/Nim/issues/23049
#Also notice compiler and nim are aliases.
if pv.name notin ["nimrod", "compiler"]: pv
else: (name: "nim", ver: pv.ver)

proc getMinimalInfo*(pkg: PackageInfo, options: Options): PackageMinimalInfo =
result.name = pkg.basicInfo.name
result.name = if pkg.basicInfo.name.isNim: "nim" else: pkg.basicInfo.name
result.version = pkg.basicInfo.version
result.requires = pkg.requires.map(convertNimrodToNim)
result.requires = pkg.requires.map(convertNimAliasToNim)
if options.action.typ in {actionLock, actionDeps} or options.hasNimInLockFile():
result.requires = result.requires.filterIt(not it.isNim)

Expand Down

0 comments on commit b7d37e7

Please sign in to comment.