Bug 412052 - On Windows, craft --package extragear/kdeconnect-kde fails to build NSIS package
Summary: On Windows, craft --package extragear/kdeconnect-kde fails to build NSIS package
Status: RESOLVED FIXED
Alias: None
Product: Craft
Classification: Developer tools
Component: Blueprints (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Hannah von Reth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-19 06:47 UTC by nyanpasu64
Modified: 2019-09-19 15:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nyanpasu64 2019-09-19 06:47:28 UTC
SUMMARY


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT

PS C:\CraftRoot> craft --package extragear/kdeconnect-kde
Craft               : C:\CraftRoot
Version             : master
ABI                 : windows-msvc2017_64-cl
Download directory  : C:\CraftRoot\download
======================================================================================================================================
*** Handling package: extragear/kdeconnect-kde, action: package ***
*** Action: package for extragear/kdeconnect-kde ***
Overriding C:\CraftRoot\build\extragear\kdeconnect-kde\archive\bin\data\info\dir
Overriding C:\CraftRoot\build\extragear\kdeconnect-kde\archive\bin\data\info\dir
executing command: C:\CraftRoot\dev-utils\bin\7za.exe a -r C:\CraftRoot\tmp\kdeconnect-kde-master-8a25eb6f-master-windows-msvc2017_64-cl-dbg.7z -bso2 -bsp1 C:\CraftRoot\build\extragear\kdeconnect-kde\archive-dbg\*
executing command: C:\CraftRoot\dev-utils\bin\7za.exe a -r C:\CraftRoot\tmp\kdeconnect-kde-master-8a25eb6f-master-windows-msvc2017_64-cl.7z -bso2 -bsp1 C:\CraftRoot\build\extragear\kdeconnect-kde\archive\*


*** Craft package succeeded: extragear/kdeconnect-kde after 4 minutes 23 seconds ***
Failed to configure C:\CraftRoot\craft\bin\Packager\Nsis\NullsoftInstaller.nsi: @{exename} is not in variables
169:                        !insertmacro SnoreShortcut "$SMPROGRAMS\KDE Connect.lnk" "$INSTDIR\bin\@{exename}.exe" "@{AppUserModelID}"
Traceback (most recent call last):
  File "C:\CraftRoot\craft\bin\craft.py", line 266, in <module>
    success = main()
  File "C:\CraftRoot\craft\bin\craft.py", line 254, in main
    if not CraftCommands.run(package, action, tempArgs):
  File "C:\CraftRoot\craft\bin\CraftCommands.py", line 288, in run
    if not handlePackage(info, action, directTargets=directTargets):
  File "C:\CraftRoot\craft\bin\CraftCommands.py", line 75, in handlePackage
    success = doExec(package, action)
  File "C:\CraftRoot\craft\bin\CraftCommands.py", line 41, in doExec
    ret = package.instance.runAction(action)
  File "C:\CraftRoot\craft\bin\Package\PackageBase.py", line 221, in runAction
    if not getattr(self, step)():
  File "C:\CraftRoot\etc\blueprints\locations\craft-blueprints-kde\extragear\kdeconnect-kde\kdeconnect-kde.py", line 74, in createPackage
    return TypePackager.createPackage(self)
  File "C:\CraftRoot\craft\bin\Packager\TypePackager.py", line 77, in createPackage
    return self.__packager.createPackage(self)
  File "C:\CraftRoot\craft\bin\Packager\NullsoftInstallerPackager.py", line 198, in createPackage
    if not self.generateNSISInstaller(defines):
  File "C:\CraftRoot\craft\bin\Packager\NullsoftInstallerPackager.py", line 174, in generateNSISInstaller
    if not utils.configureFile(self.scriptname, configuredScrip, defines):
  File "C:\CraftRoot\craft\bin\utils.py", line 804, in configureFile
    raise Exception(f"Failed to configure {inFile}: @{{{match}}} is not in variables\n"
Exception: Failed to configure C:\CraftRoot\craft\bin\Packager\Nsis\NullsoftInstaller.nsi: @{exename} is not in variables
169:                        !insertmacro SnoreShortcut "$SMPROGRAMS\KDE Connect.lnk" "$INSTDIR\bin\@{exename}.exe" "@{AppUserModelID}"


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: Windows 10 x64 version 1903
Comment 1 nyanpasu64 2019-09-19 06:50:36 UTC
Sorry, I pressed Enter before filling out the description.

SUMMARY


STEPS TO REPRODUCE
1. iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))
2. C:\CraftRoot\craft\craftenv.ps1
3. craft extragear/kdeconnect-kde
4. craft nsis
5. craft --package extragear/kdeconnect-kde

EXPECTED RESULT
NSIS package is created without error.

After posting this bug, I reran `craft --package extragear/kdeconnect-kde` a second time, which succeeded. Maybe this issue only occurs the first time you try building a package, and the build process is not idempotent. Maybe the error is random. (Unfortunately running craft --package takes over 4 minutes because 7z is slow to compress the data.)
Comment 2 nyanpasu64 2019-09-19 07:16:22 UTC
KDE Connect works when run from C:\CraftRoot\build\extragear\kdeconnect-kde\archive\bin.

C:\CraftRoot\tmp has kdeconnect-kde-master-8a25eb6f-master-windows-msvc2017_64-cl.7z and kdeconnect-kde-master-8a25eb6f-master-windows-msvc2017_64-cl-dbg.7z (only difference is -dbg).

I don't see any installers. Running craft --package extragear/kdeconnect-kde again produces the same error as the first time.
Comment 3 brute4s99 2019-09-19 15:32:53 UTC
thanks for reporting the bug, @jimbo1gaz ! The bug is resolved and you can pull the latest changes in 1craft-blueprints-kde` to get the patch.