Skip to content

Commit 465b90a

Browse files
committed
scripts: deduplicate InfraLib in favour of fsx's
The InfraLib/ folder inside scripts was just an old version of fsx's InfraLib, and given that a) we just fixed an important hang in the latter; b) we already had a submodule for it; then we're switching to just use the submodule directly. This has two consequences: 1) The submodule has to always be populated, so we changed the configure script to always do it. 2) InfraLib's Process API has been overhauled so there's a lot of changes related to that in this commit.
1 parent a68957f commit 465b90a

21 files changed

+147
-2170
lines changed

.github/workflows/CI.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: macOS-latest
1313
steps:
1414
- uses: actions/checkout@v1
15+
with:
16+
submodules: false
1517
- name: configure
1618
run: ./configure.sh
1719
- name: build in DEBUG mode
@@ -24,13 +26,18 @@ jobs:
2426
run: git clean -fdx && ./configure.sh && make strict
2527
- name: build in RELEASE mode
2628
run: git clean -fdx && ./configure.sh && make release
29+
# TODO: use fsx's scripts compilation when we migrate to .NET6 (to use `#r "nuget: Microsoft.Build"` instead of `#r "../.nuget/packages/Microsoft.Build.16.11.0/lib/net472/Microsoft.Build.dll"`)
30+
#- name: compile .fsx scripts
31+
# run: dotnet fsi ./scripts/fsx/compileFSharpScripts.fsx
2732
- name: integration tests
2833
run: make update-servers
2934

3035
windows:
3136
runs-on: windows-latest
3237
steps:
3338
- uses: actions/checkout@v1
39+
with:
40+
submodules: false
3441
- name: configure
3542
run: .\configure.bat
3643
- name: build in DEBUG mode
@@ -43,13 +50,18 @@ jobs:
4350
run: git clean -fdx && .\configure.bat && .\make.bat strict
4451
- name: re-build in RELEASE mode
4552
run: git clean -fdx && .\configure.bat && .\make.bat release
53+
# TODO: use fsx's scripts compilation when we migrate to .NET6 (to use `#r "nuget: Microsoft.Build"` instead of `#r "../.nuget/packages/Microsoft.Build.16.11.0/lib/net472/Microsoft.Build.dll"`)
54+
#- name: compile .fsx scripts
55+
# run: dotnet fsi ./scripts/fsx/compileFSharpScripts.fsx
4656
- name: integration tests
4757
run: .\make update-servers
4858

4959
linux22-github--xbuild:
5060
runs-on: ubuntu-22.04
5161
steps:
5262
- uses: actions/checkout@v1
63+
with:
64+
submodules: false
5365
- name: install missing dependencies
5466
run: sudo apt install --yes fsharp nunit-console
5567
- name: check mono version
@@ -73,6 +85,8 @@ jobs:
7385
runs-on: ubuntu-22.04
7486
steps:
7587
- uses: actions/checkout@v1
88+
with:
89+
submodules: false
7690
- name: install missing dependencies
7791
run: sudo apt install --yes fsharp nunit-console
7892
- name: install last version of mono (Microsoft APT repositories)
@@ -127,6 +141,9 @@ jobs:
127141
run: git clean -fdx && ./configure.sh && make strict
128142
- name: build in RELEASE mode
129143
run: git clean -fdx && ./configure.sh && make release
144+
# TODO: use fsx's scripts compilation when we migrate to .NET6 (to use `#r "nuget: Microsoft.Build"` instead of `#r "../.nuget/packages/Microsoft.Build.16.11.0/lib/net472/Microsoft.Build.dll"`)
145+
#- name: compile .fsx scripts
146+
# run: dotnet fsi ./scripts/fsx/compileFSharpScripts.fsx
130147
- name: integration tests
131148
run: make update-servers
132149

@@ -173,6 +190,8 @@ jobs:
173190
runs-on: ubuntu-20.04
174191
steps:
175192
- uses: actions/checkout@v1
193+
with:
194+
submodules: false
176195
- name: install missing dependencies
177196
run: sudo apt install --yes fsharp nunit-console
178197
- name: check mono version
@@ -296,7 +315,7 @@ jobs:
296315
steps:
297316
- uses: actions/checkout@v2
298317
with:
299-
submodules: recursive
318+
submodules: false
300319
# needed because of commit-lint, see https://github.com/conventional-changelog/commitlint/issues/3376
301320
fetch-depth: 0
302321
- name: Install dependencies of commitlint

DevRoadmap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Our priority list is [the Kanban view of our issue/task list](https://gitlab.com/nblockchain/geewallet/boards).
44

55
Some other items that haven't been prioritized include (likely only intelligible if you're already a contributor):
6-
- Switch to use https://github.com/madelson/MedallionShell in Infra.fs (we might want to use paket instead of nuget for this, as it's friendlier to .fsx scripts, see https://cockneycoder.wordpress.com/2017/08/07/getting-started-with-paket-part-1/, or wait for https://github.com/Microsoft/visualfsharp/pull/5850).
76
- Study the need for ConfigureAwait(false) in the backend (or similar & easier approaches such as https://blogs.msdn.microsoft.com/benwilli/2017/02/09/an-alternative-to-configureawaitfalse-everywhere/ or https://github.com/Fody/ConfigureAwait ).
87
- Develop a `Maybe<'T>` type that wraps `ValueOption<'T>` type (https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/value-options) (faster to type this way) but doesn't expose the `Value` property (for safety).
98
- Speed improvements:

configure.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
set -euo pipefail
33

44
REPL_CHECK_MSG="checking for a working F# REPL..."
5+
6+
if [ ! -f scripts/fsx/configure.sh ]; then
7+
if ! which git >/dev/null 2>&1; then
8+
echo "checking for git... not found" $'\n'
9+
10+
echo "$0" $'failed, please install "git" (to populate submodule) first'
11+
exit 1
12+
fi
13+
echo "Populating sub-fsx module..."
14+
git submodule sync --recursive && git submodule update --init --recursive
15+
fi
16+
517
FSX_CHECK_MSG="checking for fsx..."
618

719
if ! which fsharpi >/dev/null 2>&1; then
@@ -23,17 +35,6 @@ else
2335
if ! which fsx >/dev/null 2>&1; then
2436
echo "$FSX_CHECK_MSG" $'not found'
2537

26-
if [ ! -f scripts/fsx/configure.sh ]; then
27-
if ! which git >/dev/null 2>&1; then
28-
echo "checking for git... not found" $'\n'
29-
30-
echo "$0" $'failed, please install "git" (to populate submodule) or "fsx" first'
31-
exit 1
32-
fi
33-
echo "Populating sub-fsx module..."
34-
git submodule sync --recursive && git submodule update --init --recursive
35-
fi
36-
3738
# fsharpi is broken in Ubuntu 19.04/19.10/20.04 ( https://github.com/fsharp/fsharp/issues/740 )
3839
BIN_DIR="`pwd`/bin/fsx"
3940
mkdir -p $BIN_DIR
@@ -50,5 +51,4 @@ else
5051
fi
5152

5253
echo "FsxRunner=$RUNNER" > scripts/build.config
53-
5454
$RUNNER ./scripts/configure.fsx "$@"

gwallet.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE79AB9D
2020
scripts\fsxHelper.fs = scripts\fsxHelper.fs
2121
scripts\snap_release.fsx = scripts\snap_release.fsx
2222
scripts\githubActions.fs = scripts\githubActions.fs
23+
scripts\find.fsx = scripts\find.fsx
24+
scripts\bump.fsx = scripts\bump.fsx
2325
EndProjectSection
2426
EndProject
2527
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C90A30F5-1423-44B2-A8D4-ED5FEDD4E36F}"

scripts/InfraLib/AssemblyInfo.fs

Lines changed: 0 additions & 41 deletions
This file was deleted.

scripts/InfraLib/Git.fs

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)