ncssar / radiolog

SAR radio log program
Other
13 stars 3 forks source link

build Windows installer failing due to missing LICENSE.txt #695

Closed caver456 closed 7 months ago

caver456 commented 7 months ago

This is not a bug with the code. This is a bug in the github build process, but it's possible a change to file(s) in the repo could be needed.

Recent release builds (thru github actions) are failing to create the Windows installer:

...
...
2023-11-11T05:28:50.6096630Z ##[group]Run iscc.exe radiolog.iss
2023-11-11T05:28:50.6097031Z iscc.exe radiolog.iss
2023-11-11T05:28:50.6130704Z shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
2023-11-11T05:28:50.6131132Z env:
2023-11-11T05:28:50.6131319Z   version: 3.10.1
2023-11-11T05:28:50.6131658Z   pythonLocation: C:\hostedtoolcache\windows\Python\3.10.11\x64
2023-11-11T05:28:50.6132228Z   PKG_CONFIG_PATH: C:\hostedtoolcache\windows\Python\3.10.11\x64/lib/pkgconfig
2023-11-11T05:28:50.6133037Z   Python_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.11\x64
2023-11-11T05:28:50.6133540Z   Python2_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.11\x64
2023-11-11T05:28:50.6134064Z   Python3_ROOT_DIR: C:\hostedtoolcache\windows\Python\3.10.11\x64
2023-11-11T05:28:50.6134450Z ##[endgroup]
2023-11-11T05:28:52.8008827Z Inno Setup 6 Command-Line Compiler
2023-11-11T05:28:52.8009862Z Copyright (C) 1997-2023 Jordan Russell. All rights reserved.
2023-11-11T05:28:52.8010894Z Portions Copyright (C) 2000-2023 Martijn Laan. All rights reserved.
2023-11-11T05:28:52.8011744Z Portions Copyright (C) 2001-2004 Alex Yackimoff. All rights reserved.
2023-11-11T05:28:52.8012536Z https://www.innosetup.com
2023-11-11T05:28:52.8012733Z 
2023-11-11T05:28:52.8012860Z Compiler engine version: Inno Setup 6.2.2
2023-11-11T05:28:52.8013110Z 
2023-11-11T05:28:53.2214412Z Preprocessing
2023-11-11T05:28:53.2215018Z    Reading file: c:\program files (x86)\inno setup 6\ISPPBuiltins.iss
2023-11-11T05:28:53.2795440Z Parsing [Setup] section, line 14
2023-11-11T05:28:53.2796014Z Parsing [Setup] section, line 15
2023-11-11T05:28:53.2796478Z Parsing [Setup] section, line 16
2023-11-11T05:28:53.2796861Z Parsing [Setup] section, line 18
2023-11-11T05:28:53.2797169Z Parsing [Setup] section, line 19
2023-11-11T05:28:53.2797786Z Parsing [Setup] section, line 20
2023-11-11T05:28:53.2798270Z Parsing [Setup] section, line 21
2023-11-11T05:28:53.2798735Z Parsing [Setup] section, line 22
2023-11-11T05:28:53.2799069Z Parsing [Setup] section, line 23
2023-11-11T05:28:53.2799376Z Parsing [Setup] section, line 24
2023-11-11T05:28:53.2799679Z Parsing [Setup] section, line 25
2023-11-11T05:28:53.2799979Z Parsing [Setup] section, line 28
2023-11-11T05:28:53.2800270Z Parsing [Setup] section, line 29
2023-11-11T05:28:53.2800572Z Parsing [Setup] section, line 30
2023-11-11T05:28:53.2800870Z Parsing [Setup] section, line 31
2023-11-11T05:28:53.2801163Z Parsing [Setup] section, line 32
2023-11-11T05:28:53.2801459Z Reading file (LicenseFile)
2023-11-11T05:28:53.2802224Z Error on line 25 in D:\a\radiolog\radiolog\radiolog.iss: Could not read "D:\a\radiolog\radiolog\dist\radiolog\LICENSE.txt".
2023-11-11T05:28:53.2802870Z 
2023-11-11T05:28:53.2803037Z Error: The system cannot find the file specified.
2023-11-11T05:28:53.2803410Z Compile aborted.
2023-11-11T05:28:53.5157304Z ##[error]Process completed with exit code 1.

So it looks like LICENSE.txt is missing from the dist dir. Not sure why.

Note that all previous steps in the build worked fine, including creation of the zip archive. The new build can still be 'installed' manually (download and unzip the archive into the right place).

caver456 commented 7 months ago

Looking at recent histories of files that could be related (comparing 3.10.1 to 3.8.0):

Need to try buildozer locally to see why LICENSE.txt isn't getting placed in dist.

caver456 commented 7 months ago

It's also possible that this is due to a version change in the workflow tools. Here's the actual line that's causing the problem, in radiolog.iss, which hasn't changed:

LicenseFile=dist\radiolog\LICENSE.txt

caver456 commented 7 months ago

testing on Windows, with pyinstaller 5.5, all the files from 'datas', including LICENSE.txt, go directly in dist/radiolog.

upgrading pyinstaller to the latest version (pip install --upgrade pyinstaller' installs 6.2.0; github used 6.1.0) then rerunning does show a big difference, which >apparently< explains the reason that issc doesn't find the file in the same place as earlier versions:

image

image

caver456 commented 7 months ago

Ok bingo hopefully:

Googling led to this, which (near the end of the thread) shows a merged pull request a couple weeks ago: https://github.com/pyinstaller/pyinstaller/issues/7951

In the docs: https://www.pyinstaller.org/en/stable/usage.html?highlight=contents_directory

So, that would mean an added line in radiolog.spec should do the trick, if the latest

This was incorporated to pyinstaller 6.1.0, which is what github uses:

https://pyinstaller.org/en/stable/CHANGES.html#id2

If needed, the alternate fix should be to change radiolog.iss from this:

LicenseFile=dist\radiolog\LICENSE.txt

to this:

LicenseFile=dist\radiolog\_internal\LICENSE.txt

Anyway... figure out the right syntax to incorporate to radilog.spec, then try it at home, then commit, push, tag, and release...

caver456 commented 7 months ago

Appears to work by adding the argument to EXE in radiolog.spec:

exe = EXE(
    ... ,
    ... ,
    contents_directory='.' # see https://github.com/ncssar/radiolog/issues/695#issuecomment-1807152764
)

gives the expected result, just like the good ol' days:

image

Like the discussions at the links above point out, this is not to say whether the current file locations are 'right' or 'wrong' or 'best' or 'antiquated' - this is just a thumbs up for supporting the idea of backwards compatibility.

caver456 commented 7 months ago

3.10.2 build worked! Will leave this ticket open until it's installed and running on some SAR computers.

caver456 commented 7 months ago

Installed and working in r5 and trailer. Closing the issue.