Bug 389779

Summary: Craft fails are bootstrap, and then on 'craft craft'
Product: [Developer tools] Craft Reporter: Jarosław Staniek <staniek>
Component: CoreAssignee: Hannah von Reth <vonreth>
Status: RESOLVED NOT A BUG    
Severity: normal CC: kde-windows
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Attachments: Logs from craft -v nsis

Description Jarosław Staniek 2018-02-01 23:26:23 UTC
Issue 1. Bootstrap. Fresh install from recipe at https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows
On win7 64bit

Result: the script failed (wget crashed). Was not able to obtain logs (is there log file?)

Issue 2. Usability. Continued by hand: 
- the kdeenv.bat hangs
- kdeenv.ps1 executes and exists immediately.

The only way for users is to browse to kdeenv.ps1 in powershell and execute.

Issue 3. In the craft shell executed this and caused python 3.6 error. User should never see this kind of errors. Apparently the scraft scripts do not use exceptions well enough :)


PS D:\Craft> craft craft
Craft Root          : D:\Craft
Craft               : R:\
Version             : master
ABI                 : windows-msvc2015_64-cl
Svn directory       : D:\craft\download\svn
Git directory       : Q:\
Download directory  : D:\craft\download
===============================================================================================

*** Handling package: dev-util/git, action: all ***
*** Action: fetch for dev-util/git ***
*** Action: unpack for dev-util/git ***
expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "D:\Craft\craft-2017.12\bin\craft.py", line 443, in <module>
    success = main()
  File "D:\Craft\craft-2017.12\bin\craft.py", line 431, in main
    if not run(package, action, tempArgs, package.children.values()):
  File "D:\Craft\craft-2017.12\bin\craft.py", line 221, in run
    directTargets=directTargets):
  File "D:\Craft\craft-2017.12\bin\craft.py", line 115, in handlePackage
    success = success and doExec(package, "unpack", continueFlag)
  File "D:\Craft\craft-2017.12\bin\craft.py", line 95, in doExec
    ret = package.instance.execute(action)
  File "D:\Craft\craft-2017.12\bin\Package\PackageBase.py", line 177, in execute
    return self.runAction(command)
  File "D:\Craft\craft-2017.12\bin\Package\PackageBase.py", line 280, in runAction
    ok = getattr(self, functions[command])()
  File "D:\Craft\craft-2017.12\bin\Source\MultiSource.py", line 48, in unpack
    return self.source.unpack(self)
  File "D:\Craft\craft-2017.12\bin\Source\ArchiveSource.py", line 139, in unpack
    if not utils.unpackFile(CraftStandardDirs.downloadDir(), filename, self.workDir()):
  File "D:\Craft\craft-2017.12\bin\utils.py", line 179, in unpackFile
    return un7zip(os.path.join(downloaddir, filename), workdir, ext)
  File "D:\Craft\craft-2017.12\bin\utils.py", line 195, in un7zip
    if CraftCore.cache.checkCommandOutputFor(app, "-bs"):
  File "D:\Craft\craft-2017.12\bin\Utils\CraftCache.py", line 119, in checkCommandOutputFor
    _, output = self.getCommandOutput(app, helpCommand)
  File "D:\Craft\craft-2017.12\bin\Utils\CraftCache.py", line 102, in getCommandOutput
    app = self.findApplication(app)
  File "D:\Craft\craft-2017.12\bin\Utils\CraftCache.py", line 86, in findApplication
    appLocation = shutil.which(app, path=path)
  File "C:\Program Files\Python3\lib\shutil.py", line 1113, in which
    if os.path.dirname(cmd):
  File "C:\Program Files\Python3\lib\ntpath.py", line 242, in dirname
    return split(p)[0]
  File "C:\Program Files\Python3\lib\ntpath.py", line 204, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
Comment 1 Jarosław Staniek 2018-02-01 23:40:19 UTC
The Path issue is apparently missing 7z. But it is installed and Craft never asked for it. Is there setting for the path? Adding path to 7z to PATH won't help because then craft needs 7za. But the 7-ZIP installer for Windows does not offer it, user needs to download extra archive with 7za.exe. Would craft be able to download proper copy of z7?
Maybe it already does and I have not notice because process in bootstrap crashed.
Comment 2 Hannah von Reth 2018-02-02 07:27:31 UTC
Sounds like the download somehow failed an you ended in a undefined state of craft.
Can you please start fresh.
Comment 3 Hannah von Reth 2018-02-02 07:30:45 UTC
And for logs, Craft saves log files to %USERPROFILE%/.craft
Comment 4 Jarosław Staniek 2018-02-02 14:18:18 UTC
Created attachment 110307 [details]
Logs from craft -v nsis
Comment 5 Jarosław Staniek 2018-02-03 15:19:04 UTC
Reinstalling Craft helped.