Fixed compilation of required files
h3rald h3rald@h3rald.com
Thu, 31 Dec 2020 04:47:29 +0100
6 files changed,
19 insertions(+),
24 deletions(-)
M
lib/min_lang.nim
→
lib/min_lang.nim
@@ -13,13 +13,13 @@ import
os, json, logging, + ../core/baseutils, ../packages/niftylogger, ../packages/nimline/nimline, ../packages/nim-sgregex/sgregex import ../core/env, ../core/meta, - ../core/baseutils, ../core/parser, ../core/value, ../core/interpreter,@@ -88,20 +88,12 @@ var file = s.getString
if not file.endsWith(".min"): file = file & ".min" info("[load] File: ", file) - if MINCOMPILED: - var normalizedFile = strutils.replace(strutils.replace(file, "\\", "/"), "./", "") - var compiledFile = normalizedFile - var normalizedCurrFile = strutils.replace(strutils.replace(i.filename, "\\", "/"), "./", "") - var parts = normalizedCurrFile.split("/") - if parts.len > 1: - discard parts.pop - compiledFile = parts.join("/") & "/" & normalizedFile - if COMPILEDMINFILES.hasKey(compiledFile): - COMPILEDMINFILES[compiledFile](i) - return - var f = i.pwd.joinPath(file) - if not f.fileExists: - raiseInvalid("File '$1' does not exist." % file) + let f = simplifyPath(i.filename, file) + if MINCOMPILED and COMPILEDMINFILES.hasKey(f): + COMPILEDMINFILES[f](i2) + else: + if not f.fileExists: + raiseInvalid("File '$1' does not exist." % file) i.load f def.symbol("require") do (i: In):@@ -112,8 +104,7 @@ if not file.endsWith(".min"):
file = file & ".min" info("[require] File: ", file) let f = simplifyPath(i.filename, file) - if MINCOMPILED: - if COMPILEDMINFILES.hasKey(f): + if MINCOMPILED and COMPILEDMINFILES.hasKey(f): var i2 = i.copy(f) i2.withScope(): COMPILEDMINFILES[f](i2)
M
min.nim
→
min.nim
@@ -83,7 +83,7 @@ getFiles(dir)
res.sort(system.cmp) return res - proc getCompletions(ed: LineEditor, symbols: seq[string]): seq[string] = + proc getCompletions*(ed: LineEditor, symbols: seq[string]): seq[string] = var words = ed.lineText.split(" ") var word: string if words.len == 0:@@ -295,8 +295,6 @@ var iOpt = "\n -i, --interactive Start $1 shell (with advanced prompt)\n"
when defined(lite): exeName = "litemin" when defined(mini): - installOpt = "" - uninstallOpt = "" iOpt = "" exeName = "minimin"
M
min.nims
→
min.nims
@@ -12,8 +12,13 @@ switch("amd64.linux.gcc.linkerexe", "x86_64-linux-musl-gcc")
switch("opt", "size") +when not defined(dev): + switch("define", "release") + +when not defined(nossl): + switch("define", "ssl") + when defined(ssl) and not defined(mini): - switch("define", "ssl") switch("threads", "on") when defined(windows): # TODO", change once issue nim#15220 is resolved
M
next-release.md
→
next-release.md
@@ -5,3 +5,4 @@ * Fixed behavior of **require** and **invoke** ensuring that operators are evaluated in the correct scopes.
* Improved diagnostics of exceptions occurring in native code. * Fixed unwanted stack pollution in **to-yaml** operator. * Added check to prevent required modules from polluting the stack. +- Added **nossl** flag to compile without openssl (otherwise enabled by default).
M
site/contents/get-started.md
→
site/contents/get-started.md
@@ -38,7 +38,7 @@ 7. Run **nim c -d:release min.nim**.
### Additional build options -#### -d:ssl +#### -d:ssl (enabled by default) If the **-d:ssl** flag is specified when compiling, min will be built with SSL support, so it will be possible to: * perform HTTPS requests with the {#link-module||http#}.@@ -47,7 +47,7 @@
> %note% > Note > -> By default, this flag is enabled when compiling the executable files included with official releases. +> By default, this flag is enabled in the [min.nims](class:file). use **-d:nossl** to disable it. #### -d:lite