This is an automated email from the ASF dual-hosted git repository.
slawrence pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git
The following commit(s) were added to refs/heads/master by this push:
new be09999 Tweaks to release candidate script, mainly to fix building
Windows MSI installer
be09999 is described below
commit be0999901e5510aa4171e387a1ae170af047ce7b
Author: Steve Lawrence <[email protected]>
AuthorDate: Wed Oct 28 09:01:17 2020 -0400
Tweaks to release candidate script, mainly to fix building Windows MSI
installer
- Commit 5061ed004f updated the SBT native packager plugin we use to
build artifacts like the RPM and MSI installers. That plugin update
changed where it looks for the candle.exe and light.exe executables
used to build the MSI, so we need to change how we modify WiX so that
it runs with wine.
- Removes the installation of .NET 4.5. It is unclear why that was
originally needed, but it now causes the MSI build to fail with it
installed. Perhaps building the container now installs an updated
version of wine that comes with a working .NET version
- Fixes a typo when displaying a git clone command in the release
candidate script
- Adds sbt-native-packager "maintainer" option globally rather than just
for RPM and Windows to remove "missing maintainer" warning when
building zip/tar
- Modifies release candidate script to display available signing keys
for ease of use. Required moving the gpg timeout change to earlier in
the script
DAFFODIL-2428
---
containers/release-candidate/Dockerfile | 8 +++--
.../release-candidate/daffodil-release-candidate | 34 +++++++++++++++-------
containers/release-candidate/setup-container.sh | 1 -
containers/release-candidate/wix_wine.sh | 34 +++++++++++++---------
daffodil-cli/build.sbt | 9 ++----
5 files changed, 52 insertions(+), 34 deletions(-)
diff --git a/containers/release-candidate/Dockerfile
b/containers/release-candidate/Dockerfile
index 7114fe1..352b09c 100644
--- a/containers/release-candidate/Dockerfile
+++ b/containers/release-candidate/Dockerfile
@@ -22,8 +22,12 @@ WORKDIR /root
COPY setup-container.sh /root/
RUN /root/setup-container.sh
-COPY wix_wine.sh /root/wix311/\\bin\\candle.exe
-COPY wix_wine.sh /root/wix311/\\bin\\light.exe
+# Needed to get WiX to run in wine on Linux. See wix_wine.sh for more details
+# on why we need to do this and how it works
+RUN mv /root/wix311/{candle.exe,real-candle.exe}
+RUN mv /root/wix311/{light.exe,real-light.exe}
+COPY wix_wine.sh /root/wix311/candle.exe
+COPY wix_wine.sh /root/wix311/light.exe
COPY daffodil-release-candidate /root/
diff --git a/containers/release-candidate/daffodil-release-candidate
b/containers/release-candidate/daffodil-release-candidate
index 8ab7409..3851d73 100755
--- a/containers/release-candidate/daffodil-release-candidate
+++ b/containers/release-candidate/daffodil-release-candidate
@@ -50,8 +50,30 @@ do
esac
done
+gpg-agent --daemon --default-cache-ttl 3000 --max-cache-ttl 3000
+if [ $? -ne 0 ]; then
+ echo -e "\n!!! Unable to change timeout of the gpg-agent !!!\n"
+ echo -e "\n!!! Try updating it manually at ~/.gnupg/gpg-agent.conf for 3000
seconds each !!!\n"
+ exit
+fi
+
+export GPG_TTY=$(tty)
+export WIX=/root/wix311/
+
read -p "Pre Release label (e.g. rc1): " PRE_RELEASE
+
+echo
+echo "Available Signing Key IDs:"
+SHORT_SEC_KEY_IDS=`gpg --list-secret-keys --with-colons | grep '^sec' | cut
-d: -f 5`
+for SHORT_SEC_KEY_ID in $SHORT_SEC_KEY_IDS
+do
+ LONG_SEC_KEY_ID=`gpg --list-secret-keys --with-colons $SHORT_SEC_KEY_ID |
grep -m 1 '^fpr' | cut -d: -f10`
+ SEC_KEY_UID=`gpg --list-secret-keys --with-colons $LONG_SEC_KEY_ID | grep
'^uid' | cut -d: -f10`
+ echo " $LONG_SEC_KEY_ID [$SEC_KEY_UID]"
+done
+echo
+
read -p "Signing Key ID (long format): " PGP_SIGNING_KEY_ID
read -p "Git Commit Name: " GIT_COMMIT_NAME
read -p "Git Commit Email: " GIT_COMMIT_EMAIL
@@ -61,16 +83,6 @@ read -s -p "Apache Password: " APACHE_PASSWD
echo
echo
-gpg-agent --daemon --default-cache-ttl 3000 --max-cache-ttl 3000
-if [ $? -ne 0 ]; then
- echo -e "\n!!! Unable to change timeout of the gpg-agent !!!\n"
- echo -e "\n!!! Try updating it manually at ~/.gnupg/gpg-agent.conf for 3000
seconds each !!!\n"
- exit
-fi
-
-export GPG_TTY=$(tty)
-export WIX=/root/wix311/
-
echo "test" | gpg --default-key $PGP_SIGNING_KEY_ID --detach-sign --armor
--output /dev/null
if [ $? -ne 0 ]; then
echo -e "\n!!! Unable to sign data with given key: $PGP_SIGNING_KEY !!!\n"
@@ -111,7 +123,7 @@ DAFFODIL_DIST="incubator-daffodil-dist"
echo "Cloning repos..."
echo
-echo git clone ssh://[email protected]/apache/$DAFODIL_REPO.git
+echo git clone ssh://[email protected]/apache/$DAFFODIL_REPO.git
git clone ssh://[email protected]/apache/$DAFFODIL_REPO.git
echo
echo git clone ssh://[email protected]/apache/$DAFFODIL_SITE_REPO.git
diff --git a/containers/release-candidate/setup-container.sh
b/containers/release-candidate/setup-container.sh
index 7b747be..6ca228b 100755
--- a/containers/release-candidate/setup-container.sh
+++ b/containers/release-candidate/setup-container.sh
@@ -24,7 +24,6 @@ rm ~/*
#install dependencies
curl https://bintray.com/sbt/rpm/rpm -o /etc/yum.repos.d/bintray-sbt-rpm.repo
microdnf install git svn sbt java-1.8.0-devel wine winetricks unzip rpm-build
rpm-sign vim-minimal
-winetricks --unattended dotnet45
# install wix
curl -L
https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311-binaries.zip
-o wix311-binaries.zip
diff --git a/containers/release-candidate/wix_wine.sh
b/containers/release-candidate/wix_wine.sh
index 0ede650..bab20f1 100755
--- a/containers/release-candidate/wix_wine.sh
+++ b/containers/release-candidate/wix_wine.sh
@@ -27,17 +27,25 @@
# failed.
export WINEDEBUG=-all
-# If the WiX environment is setup correctly, the sbt native-packager will
-# execute a symlink to this script, and the $0 variable should look something
-# like "path/to/wix_directory/\\bin\\candle.exe". The following will extract
-# evertyhing after the last backslash, returning either "candle.exe" or
-# "light.exe" depending on what the plugin executes.
-CMD=${0##*\\}
-
-# The paths passed into this script by the plugin are all absolute Linux style
-# paths. For arguments that look like a path (i.e. starts with a /), use
-# winepath to convert them to a Windows style path that wine applications can
-# understand. Leave all other arguments unmodified.
+# The sbt native-packager plugin executes the $WIX/{candle,light}.exe
+# executables to build the Daffodil MSI. The problem is that those are Windows
+# executables and so can't be directly executed in the Linux container. To get
+# around this, the container Dockerfile copies the $WIX/{candle,light}.exe
+# files to $WIX/real-{candle,light}.exe and installs this script to
+# $WIX/{candle,light}.exe. This way, when the sbt plugin executes
+# $WIX/{candle,light}.exe, it's actually executing this script, which figures
+# out how it was executed (either as candle.exe or light.exe) and redirects the
+# execution to the real-{candle,light}.exe file using wine.
+
+
+# Figure out what was originally executed, and prepend "real-" to it. This is
+# what to execute with wine
+REAL_CMD=real-$(basename "$0")
+
+# The paths passed as arguments to this script by the plugin are all absolute
+# Linux style paths. For arguments that look like a path (i.e. starts with a
+# forward slash), use winepath to convert them to a Windows style path that
+# wine applications can understand. Leave all other arguments unmodified.
i=0
NEWARGS=()
for VAR in "$@"
@@ -55,5 +63,5 @@ done
# debugging when something goes wrong with wine
set -x
-# Execute wine with the right WiX command and modified arguments
-wine $WIX/$CMD "${NEWARGS[@]}"
+# Execute wine with the real WiX command and modified arguments
+wine $WIX/$REAL_CMD "${NEWARGS[@]}"
diff --git a/daffodil-cli/build.sbt b/daffodil-cli/build.sbt
index 6072ab4..b906df4 100644
--- a/daffodil-cli/build.sbt
+++ b/daffodil-cli/build.sbt
@@ -42,13 +42,13 @@ mappings in Universal ++= Seq(
baseDirectory.value / "README.md" -> "README.md",
)
+maintainer := "Apache Daffodil <[email protected]>"
+
//
// RPM configuration
//
rpmVendor := "Apache Daffodil"
-maintainer in Rpm := "Apache Daffodil <[email protected]>"
-
packageArchitecture in Rpm := "noarch"
packageSummary in Rpm := "Open source implementation of the Data Format
Description Language (DFDL)"
@@ -111,11 +111,6 @@ rpmPrefix := Some(defaultLinuxInstallLocation.value)
// want to install into.
name in Windows := "Daffodil"
-// The Windows packager SBT plug-in maps the maintainer variable into
-// the WiX ManufacturerFullName field which is displayed in the properties
-// dialog box for the executable.
-maintainer in Windows := "Apache Daffodil Developers
<[email protected]>"
-
// The Windows packager SBT plug-in maps the packageSummary variable
// into the WiX productName field. Another strange choice.
packageSummary in Windows := "Daffodil"