Skip to content

Commit

Permalink
make koch and tools work with nimPreviewSlimSystem (#20459)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout committed Sep 30, 2022
1 parent 716d68c commit 3e43ea3
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 4 deletions.
3 changes: 3 additions & 0 deletions koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import std/[os, strutils, parseopt, osproc]
# If this fails with: `Error: cannot open file: std/os`, see
# https://github.com/nim-lang/Nim/pull/14291 for explanation + how to fix.

when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]

import tools / kochdocs
import tools / deps

Expand Down
3 changes: 3 additions & 0 deletions lib/std/private/gitutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ internal API for now, API subject to change

import std/[os, osproc, strutils, tempfiles]

when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]

const commitHead* = "HEAD"

template retryCall*(maxRetry = 3, backoffDuration = 1.0, call: untyped): bool =
Expand Down
5 changes: 5 additions & 0 deletions tests/tools/compile/tkoch.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
discard """
action: compile
"""

include koch
1 change: 1 addition & 0 deletions tests/tools/config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--d:nimPreviewSlimSystem
4 changes: 3 additions & 1 deletion tests/tools/tnimgrep.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ discard """
"""
## Authors: quantimnot, a-mr

import osproc, os, streams, unittest, strutils
import std/[osproc, os, streams, unittest, strutils]

import std/syncio

#=======
# setup
Expand Down
5 changes: 4 additions & 1 deletion tools/deps.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os, uri, strformat, strutils
import std/[os, uri, strformat, strutils]
import std/private/gitutils

when defined(nimPreviewSlimSystem):
import std/assertions

proc exec(cmd: string) =
echo "deps.cmd: " & cmd
let status = execShellCmd(cmd)
Expand Down
5 changes: 4 additions & 1 deletion tools/detect/detect.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# The second one is more portable, and less semantically correct. It only works
# when there's a backing C compiler available as well, preventing standalone
# compilation.
import os, strutils
import std/[os, strutils]

when defined(nimPreviewSlimSystem):
import std/syncio

when defined(openbsd) or defined(freebsd) or defined(netbsd):
const
Expand Down
6 changes: 5 additions & 1 deletion tools/kochdocs.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Part of 'koch' responsible for the documentation generation.

import os, strutils, osproc, sets, pathnorm, sequtils
import std/[os, strutils, osproc, sets, pathnorm, sequtils]

when defined(nimPreviewSlimSystem):
import std/assertions

# XXX: Remove this feature check once the csources supports it.
when defined(nimHasCastPragmaBlocks):
import std/pegs
Expand Down

0 comments on commit 3e43ea3

Please sign in to comment.