Skip to content

Commit b7d37e7

Browse files
authored
Treats compiler as Nim (#1325)
* 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
1 parent db1b76f commit b7d37e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/nimblepkg/nimblesat.nim

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,16 @@ func addUnique*[T](s: var seq[T], x: sink T) =
9797

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

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

104106
proc getMinimalInfo*(pkg: PackageInfo, options: Options): PackageMinimalInfo =
105-
result.name = pkg.basicInfo.name
107+
result.name = if pkg.basicInfo.name.isNim: "nim" else: pkg.basicInfo.name
106108
result.version = pkg.basicInfo.version
107-
result.requires = pkg.requires.map(convertNimrodToNim)
109+
result.requires = pkg.requires.map(convertNimAliasToNim)
108110
if options.action.typ in {actionLock, actionDeps} or options.hasNimInLockFile():
109111
result.requires = result.requires.filterIt(not it.isNim)
110112

0 commit comments

Comments
 (0)