Wireshark-dev: Re: [Wireshark-dev] Attempted to build NSIS installer for 2.6.3
From: John Dill <[email protected]>
Date: Tue, 2 Oct 2018 15:26:10 +0000
>From: Gerald Combs <[email protected]>
>Sent: Monday, October 1, 2018 3:30 PM
>To: Developer support list for Wireshark; John Dill
>Subject: Re: [Wireshark-dev] Attempted to build NSIS installer for 2.6.3
>On 10/1/18 10:57 AM, John Dill wrote:
>> I'm trying to build an installer for Wireshark 2.6.3 on Windows using NSIS and I'm getting the following when I run
>> msbuild /m /p:Configuration=RelWithDebInfo nsis_package.vcxproj
>> Here is the commands I used before hand:
>> set CYGWIN=nodosfilewarning
>The Windows build doesn't rely on shell scripts (or Cygwin for that matter) so this shouldn't be necessary.

As far as I understand it used to in the past, though it seems to have moved on from it.  I'm trying to update my local repo from
Wireshark 2.4.4 where my environment used to work fine to the current branch of 2.6.3.

>> set WIRESHARK_LIB_DIR=C:\Wireshark-win64-libs-2.6
>> set PLATFORM=win64
>> set QT5_BASE_DIR=C:\Qt\Qt5.8.0\5.8\msvc2015_64
>> cd wsbuild64
>> cmake -G "Visual Studio 14 2015 Win64" ..\wireshark-src
>> msbuild /m /p:Configuration=RelWithDebInfo /p:Platform=x64 Wireshark.sln (... ok ...)
>> msbuild /m /p:Configuration=RelWithDebInfo nsis_package_prep.vcxproj (... ok ...)
>> msbuild /m /p:Configuration=RelWithDebInfo nsis_package.vcxproj
>> ...
>>         Processing config: C:\Program Files (x86)\NSIS\nsisconf.nsh
>>         File: "C:\Users\DillJA\Desktop\wsbuild64\docbook\user-guide.chm" -> no files found.
>By default the Windows packages require user-guide.chm, which is an HTMLHelp file. The User's Guide itself is written in Asciidoctor >markup. Converting it to .chm requires Asciidoctor, xsltproc + DocBook XSL, and HTMLHelp Compiler.
>>         Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...]
>>               /oname=outfile one_file_only)
>>         Error in script "wireshark.nsi" on line 1173 -- aborting creation process
>> Then it errors out with Build FAILED.
>> I noticed that I can finish the NSIS installer script if I comment out the USER_GUIDE_DIR section, but I'm trying to install
>>the right packages and can't seem to get this error to go away without modifying the wireshark.nsi script.
>> I notice in the cmake that the build script can't find asciidoctor even though ruby is installed on Cygwin64, and if I do a
>>'gem list --local', I see 'asciidoctor ('.
>What does `asciidoctor --version` return? I'm not sure if `gem install` results in something that you can run as a command on >Windows, e.g. via a .bat wrapper or a command line shim. If it does, you need to make sure the resulting command is in your PATH.

asciidoctor after setup_x86_64.exe for installing cygwin64 returns a '-bash: asciidoctor: command not found' cause there is no
package to install asciidoctor at least from the Cygwin setup-x86_64.exe program.

>> I tried to look for the packages asciidoctor in setup_x86_64.exe for Cygwin and couldn't find asciidoctorj, xsltproc, and
>Those are all Chocolatey packages, not Cygwin. Asciidoctorj is a bundle containing JRuby, Asciidoctor, and associated utilities. You >shouldn't need it if you have a working plain-Ruby Asciidoctor. xsltproc is part of Cygwin's libxslt package. The closest corresponding >DocBook Cygwin package is docbook-xml45.

I know I selected docbook-xml45, but don't think I specifically picked up libxslt directly.  It may have been installed as a dependency.

The cmake script can find the following components

-- Found XSLTPROC: C:/cygwin64/bin/xsltproc.exe  
-- Found HTMLHelp: C:/Program Files (x86)/HTML Help Workshop/hhc.exe  

>> Can someone familiar with the Windows build offer some hints?  Do I need to switch from Cygwin to Chocolatey (which I
>>haven't tried yet)?
>I'd recommend Chocolatey. We've largely moved away from requiring Cygwin for Windows development and I'm not sure if anyone >has ever built the Asciidoctor documentation using Cygwin.

I'd have to get Chocolately approved by govt IT and not sure if or how long that would take.  Wouldn't be a problem if this was
for personal use.

I can use 'gem install asciidoctor' to create an asciidoctor and asciidoctor-safe that is placed in a local /bin directory in the user's
/home in Cygwin and when I run that '~/bin/asciidoctor --version' I get

Asciidoctor [https://asciidoctor.org]
Runtime Environment (ruby 2.3.6p384 (2017-12-14 revision 9808) [x86_64-cygwin])
(lc:UTF-8 fs:Windows-1252 in:UTF-8 ex:UTF-8)

I believe this requires ruby and rubygems packages to be selected in Cygwin's setup-x86_64.exe program.

With admin privileges, I can move this to C:\cygwin64\bin so I can run asciidoctor --version from a cygwin prompt, but when I
run the CMake command, build script still doesn't find it.  Curious since it finds

-- YACC executable: C:/cygwin64/bin/bison.exe

And asciidoctor is in the same folder.

Comparing FindYACC.cmake and FindAsciidoctor.cmake shows that YACC has ${CYGWIN_INSTALL_PATH}/bin in its lists of
Paths.  Not sure why the directories in the FindYACC and FindAsciidoctor cmake scripts have different orders.

By adding '${CYGWIN_INSTALL_PATH}/bin' to FindAsciidoctor.cmake, cmake now finds asciidoctor.

-- Found ASCIIDOCTOR: C:/cygwin64/bin/asciidoctor

However, at the end of the script, it says Configuring incomplete, errors occurred!

Trying to run visual diff between CMakeOutput.log and CMakeError.log before I added ${CYGWIN_INSTALL_PATH}/bin to
FindAsciidoctor.cmake to after to try to see what's up.  Lots of diffs due to generated filenames, hard to make out what the
issue is.

That's where I'm at right now.

John D.