forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
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
remove old bootstrap symbols < 0.20.0 #389
Comments
|
|
this snippet gives an idea of how many times each condsym symbol is used: # D20201203T131231
import std/[strformat,os,osproc,strutils,parseutils,sugar]
import pkg/regex
proc main() =
let s = readFile("compiler/condsyms.nim")
let a = collect(newSeq):
for m in findAll(s, re"""defineSymbol\(\"(?P<name>\w+)\"\)"""):
m.group(0, s)[0]
echo a
var tot = 0
for ai in a:
if ai == "nimnode": continue # skip special case otherwise matches NimNode etc
let cmd = fmt"rg -i {ai} . | wc -l"
var (outp, code) = execCmdEx(cmd)
doAssert code == 0
let num = outp.strip.parseInt
tot += num
echo (ai, num)
echo (a.len, tot)
main() results:
|
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cleanup old bootstrap stuff, eg:
when (NimMajor, NimMinor, NimPatch) < (0, 19, 9):
when defined(nimNewRoof): ... else:
dead code for old defined symbolsRequires
--nilseqs:onsince 0.19.
=>
--nilseqs
is now a deprecated noop nim-lang/Nim#17211example
$nim_0200_X is the nim used for bootstrap (built from csources via
sh build_all.sh
)$nim_0200_X -v
Nim Compiler Version 0.20.0 [MacOSX: amd64]
$nim_csources_local_X = $nim_0200_X
$nim_0200_X c -r --skipusercfg --skipparentcfg main
every symbol from condsyms.nim that passes this test can be removed:
$nim_0200_X c -r --skipusercfg --skipparentcfg main
nimHasStyleChecks
echo 'echo defined(nimHasStyleChecks)' | $nim_csources_local_X c -r -
false
defined in 0.20.2
note
the only thing that should be kept is the reference in condsyms.nim so that if some user has
when defined(nimHasFoo)
, it'll still workThe text was updated successfully, but these errors were encountered: