Open
Description
/cc @Araq
rationale
avoid code duplication and re-inventing the wheel
how it'd work
build_all.sh
builds csources- the it builds koch
- then it calls
koch boot
- koch boot clones dependencies in dist including fusion at a fixed hash baked in koch.nim (equivalent to a git submodule)
import fusion/foo
is made available for import, in fact it already is implemented in:
proc bundleFusion(latest: bool) =
let commit = if latest: "HEAD" else: FusionStableCommit
cloneDependency(distDir, "https://github.com/nim-lang/fusion.git", commit,
allowBundled = true)
copyDir(distDir / "fusion" / "src" / "fusion", "lib" / "fusion")
- then
nim c compiler/nim
can useimport fusion/foo
- likewise with stdlib modules; it's just a question of avoiding cyclic dependencies as usual except now there are 2 base dirs.
koch importing fusion
- that's also possible if fusion is cloned before koch.nim is built, ie via a git submodule or in
build_all.sh
; see for example addwalkDirRecFilter
recursive glob with follow filter (has full implementation) RFCs#261 where kochdocs couldimport fusion/globs
note
instead of copyDir(distDir / "fusion" / "src" / "fusion", "lib" / "fusion")
, we should probably use the usual nimble logic which allows adding import dirs to nim's --path
, so that nimble develop
fusion works as intended (NIMBLE_DIR=customdir
can always be used during bootstrap to avoid user's environment messing up with bootstrap)
Metadata
Metadata
Assignees
Labels
No labels