summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-08-09 16:32:29 +0800
committerGitHub <noreply@github.com>2022-08-09 16:32:29 +0800
commite8ae2dc90ba62466b3aba212df133f7ad564cbab (patch)
tree902ded8319f73e6df66a0aa4ba875d2ef50e13d3
parentcddd4de658fccc9c715cebb6788312f82d5b03a8 (diff)
downloadNim-e8ae2dc90ba62466b3aba212df133f7ad564cbab.tar.gz
bootstrap the compiler with nimPreviewSlimSystem (#20176)
* bootstrap the compiler with nimPreviewSlimSystem

* threads
-rw-r--r--compiler/depends.nim4
-rw-r--r--compiler/docgen.nim4
-rw-r--r--compiler/jsgen.nim4
-rw-r--r--compiler/nim.cfg1
-rw-r--r--compiler/packages.nim4
-rw-r--r--compiler/renderverbatim.nim4
-rw-r--r--compiler/typesrenderer.nim4
-rw-r--r--compiler/vmops.nim2
-rw-r--r--lib/packages/docutils/dochelpers.nim4
-rw-r--r--lib/packages/docutils/highlite.nim4
-rw-r--r--lib/packages/docutils/rst.nim4
-rw-r--r--lib/packages/docutils/rstast.nim4
-rw-r--r--lib/packages/docutils/rstgen.nim5
-rw-r--r--lib/pure/collections/lists.nim3
-rw-r--r--lib/pure/strscans.nim4
-rw-r--r--lib/pure/uri.nim3
-rw-r--r--lib/pure/xmltree.nim4
-rw-r--r--lib/std/strbasics.nim4
-rw-r--r--lib/system/threads.nim3
19 files changed, 68 insertions, 1 deletions
diff --git a/compiler/depends.nim b/compiler/depends.nim
index 1dcdec989..7e5dabbd3 100644
--- a/compiler/depends.nim
+++ b/compiler/depends.nim
@@ -16,6 +16,10 @@ import modulegraphs
 import std/[os, strutils, parseutils]
 import std/private/globs
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   TGen = object of PPassContext
     module: PSym
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 52bb93c19..8c95692df 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -23,6 +23,10 @@ from uri import encodeUrl
 from std/private/globs import nativeToUnixPath
 from nodejs import findNodeJs
 
+when defined(nimPreviewSlimSystem):
+  import std/[assertions, syncio]
+
+
 const
   exportSection = skField
   docCmdSkip = "skip"
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim
index 6d34fcae2..60d10f58d 100644
--- a/compiler/jsgen.nim
+++ b/compiler/jsgen.nim
@@ -37,6 +37,10 @@ import
 
 import json, sets, math, tables, intsets, strutils
 
+when defined(nimPreviewSlimSystem):
+  import std/[assertions, syncio]
+
+
 type
   TJSGen = object of PPassContext
     module: PSym
diff --git a/compiler/nim.cfg b/compiler/nim.cfg
index 4a0287cb5..7ed70fb5f 100644
--- a/compiler/nim.cfg
+++ b/compiler/nim.cfg
@@ -5,6 +5,7 @@ hint[XDeclaredButNotUsed]:off
 define:booting
 define:nimcore
 define:nimPreviewFloatRoundtrip
+define:nimPreviewSlimSystem
 
 #import:"$projectpath/testability"
 
diff --git a/compiler/packages.nim b/compiler/packages.nim
index 6ceeb1ccc..d8b97e374 100644
--- a/compiler/packages.nim
+++ b/compiler/packages.nim
@@ -16,6 +16,10 @@
 
 import "." / [options, ast, lineinfos, idents, pathutils, msgs]
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 proc getPackage*(conf: ConfigRef; cache: IdentCache; fileIdx: FileIndex): PSym =
   ## Return a new package symbol.
   ## 
diff --git a/compiler/renderverbatim.nim b/compiler/renderverbatim.nim
index fc74f2322..792079b3f 100644
--- a/compiler/renderverbatim.nim
+++ b/compiler/renderverbatim.nim
@@ -2,6 +2,10 @@ import strutils
 
 import ast, options, msgs
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 const isDebug = false
 when isDebug:
   import renderer
diff --git a/compiler/typesrenderer.nim b/compiler/typesrenderer.nim
index c81ff283e..f59f63659 100644
--- a/compiler/typesrenderer.nim
+++ b/compiler/typesrenderer.nim
@@ -9,6 +9,10 @@
 
 import renderer, strutils, ast, types
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 const defaultParamSeparator* = ","
 
 template mayNormalize(s: string): string =
diff --git a/compiler/vmops.nim b/compiler/vmops.nim
index 7c7f02006..01aa5a4b9 100644
--- a/compiler/vmops.nim
+++ b/compiler/vmops.nim
@@ -32,7 +32,7 @@ from system/formatfloat import addFloatRoundtrip, addFloatSprintf
 
 
 when defined(nimPreviewSlimSystem):
-  import std/[syncio, assertions]
+  import std/syncio
 
 
 # There are some useful procs in vmconv.
diff --git a/lib/packages/docutils/dochelpers.nim b/lib/packages/docutils/dochelpers.nim
index 8f97a7119..a11f2bbbb 100644
--- a/lib/packages/docutils/dochelpers.nim
+++ b/lib/packages/docutils/dochelpers.nim
@@ -15,6 +15,10 @@
 
 import rstast
 
+when defined(nimPreviewSlimSystem):
+  import std/[assertions, syncio]
+
+
 type
   LangSymbol* = object       ## symbol signature in Nim
     symKind*: string           ## "proc", "const", "type", etc
diff --git a/lib/packages/docutils/highlite.nim b/lib/packages/docutils/highlite.nim
index 3af94ab21..4e62031eb 100644
--- a/lib/packages/docutils/highlite.nim
+++ b/lib/packages/docutils/highlite.nim
@@ -59,6 +59,10 @@ import
   strutils
 from algorithm import binarySearch
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   SourceLanguage* = enum
     langNone, langNim, langCpp, langCsharp, langC, langJava,
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim
index f9fbb521f..91076bbee 100644
--- a/lib/packages/docutils/rst.nim
+++ b/lib/packages/docutils/rst.nim
@@ -238,6 +238,10 @@ import
   std/private/miscdollars, tables, strscans
 from highlite import SourceLanguage, getSourceLanguage
 
+when defined(nimPreviewSlimSystem):
+  import std/[assertions, syncio]
+
+
 type
   RstParseOption* = enum     ## options for the RST parser
     roSupportSmilies,         ## make the RST parser support smilies like ``:)``
diff --git a/lib/packages/docutils/rstast.nim b/lib/packages/docutils/rstast.nim
index bf0bc1be5..eac3a5e15 100644
--- a/lib/packages/docutils/rstast.nim
+++ b/lib/packages/docutils/rstast.nim
@@ -11,6 +11,10 @@
 
 import strutils, json
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   RstNodeKind* = enum        ## the possible node kinds of an PRstNode
     rnInner,                  # an inner node or a root
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim
index 11c91a40c..6232cb0be 100644
--- a/lib/packages/docutils/rstgen.nim
+++ b/lib/packages/docutils/rstgen.nim
@@ -42,6 +42,11 @@
 import strutils, os, hashes, strtabs, rstast, rst, highlite, tables, sequtils,
   algorithm, parseutils, std/strbasics
 
+
+when defined(nimPreviewSlimSystem):
+  import std/[assertions, syncio]
+
+
 import ../../std/private/since
 
 const
diff --git a/lib/pure/collections/lists.nim b/lib/pure/collections/lists.nim
index d1de0ea67..829ec2ccb 100644
--- a/lib/pure/collections/lists.nim
+++ b/lib/pure/collections/lists.nim
@@ -59,6 +59,9 @@ runnableExamples:
 
 import std/private/since
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 when not defined(nimHasCursor):
   {.pragma: cursor.}
 
diff --git a/lib/pure/strscans.nim b/lib/pure/strscans.nim
index 99442075a..7db6f28af 100644
--- a/lib/pure/strscans.nim
+++ b/lib/pure/strscans.nim
@@ -286,6 +286,10 @@ efficiency and perform different checks.
 import macros, parseutils
 import std/private/since
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 proc conditionsToIfChain(n, idx, res: NimNode; start: int): NimNode =
   assert n.kind == nnkStmtList
   if start >= n.len: return newAssignment(res, newLit true)
diff --git a/lib/pure/uri.nim b/lib/pure/uri.nim
index 1dbb018c2..50b1b9445 100644
--- a/lib/pure/uri.nim
+++ b/lib/pure/uri.nim
@@ -39,6 +39,9 @@ runnableExamples:
 import strutils, parseutils, base64
 import std/private/[since, decode_helpers]
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 
 type
   Url* = distinct string
diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim
index 9a9ecde57..72645ef96 100644
--- a/lib/pure/xmltree.nim
+++ b/lib/pure/xmltree.nim
@@ -33,6 +33,10 @@ runnableExamples:
 import std/private/since
 import macros, strtabs, strutils
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   XmlNode* = ref XmlNodeObj ## An XML tree consisting of XML nodes.
     ##
diff --git a/lib/std/strbasics.nim b/lib/std/strbasics.nim
index 6f6db5c37..be1dd7a58 100644
--- a/lib/std/strbasics.nim
+++ b/lib/std/strbasics.nim
@@ -11,6 +11,10 @@
 ##
 ## Experimental API, subject to change.
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 const whitespaces = {' ', '\t', '\v', '\r', '\l', '\f'}
 
 proc add*(x: var string, y: openArray[char]) =
diff --git a/lib/system/threads.nim b/lib/system/threads.nim
index 1c1d1ca1c..aaaa33bb7 100644
--- a/lib/system/threads.nim
+++ b/lib/system/threads.nim
@@ -47,6 +47,9 @@
 when not declared(ThisIsSystem):
   {.error: "You must not import this module explicitly".}
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 const
   hasAllocStack = defined(zephyr) # maybe freertos too?