Skip to content

Commit

Permalink
scripts: deduplicate InfraLib in favour of fsx's
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
knocte committed Oct 27, 2022
1 parent a68957f commit 465b90a
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 2,170 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: configure
run: ./configure.sh
- name: build in DEBUG mode
Expand All @@ -24,13 +26,18 @@ jobs:
run: git clean -fdx && ./configure.sh && make strict
- name: build in RELEASE mode
run: git clean -fdx && ./configure.sh && make release
# 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"`)
#- name: compile .fsx scripts
# run: dotnet fsi ./scripts/fsx/compileFSharpScripts.fsx
- name: integration tests
run: make update-servers

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: configure
run: .\configure.bat
- name: build in DEBUG mode
Expand All @@ -43,13 +50,18 @@ jobs:
run: git clean -fdx && .\configure.bat && .\make.bat strict
- name: re-build in RELEASE mode
run: git clean -fdx && .\configure.bat && .\make.bat release
# 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"`)
#- name: compile .fsx scripts
# run: dotnet fsi ./scripts/fsx/compileFSharpScripts.fsx
- name: integration tests
run: .\make update-servers

linux22-github--xbuild:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: install missing dependencies
run: sudo apt install --yes fsharp nunit-console
- name: check mono version
Expand All @@ -73,6 +85,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: install missing dependencies
run: sudo apt install --yes fsharp nunit-console
- name: install last version of mono (Microsoft APT repositories)
Expand Down Expand Up @@ -127,6 +141,9 @@ jobs:
run: git clean -fdx && ./configure.sh && make strict
- name: build in RELEASE mode
run: git clean -fdx && ./configure.sh && make release
# 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"`)
#- name: compile .fsx scripts
# run: dotnet fsi ./scripts/fsx/compileFSharpScripts.fsx
- name: integration tests
run: make update-servers

Expand Down Expand Up @@ -173,6 +190,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: install missing dependencies
run: sudo apt install --yes fsharp nunit-console
- name: check mono version
Expand Down Expand Up @@ -296,7 +315,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
submodules: false
# needed because of commit-lint, see https://github.com/conventional-changelog/commitlint/issues/3376
fetch-depth: 0
- name: Install dependencies of commitlint
Expand Down
1 change: 0 additions & 1 deletion DevRoadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Our priority list is [the Kanban view of our issue/task list](https://gitlab.com/nblockchain/geewallet/boards).

Some other items that haven't been prioritized include (likely only intelligible if you're already a contributor):
- 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).
- 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 ).
- 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).
- Speed improvements:
Expand Down
24 changes: 12 additions & 12 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
set -euo pipefail

REPL_CHECK_MSG="checking for a working F# REPL..."

if [ ! -f scripts/fsx/configure.sh ]; then
if ! which git >/dev/null 2>&1; then
echo "checking for git... not found" $'\n'

echo "$0" $'failed, please install "git" (to populate submodule) first'
exit 1
fi
echo "Populating sub-fsx module..."
git submodule sync --recursive && git submodule update --init --recursive
fi

FSX_CHECK_MSG="checking for fsx..."

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

if [ ! -f scripts/fsx/configure.sh ]; then
if ! which git >/dev/null 2>&1; then
echo "checking for git... not found" $'\n'

echo "$0" $'failed, please install "git" (to populate submodule) or "fsx" first'
exit 1
fi
echo "Populating sub-fsx module..."
git submodule sync --recursive && git submodule update --init --recursive
fi

# fsharpi is broken in Ubuntu 19.04/19.10/20.04 ( https://github.com/fsharp/fsharp/issues/740 )
BIN_DIR="`pwd`/bin/fsx"
mkdir -p $BIN_DIR
Expand All @@ -50,5 +51,4 @@ else
fi

echo "FsxRunner=$RUNNER" > scripts/build.config

$RUNNER ./scripts/configure.fsx "$@"
2 changes: 2 additions & 0 deletions gwallet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{CE79AB9D
scripts\fsxHelper.fs = scripts\fsxHelper.fs
scripts\snap_release.fsx = scripts\snap_release.fsx
scripts\githubActions.fs = scripts\githubActions.fs
scripts\find.fsx = scripts\find.fsx
scripts\bump.fsx = scripts\bump.fsx
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C90A30F5-1423-44B2-A8D4-ED5FEDD4E36F}"
Expand Down
41 changes: 0 additions & 41 deletions scripts/InfraLib/AssemblyInfo.fs

This file was deleted.

164 changes: 0 additions & 164 deletions scripts/InfraLib/Git.fs

This file was deleted.

Loading

0 comments on commit 465b90a

Please sign in to comment.