From 24903fec4c7fe78d39dbfe808b8878845fa78888 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 27 Feb 2024 18:12:41 +0100 Subject: [PATCH] configure.{sh,fsx}: fix bad order of tool findings 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] ae9f2a6a8ab94b2734a15375cb8a3ca8b7c14964 [2] 0b23222b837b54623cb0c1a064781a3692cfe06a --- configure.sh | 2 +- scripts/configure.fsx | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/configure.sh b/configure.sh index 13f9bad8b..47ae0674a 100755 --- a/configure.sh +++ b/configure.sh @@ -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 "$@" diff --git a/scripts/configure.fsx b/scripts/configure.fsx index 36042e42a..8a9c78159 100644 --- a/scripts/configure.fsx +++ b/scripts/configure.fsx @@ -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" @@ -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") @@ -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 @@ -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 @@ -217,7 +218,7 @@ let configFileToBeWritten = let finalConfigFile = let nativeSegwitEnabled = - Misc.FsxOnlyArguments() + argsToThisFsxScript |> List.contains "--native-segwit" if nativeSegwitEnabled then configFileStageThree