Skip to contentSkip to conversation

Windows: update dobuild.cmd to run the configure/make

PATCH Applied Rebecca Cran 3 participants 6 messages Nov 3, 2020 – Nov 5, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Windows: update dobuild.cmd to run the configure/make

Add a new shell script, _domake.sh which runs under Cygwin. This is invoked via dobuild.cmd to run the configure and make steps of the build. In this way, a single command, run from a Developer Command Prompt, can be used to go from a clean workspace to a final installer binary.

---
 os/windows/_domake.sh  | 17 +++++++++++++++++
 os/windows/dobuild.cmd | 23 +++++++++++++----------
 2 files changed, 30 insertions(+), 10 deletions(-)
 create mode 100755 os/windows/_domake.sh
os/windows/_domake.sh new file +17 -0
new file mode 100755
index 00000000..05625ff4
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd "$2"
+cd ../..
+if [ -e "fio.exe" ]; then
+  make clean
+fi
+
+if [ "$1" = "x86" ]; then
+  ./configure --disable-native --build-32bit-win
+else
+  ./configure --disable-native
+fi
+
+make -j
os/windows/dobuild.cmd +13 -10
index 08df3e87..ea79dd03 100644
@@ -1,5 +1,18 @@
 @echo off
 setlocal enabledelayedexpansion
+
+if "%1"=="x86" set FIO_ARCH=x86
+if "%1"=="x64" set FIO_ARCH=x64
+
+if not defined FIO_ARCH (
+  echo Error: must specify the architecture.
+  echo Usage: dobuild x86
+  echo Usage: dobuild x64
+  goto end
+)
+
+C:\Cygwin64\bin\bash -l %cd%/_domake.sh %FIO_ARCH% %cd%
+
 set /a counter=1
 for /f "tokens=3" %%i in (..\..\FIO-VERSION-FILE) do (
  if "!counter!"=="1" set FIO_VERSION=%%i
@@ -16,16 +29,6 @@ if not defined FIO_VERSION_NUMBERS (
   goto end
 )
 
-if "%1"=="x86" set FIO_ARCH=x86
-if "%1"=="x64" set FIO_ARCH=x64
-
-if not defined FIO_ARCH (
-  echo Error: must specify the architecture.
-  echo Usage: dobuild x86
-  echo Usage: dobuild x64
-  goto end
-)
-
 if defined SIGN_FIO (
   signtool sign /n "%SIGNING_CN%" /t http://timestamp.digicert.com ..\..\fio.exe
   signtool sign /as /n "%SIGNING_CN%" /tr http://timestamp.digicert.com /td sha256 /fd sha256 ..\..\fio.exe
Signature · 1 line
2.29.2
Applied
#1 lore raw
Quoted 5 lines · Rebecca Cran

Add a new shell script, _domake.sh which runs under Cygwin. This is invoked via dobuild.cmd to run the configure and make steps of the build. In this way, a single command, run from a Developer Command Prompt, can be used to go from a clean workspace to a final installer binary.

Applied, thanks.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 9 lines · Jens Axboe
Quoted 5 lines · Rebecca Cran

Add a new shell script, _domake.sh which runs under Cygwin. This is invoked via dobuild.cmd to run the configure and make steps of the build. In this way, a single command, run from a Developer Command Prompt, can be used to go from a clean workspace to a final installer binary.

Applied, thanks.

Has this one broken CI -
https://ci.appveyor.com/project/axboe/fio/builds/36143673/job/4omj3bylpdxyhga5
?

Signature · 1 line
Sitsofe | http://sucs.org/~sits/
#4 lore raw
Quoted 8 lines · Rebecca Cran
Quoted 3 lines · Sitsofe Wheeler

Has this one broken CI -
https://ci.appveyor.com/project/axboe/fio/builds/36143673/job/4omj3bylpdxyhga5
?

It does seem like it. I'll look into it.

I think the main issue is that the CI was using dobuild.cmd to just do the packaging bits. Now it does (as its name originally suggested) and it actually does a build AND does packaging. CI really needs packaging to be seperate because it wants to control what's passed to configure. I wonder if this change could be reverted and:

The original script be renamed to dopkg.cmd while updating the CI scripts to call that and fixing up the documentation.
A new script called dobuildandpkg.cmd (or similar) be introduced that does the lot. Perhaps there should be some documentation updates for it too.

Thoughts?

--
Sitsofe | http://sucs.org/~sits/

#5 lore raw
Quoted 7 lines · Sitsofe Wheeler

The original script be renamed to dopkg.cmd while updating the CI scripts to call that and fixing up the documentation.
A new script called dobuildandpkg.cmd (or similar) be introduced that does the lot. Perhaps there should be some documentation updates for it too.

Thoughts?

That makes a lot of sense. dobuild.cmd was really only written for my use in building the installers, and as a result was poorly thought out.

I'll submit a patch to rename it and make improvements.

Signature · 1 line
Rebecca Cran