Skip to content

Commit 5041676

Browse files
authored
Merge pull request #19 from OpenVoxProject/windows
Changes for OpenVox Windows builds
2 parents 0e12c8f + 5757e42 commit 5041676

33 files changed

+169
-92
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ acceptance/merged_options.rb
1515
acceptance/.beaker/*
1616
ext/smoke/*output.txt
1717
*~
18+
**/.DS_Store

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Unreleased
22

3+
* Added Windows x64 support. This should work on Windows Server 2016+ and Windows 10+.
4+
* Updated Boost to 1.82.0 for Windows only in order to fix a bug needed for buidling the Windows agent. https://github.com/boostorg/locale/commit/41868c62a0519799696b544518f1efd831ff71c2
35
* Fixed issue on Fedora 41 with dnf5. We were using deprecated yum flags -d and -e. Since we don't support anything older than EL7, in which these were already deprecated, they have been removed.
46

57
## 8.13.0

Rakefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
def run_command(cmd)
2-
output, status = Open3.capture2e(cmd)
3-
abort "Command failed! Command: #{cmd}, Output: #{output}" unless status.exitstatus.zero?
1+
require 'open3'
2+
3+
def run_command(cmd, silent = false)
4+
output = ''
5+
Open3.popen2e(cmd) do |_stdin, stdout_stderr, thread|
6+
stdout_stderr.each do |line|
7+
puts line unless silent
8+
output += line
9+
end
10+
exitcode = thread.value.exitstatus
11+
abort "Command failed!" unless exitcode.zero?
12+
end
413
output.chomp
514
end
615

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"location":"https://s3.osuosl.org/openvox-artifacts/puppet-runtime/202502261/","version":"202502261"}
1+
{"location":"https://s3.osuosl.org/openvox-artifacts/puppet-runtime/202503201/","version":"202503201"}

configs/components/puppet-runtime.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
# Elevate.exe is simply used when one of the run_facter.bat or
3232
# run_puppet.bat files are called. These set up the required environment
3333
# for the program, and elevate.exe gives the program the elevated
34-
# privileges it needs to run
34+
# privileges it needs to run.
35+
# Comes from https://github.com/jpassing/elevate
3536
pkg.add_source "file://resources/files/windows/elevate.exe.config", sum: "a5aecf3f7335fa1250a0f691d754d561"
36-
pkg.add_source "#{settings[:buildsources_url]}/windows/elevate/elevate.exe", sum: "bd81807a5c13da32dd2a7157f66fa55d"
37+
pkg.add_source "https://artifacts.overlookinfratech.com/components/elevate.exe", sum: "bd81807a5c13da32dd2a7157f66fa55d"
3738
pkg.install_file 'elevate.exe.config', "#{settings[:bindir]}/elevate.exe.config"
3839
pkg.install_file 'elevate.exe', "#{settings[:bindir]}/elevate.exe"
3940

configs/components/puppet.rb

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,8 @@
66

77
# Used to compile binary translation files
88
# i18n is not supported on Solaris
9-
if platform.is_macos?
10-
pkg.build_requires "gettext"
11-
elsif platform.is_windows?
12-
pkg.build_requires "pl-gettext-#{platform.architecture}"
13-
elsif platform.is_solaris? || platform.is_aix?
14-
# do nothing
15-
else #rubocop:disable Lint/DuplicateBranch
16-
pkg.build_requires "gettext"
17-
end
9+
pkg.build_requires "gettext" unless platform.is_solaris? || platform.is_aix?
10+
pkg.build_requires "gettext-devel" if platform.is_windows?
1811

1912
platform.get_service_types.each do |servicetype|
2013
case servicetype
@@ -90,7 +83,7 @@
9083
# We do not currently support i18n on Solaris or AIX
9184
unless platform.is_solaris? || platform.is_aix?
9285
if platform.is_windows?
93-
msgfmt = "/cygdrive/c/tools/pl-build-tools/bin/msgfmt.exe"
86+
msgfmt = "/usr/bin/msgfmt.exe"
9487
elsif platform.is_macos?
9588
msgfmt = "/usr/local/opt/gettext/bin/msgfmt"
9689
if platform.architecture == 'arm64' && platform.os_version.to_i >= 13
@@ -121,7 +114,7 @@
121114
end
122115

123116
if platform.is_windows?
124-
pkg.environment "PATH", "$(shell cygpath -u #{settings[:gcc_bindir]}):$(shell cygpath -u #{settings[:ruby_bindir]}):$(shell cygpath -u #{settings[:bindir]}):/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0"
117+
pkg.environment "PATH", "/usr/bin:$(shell cygpath -u #{settings[:gcc_bindir]}):$(shell cygpath -u #{settings[:ruby_bindir]}):$(shell cygpath -u #{settings[:bindir]}):/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0"
125118
end
126119

127120
if platform.is_windows?
@@ -201,7 +194,7 @@
201194

202195
pkg.install_file "ext/windows/service/daemon.bat", "#{settings[:bindir]}/daemon.bat"
203196
pkg.install_file "ext/windows/service/daemon.rb", "#{settings[:service_dir]}/daemon.rb"
204-
pkg.install_file "../wix/icon/puppet.ico", "#{settings[:miscdir]}/puppet.ico"
197+
pkg.install_file "../wix/icon/voxpupuli.ico", "#{settings[:miscdir]}/voxpupuli.ico"
205198
pkg.install_file "../wix/license/LICENSE.rtf", "#{settings[:miscdir]}/LICENSE.rtf"
206199
pkg.directory settings[:service_dir]
207200
end
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
platform "windows-2019-x64" do |plat|
2+
plat.vmpooler_template "win-2019-x86_64"
3+
plat.servicetype 'windows'
4+
5+
# You must install Wix Toolset 3.14.1 manually before beginning the build.
6+
# https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe
7+
#
8+
# Install ruby, ruby-devel, gcc-core, make, git, and libyaml-devel in Cygwin on the Windows image.
9+
# Run setup.bat found in the root of this repo. These are needed in order to successfully
10+
# do a bundle install. They are included here just in case they get removed somehow.
11+
# Make sure "setup-x86_64.exe" (Cygwin's installer) is at the root of C:/
12+
packages = [
13+
'autoconf',
14+
'cmake',
15+
'gcc-core',
16+
'gcc-g++',
17+
'gettext',
18+
'gettext-devel',
19+
'git',
20+
'libyaml-devel',
21+
'make',
22+
'mingw64-x86_64-gcc-core',
23+
'mingw64-x86_64-gcc-g++',
24+
'mingw64-x86_64-gdbm',
25+
'mingw64-x86_64-libffi',
26+
'mingw64-x86_64-readline',
27+
'mingw64-x86_64-zlib',
28+
'ruby',
29+
'ruby-devel',
30+
'patch',
31+
]
32+
33+
plat.provision_with("C:/setup-x86_64.exe -q -P #{packages.join(',')}")
34+
plat.install_build_dependencies_with "C:/setup-x86_64.exe -q -P"
35+
36+
plat.make "/usr/bin/make"
37+
plat.patch "TMP=/var/tmp /usr/bin/patch.exe --binary"
38+
39+
plat.platform_triple "x86_64-w64-mingw32"
40+
41+
# Putting these here as a reminder where we use them elsewhere. DO NOT
42+
# use the full path, just the name of the executable without the extension.
43+
# Otherwise, autoconf gets confused.
44+
plat.environment 'CC', "x86_64-w64-mingw32-gcc"
45+
plat.environment 'CXX', "x86_64-w64-mingw32-g++"
46+
47+
plat.package_type "msi"
48+
plat.output_dir "windows"
49+
end

configs/projects/openvox-agent.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,18 @@
112112
# Provides augeas, curl, libedit, libxml2, libxslt, openssl, puppet-ca-bundle, ruby and rubygem-*
113113
proj.component "puppet-runtime"
114114
proj.component 'openssl-fips' if platform.is_fips?
115-
proj.component "pxp-agent" if ENV['NO_PXP_AGENT'].to_s.empty?
115+
116+
# We are currently not building pxp-agent for Windows because it is unused for
117+
# OpenVox aside from execution_wrapper which is soon to be replaced, and because
118+
# we're having trouble getting things compiled correctly with the modern toolchain.
119+
# For a Windows, only build these if BUILD_WINDOWS_PXP_AGENT is set.
120+
# For other platforms, build these unless NO_PXP_AGENT is set.
121+
build_pxp_agent = platform.is_windows? ? !ENV['BUILD_WINDOWS_PXP_AGENT'].to_s.empty? : ENV['NO_PXP_AGENT'].to_s.empty?
122+
if build_pxp_agent
123+
proj.component "pxp-agent"
124+
else
125+
proj.setting(:exclude_wix_templates, ['service.pxp-agent.wxs.erb'])
126+
end
116127

117128
proj.component "puppet"
118129
proj.component "facter"

resources/windows/wix/appdatafiles.wxs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version='1.0' encoding='windows-1252'?>
22
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
33
<!--
4-
Puppet Agent Specific Application data
4+
OpenVox Agent Specific Application data
55
These directories and files need to be special cased
6-
in order to manage the application data for puppet
6+
in order to manage the application data for the OpenVox
77
agent. The specific special case is that all files
88
and folders here need to be persistent across multiple
99
installs and uninstalls. We can do so by specifying
@@ -13,7 +13,7 @@
1313

1414
<DirectoryRef Id="TARGETDIR">
1515
<Directory Id="CommonAppDataFolder" Name="CommonAppData">
16-
<Directory Id="APPDATADIR" Name="PuppetLabs">
16+
<Directory Id="APPDATADIR" Name="VoxPupuli">
1717
<Directory Id="pxpAgentDataFolder" Name="pxp-agent">
1818
<Directory Id="pxpAgentDataFolderVar" Name="var">
1919
<Directory Id="pxpAgentDataFolderLog" Name="log" />
@@ -47,7 +47,7 @@
4747
</DirectoryRef>
4848
<ComponentGroup Id="AppDataComponentGroup" >
4949
<Component
50-
Id="PuppetLabsDataDir"
50+
Id="VoxPupuliDataDir"
5151
Guid="EA55AEDB-3A9E-454E-9389-828341BEB4FC"
5252
Permanent="yes"
5353
Directory="APPDATADIR" >
@@ -250,7 +250,7 @@
250250
<File
251251
Id="HieraConf"
252252
KeyPath="yes"
253-
Source="SourceDir\CommonAppDataFolder\Puppetlabs\puppet\etc\hiera.yaml" />
253+
Source="SourceDir\CommonAppDataFolder\VoxPupuli\puppet\etc\hiera.yaml" />
254254
<Condition>NOT PUP_PREEXISTING_CODE_HIERA AND NOT PUP_PREEXISTING_CONF_HIERA</Condition>
255255
</Component>
256256
<Component
@@ -263,7 +263,7 @@
263263
<File
264264
Id="HieraProductionConf"
265265
KeyPath="yes"
266-
Source="SourceDir\CommonAppDataFolder\Puppetlabs\code\environments\production\hiera.yaml" />
266+
Source="SourceDir\CommonAppDataFolder\VoxPupuli\code\environments\production\hiera.yaml" />
267267
<Condition>NOT PUP_PREEXISTING_CODE_HIERA AND NOT PUP_PREEXISTING_CONF_HIERA</Condition>
268268
</Component>
269269
<Component
@@ -339,7 +339,7 @@
339339
<File
340340
Id="EnvironmentConf"
341341
KeyPath="yes"
342-
Source="SourceDir\CommonAppDataFolder\PuppetLabs\code\environments\production\environment.conf" />
342+
Source="SourceDir\CommonAppDataFolder\VoxPupuli\code\environments\production\environment.conf" />
343343
</Component>
344344
<Component
345345
Id="ManifestsDir"

resources/windows/wix/componentgroup.wxs.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="windows-1252"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
33

4-
<!-- Puppet Agent Specific Component Group File -->
4+
<!-- OpenVox Agent Specific Component Group File -->
55

66
<Fragment>
77
<ComponentGroup Id="MainComponentGroup">

0 commit comments

Comments
 (0)