Skip to content

Commit

Permalink
configure.{sh,fsx}: fix bad order of tool findings
Browse files Browse the repository at this point in the history
When porting stable's branch commit [1] to master branch [2] we
missed the fact that our configure.fsx script in the master
branch checks for `dotnet` executable before the OS match block
so the " found" string was not being printed first.

This fixes it with a flag so that if someone calls the .fsx file
by hand then the " found" string doesn't show up in that case.

[1] ae9f2a6
[2] 0b23222
  • Loading branch information
knocte committed Feb 27, 2024
1 parent 3114fc3 commit 24903fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ if [ ! -z "${RUNNER_ARG}" ]; then
echo -e "FsxRunnerArg=$RUNNER_ARG" >> scripts/build.config
fi
source scripts/build.config
DOTNET_NOLOGO=true $RUNNER_BIN $RUNNER_ARG ./scripts/configure.fsx "$@"
DOTNET_NOLOGO=true $RUNNER_BIN $RUNNER_ARG ./scripts/configure.fsx --from-configure "$@"
13 changes: 7 additions & 6 deletions scripts/configure.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

open System
open System.IO
open System.Linq

#if !LEGACY_FRAMEWORK
#r "nuget: Fsdk, Version=0.6.0--date20231031-0834.git-2737eea"
Expand All @@ -18,6 +19,10 @@ open Fsdk.Process
#load "fsxHelper.fs"
open GWallet.Scripting

let argsToThisFsxScript = Misc.FsxOnlyArguments()
if argsToThisFsxScript.Any(fun arg -> arg = "--from-configure") then
Console.WriteLine " found"

let rootDir = DirectoryInfo(Path.Combine(__SOURCE_DIRECTORY__, ".."))
let stableVersionOfMono = Version("6.6")

Expand All @@ -39,10 +44,6 @@ let buildTool, legacyBuildTool, areGtkLibsAbsentOrDoesNotApply =

dotnetCmd, msbuildCmd, true
| platform (* Unix *) ->

// because it comes from configure.sh's "Checking for a working F# REPL..."
Console.WriteLine " found"

Process.ConfigCommandCheck ["make"] true true |> ignore

match Process.ConfigCommandCheck ["mono"] false true with
Expand Down Expand Up @@ -158,7 +159,7 @@ if buildTool.IsNone && legacyBuildTool.IsNone then

Environment.Exit 1

let prefix = DirectoryInfo(Misc.GatherOrGetDefaultPrefix(Misc.FsxOnlyArguments(), false, None))
let prefix = DirectoryInfo(Misc.GatherOrGetDefaultPrefix(argsToThisFsxScript, false, None))

if not (prefix.Exists) then
let warning = sprintf "WARNING: prefix doesn't exist: %s" prefix.FullName
Expand Down Expand Up @@ -217,7 +218,7 @@ let configFileToBeWritten =

let finalConfigFile =
let nativeSegwitEnabled =
Misc.FsxOnlyArguments()
argsToThisFsxScript
|> List.contains "--native-segwit"
if nativeSegwitEnabled then
configFileStageThree
Expand Down

0 comments on commit 24903fe

Please sign in to comment.