mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 19:34:12 +00:00
IC: need a more recent Nimony for its improved Nifler tool (#25412)
This commit is contained in:
@@ -1000,7 +1000,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||
# xxx maybe also ic, since not in help?
|
||||
if pass in {passCmd2, passPP}:
|
||||
case arg.normalize
|
||||
of "on": conf.symbolFiles = v2Sf
|
||||
of "on": conf.ic = true
|
||||
of "legacy": conf.symbolFiles = v2Sf
|
||||
of "off": conf.symbolFiles = disabledSf
|
||||
of "writeonly": conf.symbolFiles = writeOnlySf
|
||||
of "readonly": conf.symbolFiles = readOnlySf
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## Supports the "nim check --ic:on --defusages:FILE,LINE,COL"
|
||||
## Supports the "nim check --ic:legacy --defusages:FILE,LINE,COL"
|
||||
## IDE-like features. It uses the set of .rod files to accomplish
|
||||
## its task. The set must cover a complete Nim project.
|
||||
|
||||
|
||||
@@ -369,6 +369,7 @@ type
|
||||
numberOfProcessors*: int # number of processors
|
||||
lastCmdTime*: float # when caas is enabled, we measure each command
|
||||
symbolFiles*: SymbolFilesOption
|
||||
ic*: bool # whether ic is enabled
|
||||
spellSuggestMax*: int # max number of spelling suggestions for typos
|
||||
|
||||
cppDefines*: HashSet[string] # (*)
|
||||
|
||||
7
koch.nim
7
koch.nim
@@ -16,7 +16,7 @@ const
|
||||
ChecksumsStableCommit = "0b8e46379c5bc1bf73d8b3011908389c60fb9b98" # 2.0.1
|
||||
SatStableCommit = "faf1617f44d7632ee9601ebc13887644925dcc01"
|
||||
|
||||
NimonyStableCommit = "322178d9af6676363d5237382c6d6c1b4e56d3cd" # unversioned \
|
||||
NimonyStableCommit = "e2cd6eadcaa68eb8ab380cb4d3bdd7fd260677b4" # unversioned \
|
||||
# Note that Nimony uses Nim as a git submodule but we don't want to install
|
||||
# Nimony's dependency to Nim as we are Nim. So a `git clone` without --recursive
|
||||
# is **required** here.
|
||||
@@ -188,6 +188,9 @@ proc bundleChecksums(latest: bool) =
|
||||
let nimonyCommit = if latest: "HEAD" else: NimonyStableCommit
|
||||
cloneDependency(distDir, "https://github.com/nim-lang/nimony.git", nimonyCommit, allowBundled = true)
|
||||
|
||||
nimCompileFold("Compile nifler", "dist/nimony/src/nifler/nifler.nim", options = "-d:release")
|
||||
nimCompileFold("Compile nifmake", "dist/nimony/src/nifmake/nifmake.nim", options = "-d:release")
|
||||
|
||||
proc bundleNimsuggest(args: string) =
|
||||
bundleChecksums(false)
|
||||
nimCompileFold("Compile nimsuggest", "nimsuggest/nimsuggest.nim",
|
||||
@@ -553,7 +556,7 @@ proc icTest(args: string) =
|
||||
for fragment in content.split("#!EDIT!#"):
|
||||
let file = inp.replace(".nim", "_temp.nim")
|
||||
writeFile(file, fragment)
|
||||
var cmd = nimExe & " cpp --ic:on -d:nimIcIntegrityChecks --listcmd "
|
||||
var cmd = nimExe & " cpp --ic:legacy -d:nimIcIntegrityChecks --listcmd "
|
||||
if i == 0:
|
||||
cmd.add "-f "
|
||||
cmd.add quoteShell(file)
|
||||
|
||||
@@ -493,8 +493,8 @@ proc icTests(r: var TResults; testsDir: string, cat: Category, options: string;
|
||||
tooltests = ["compiler/nim.nim"]
|
||||
writeOnly = " --incremental:writeonly "
|
||||
readOnly = " --incremental:readonly "
|
||||
incrementalOn = " --incremental:on -d:nimIcIntegrityChecks "
|
||||
navTestConfig = " --ic:on -d:nimIcNavigatorTests --hint:Conf:off --warnings:off "
|
||||
incrementalOn = " --incremental:legacy -d:nimIcIntegrityChecks "
|
||||
navTestConfig = " --ic:legacy -d:nimIcNavigatorTests --hint:Conf:off --warnings:off "
|
||||
|
||||
template test(x: untyped) =
|
||||
testSpecWithNimcache(r, makeRawTest(file, x & options, cat), nimcache)
|
||||
@@ -508,7 +508,7 @@ proc icTests(r: var TResults; testsDir: string, cat: Category, options: string;
|
||||
|
||||
template checkTest() =
|
||||
var test = makeRawTest(file, options, cat)
|
||||
test.spec.cmd = compilerPrefix & " check --hint:Conf:off --warnings:off --ic:on $options " & file
|
||||
test.spec.cmd = compilerPrefix & " check --hint:Conf:off --warnings:off --ic:legacy $options " & file
|
||||
testSpecWithNimcache(r, test, nimcache)
|
||||
|
||||
if not isNavigatorTest:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
cmd: "nim cpp --incremental:on $file"
|
||||
cmd: "nim cpp --incremental:legacy $file"
|
||||
"""
|
||||
|
||||
{.emit:"""/*TYPESECTION*/
|
||||
@@ -8,4 +8,4 @@ discard """
|
||||
""".}
|
||||
|
||||
type Foo {.importcpp.} = object
|
||||
echo $Foo() #Notice the generic is instantiate in the this module if not, it wouldnt find Foo
|
||||
echo $Foo() #Notice the generic is instantiate in the this module if not, it wouldnt find Foo
|
||||
|
||||
Reference in New Issue
Block a user