From 9870dcdf60edc1305da5e0e9d23cf9ac9fbaa00e Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 3 Feb 2021 11:20:29 -0800 Subject: [PATCH 1/7] unbundle fusion --- .github/workflows/ci_docs.yml | 4 ---- .gitignore | 2 +- compiler/installer.ini | 1 - koch.nim | 10 ++-------- tools/kochdocs.nim | 2 +- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index fcc89dfc160e2..22d425b103c18 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -126,10 +126,6 @@ jobs: shell: bash run: ./koch boot -d:release - - name: 'Clone fusion' - shell: bash - run: ./koch fusion - - name: 'Build documentation' shell: bash run: ./koch doc --git.commit:devel diff --git a/.gitignore b/.gitignore index 5adaa5e884a2f..e71fdf352a176 100644 --- a/.gitignore +++ b/.gitignore @@ -66,7 +66,7 @@ testament.db /tests/**/*.js /csources /dist/ -/lib/fusion +# /lib/fusion # fusion is now unbundled; `git status` should reveal if it's there so users can act on it # Private directories and files (IDEs) .*/ diff --git a/compiler/installer.ini b/compiler/installer.ini index 2f11d0df91a99..fb5081117a70b 100644 --- a/compiler/installer.ini +++ b/compiler/installer.ini @@ -76,7 +76,6 @@ Files: "lib" [Other] Files: "examples" Files: "dist/nimble" -Files: "dist/fusion" Files: "tests" diff --git a/koch.nim b/koch.nim index 91e0fbdf0c5fe..651e2f26ce689 100644 --- a/koch.nim +++ b/koch.nim @@ -66,7 +66,7 @@ Possible Commands: e.g. nimble) doesn't require network connectivity nimble builds the Nimble tool - fusion clone fusion into the working tree + Boot options: -d:release produce a release version of the compiler -d:nimUseLinenoise use the linenoise library for interactive mode @@ -180,12 +180,6 @@ proc bundleWinTools(args: string) = nimCompile(r"tools\downloader.nim", options = r"--cc:vcc --app:gui -d:ssl --noNimblePath --path:..\ui " & args) -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") - proc zip(latest: bool; args: string) = bundleFusion(latest) bundleNimbleExe(latest, args) @@ -699,7 +693,7 @@ when isMainModule: of "valgrind": valgrind(op.cmdLineRest) of "c2nim": bundleC2nim(op.cmdLineRest) of "drnim": buildDrNim(op.cmdLineRest) - of "fusion": bundleFusion(latest) + of "fusion": doAssert false, "`./koch fusion` was deprecated, use `nimble install fusion` instead" else: showHelp() break of cmdEnd: break diff --git a/tools/kochdocs.nim b/tools/kochdocs.nim index 8ae0b6ed4882c..992725a2ec24f 100644 --- a/tools/kochdocs.nim +++ b/tools/kochdocs.nim @@ -190,7 +190,7 @@ lib/system/widestrs.nim proc follow(a: PathEntry): bool = result = a.path.lastPathPart notin ["nimcache", htmldocsDirname, "includes", "deprecated", "genode"] and - not a.path.isRelativeTo("lib/fusion") + not a.path.isRelativeTo("lib/fusion") # fusion was un-bundled but we need to keep this in case user has it installed for entry in walkDirRecFilter("lib", follow = follow): let a = entry.path if entry.kind != pcFile or a.splitFile.ext != ".nim" or From 9629cb4989e0edc48118bde14965a128f1b98e5b Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 3 Feb 2021 11:21:38 -0800 Subject: [PATCH 2/7] changelog --- changelog.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog.md b/changelog.md index 7fe5a4ffc26c3..3529441bee758 100644 --- a/changelog.md +++ b/changelog.md @@ -187,3 +187,6 @@ with other backends. see #9125. Use `-d:nimLegacyJsRound` for previous behavior. - cell alignment is not supported, i.e. alignment annotations in a delimiter row (`:---`, `:--:`, `---:`) are ignored, - every table row must start with `|`, e.g. `| cell 1 | cell 2 |`. + +- `fusion` is now un-bundled from nim, `./koch fusion` will result in an error. + `nimble install fusion` should be used instead. From cbe97040cca6cdf472abc335d9f5ae42e72c6d1a Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 3 Feb 2021 11:30:03 -0800 Subject: [PATCH 3/7] fixup --- koch.nim | 4 ---- 1 file changed, 4 deletions(-) diff --git a/koch.nim b/koch.nim index 651e2f26ce689..fa8e6cb369939 100644 --- a/koch.nim +++ b/koch.nim @@ -11,7 +11,6 @@ const NimbleStableCommit = "324de9202fb3db82b266e7350731d1ec41013a2b" # master - FusionStableCommit = "372ee4313827ef9f2ea388840f7d6b46c2b1b014" when not defined(windows): const @@ -181,7 +180,6 @@ proc bundleWinTools(args: string) = options = r"--cc:vcc --app:gui -d:ssl --noNimblePath --path:..\ui " & args) proc zip(latest: bool; args: string) = - bundleFusion(latest) bundleNimbleExe(latest, args) bundleNimsuggest(args) bundleNimpretty(args) @@ -221,7 +219,6 @@ proc buildTools(args: string = "") = options = "-d:release " & args) proc nsis(latest: bool; args: string) = - bundleFusion(latest) bundleNimbleExe(latest, args) bundleNimsuggest(args) bundleWinTools(args) @@ -688,7 +685,6 @@ when isMainModule: of "tools": buildTools(op.cmdLineRest) bundleNimbleExe(latest, op.cmdLineRest) - bundleFusion(latest) of "pushcsource", "pushcsources": pushCsources() of "valgrind": valgrind(op.cmdLineRest) of "c2nim": bundleC2nim(op.cmdLineRest) From 49d2b0911e53df129eba5c60636ae4517141fcf4 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 10 Feb 2021 12:55:07 -0800 Subject: [PATCH 4/7] address comment: `./koch fusion` calls nimble install fusion (at a fixed hash) --- .github/workflows/ci_docs.yml | 4 ++++ changelog.md | 4 ++-- koch.nim | 9 +++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 22d425b103c18..77e6a9fb7bd7f 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -126,6 +126,10 @@ jobs: shell: bash run: ./koch boot -d:release + - name: './koch fusion' + shell: bash + run: ./koch fusion + - name: 'Build documentation' shell: bash run: ./koch doc --git.commit:devel diff --git a/changelog.md b/changelog.md index 3529441bee758..51df5d226ca70 100644 --- a/changelog.md +++ b/changelog.md @@ -188,5 +188,5 @@ with other backends. see #9125. Use `-d:nimLegacyJsRound` for previous behavior. row (`:---`, `:--:`, `---:`) are ignored, - every table row must start with `|`, e.g. `| cell 1 | cell 2 |`. -- `fusion` is now un-bundled from nim, `./koch fusion` will result in an error. - `nimble install fusion` should be used instead. +- `fusion` is now un-bundled from nim, `./koch fusion` will + install it via nimble at a fixed hash. diff --git a/koch.nim b/koch.nim index fa8e6cb369939..ef4684cc49cec 100644 --- a/koch.nim +++ b/koch.nim @@ -11,7 +11,9 @@ const NimbleStableCommit = "324de9202fb3db82b266e7350731d1ec41013a2b" # master - + # examle of possible values: #head, #ea82b54, 1.2.3 + FusionStableCommitHash = "#372ee4313827ef9f2ea388840f7d6b46c2b1b014" + HeadHash = "#head" when not defined(windows): const Z3StableCommit = "65de3f748a6812eecd7db7c478d5fc54424d368b" # the version of Z3 that DrNim uses @@ -65,6 +67,7 @@ Possible Commands: e.g. nimble) doesn't require network connectivity nimble builds the Nimble tool + fusion installs fusion via Nimble Boot options: -d:release produce a release version of the compiler @@ -689,7 +692,9 @@ when isMainModule: of "valgrind": valgrind(op.cmdLineRest) of "c2nim": bundleC2nim(op.cmdLineRest) of "drnim": buildDrNim(op.cmdLineRest) - of "fusion": doAssert false, "`./koch fusion` was deprecated, use `nimble install fusion` instead" + of "fusion": + let suffix = if latest: HeadHash else: FusionStableCommitHash + exec("nimble install -y fusion@$#" % suffix) else: showHelp() break of cmdEnd: break From 8479aed583b31bd85abb81616b3b258340b83e7a Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 10 Feb 2021 12:59:47 -0800 Subject: [PATCH 5/7] fixup --- koch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koch.nim b/koch.nim index ef4684cc49cec..e9e345946b6dc 100644 --- a/koch.nim +++ b/koch.nim @@ -11,7 +11,7 @@ const NimbleStableCommit = "324de9202fb3db82b266e7350731d1ec41013a2b" # master - # examle of possible values: #head, #ea82b54, 1.2.3 + # examples of possible values: #head, #ea82b54, 1.2.3 FusionStableCommitHash = "#372ee4313827ef9f2ea388840f7d6b46c2b1b014" HeadHash = "#head" when not defined(windows): From 0ece318167b0623bdde47c27efc8b42263f8cc89 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 10 Feb 2021 13:00:48 -0800 Subject: [PATCH 6/7] fixup --- koch.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koch.nim b/koch.nim index e9e345946b6dc..5f5791b8650f5 100644 --- a/koch.nim +++ b/koch.nim @@ -12,7 +12,7 @@ const NimbleStableCommit = "324de9202fb3db82b266e7350731d1ec41013a2b" # master # examples of possible values: #head, #ea82b54, 1.2.3 - FusionStableCommitHash = "#372ee4313827ef9f2ea388840f7d6b46c2b1b014" + FusionStableHash = "#372ee4313827ef9f2ea388840f7d6b46c2b1b014" HeadHash = "#head" when not defined(windows): const @@ -693,7 +693,7 @@ when isMainModule: of "c2nim": bundleC2nim(op.cmdLineRest) of "drnim": buildDrNim(op.cmdLineRest) of "fusion": - let suffix = if latest: HeadHash else: FusionStableCommitHash + let suffix = if latest: HeadHash else: FusionStableHash exec("nimble install -y fusion@$#" % suffix) else: showHelp() break From 2cd16ee05281467ee84943a4c490802f2f5fb303 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 10 Feb 2021 13:38:57 -0800 Subject: [PATCH 7/7] fixup --- .github/workflows/ci_docs.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index 77e6a9fb7bd7f..22d425b103c18 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -126,10 +126,6 @@ jobs: shell: bash run: ./koch boot -d:release - - name: './koch fusion' - shell: bash - run: ./koch fusion - - name: 'Build documentation' shell: bash run: ./koch doc --git.commit:devel