Skip to content

Commit f762ecc

Browse files
committed
Improvements
1 parent 24531df commit f762ecc

File tree

4 files changed

+103
-164
lines changed

4 files changed

+103
-164
lines changed

src/bootstrap.nim

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# License, v. 2.0. If a copy of the MPL was not distributed with this
77
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
88

9-
import std/[os, strformat, strutils], packages, tools
9+
import std/[os, strformat, strutils], packages, utils
1010

1111
proc cleanBootstrap*() =
1212
const dirs = ["../cross", "../log", "../tmp", "../toolchain"]
@@ -35,23 +35,21 @@ proc prepareToolchain() =
3535

3636
proc configureToolchain() =
3737
const env = [
38-
("REPO", "../core"),
39-
("CRSD", "../cross"),
40-
("TMPD", "../tmp"),
41-
("TLCD", "../toolchain"),
38+
("core", "../core"),
39+
("cross", "../cross"),
40+
("tmp", "../tmp"),
41+
("toolchain", "../toolchain"),
4242
]
4343

4444
for (i, j) in env:
4545
putEnv(i, absolutePath(j))
4646

47-
putEnv("PATH", getEnv("TLCD") / "usr/bin" & PathSep & getEnv("PATH"))
47+
putEnv("PATH", getEnv("toolchain") / "usr/bin" & PathSep & getEnv("PATH"))
4848

4949
proc bootstrapToolchain*() =
5050
prepareToolchain()
5151
configureToolchain()
52-
buildPackages(
53-
parsePackage("toolchain").run.split(), resolve = false, stage = toolchain
54-
)
52+
buildPackages(parseInfo("toolchain").run.split(), true, toolchain)
5553

5654
proc prepareCross() =
5755
const dir = "../tmp"
@@ -95,7 +93,4 @@ proc bootstrapCross*() =
9593
prepareCross()
9694
configureCross()
9795
configureToolchain()
98-
buildPackages(parsePackage("cross").run.split(), resolve = false, stage = cross)
99-
100-
proc bootstrapNative*() =
101-
buildPackages(parsePackage("native").run.split(), resolve = false)
96+
buildPackages(parseInfo("cross").run.split(), true, cross)

src/options.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# License, v. 2.0. If a copy of the MPL was not distributed with this
77
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
88

9-
import std/[os, parseopt], bootstrap, packages, tools
9+
import std/[os, parseopt, strutils], bootstrap, packages, utils
1010

1111
proc options*() =
1212
const
@@ -83,20 +83,20 @@ Copyright © 2018-2025 Firas Khana"""
8383
echo ""
8484
echo "stage 2 (cross) complete"
8585
of "3", "stage3", "native":
86-
bootstrapNative()
86+
buildPackages(parseInfo("native").run.split(), true)
8787

8888
echo ""
8989
echo "stage 3 (native) complete"
9090
else:
9191
exit(helpBootstrap, QuitFailure)
9292
of "build":
93-
cleanPackages()
93+
cleanCache()
9494
buildPackages(remainingArgs(p))
9595

9696
echo ""
9797
echo "build complete"
9898
of "clean":
99-
cleanPackages()
99+
cleanCache()
100100

101101
echo "clean complete"
102102
of "contents":

0 commit comments

Comments
 (0)