Nuitka/Nuitka-Action

Problem with github-workflow-options

McHill007 opened this issue · 9 comments

Hi,
suddenly our action ignores the defined input parameters.
When I look at the output of github-workflow-options, everything still looks clean.

The call however ignores all set parameters

Nuitka-Options:INFO: Used command line options: --script-name=src/cli.py

I have commented out all parameters and limited myself to standalone for debugging.

"standalone": "true",

I have cleared cache and tried different runners. Unfortunately always with the same result.

I appreciate any help or tips

Workflow

name: 'Test Build'

on:
  workflow_call:
  workflow_dispatch:       
permissions:
    contents: write   
 
jobs:
   build-binary:
    name: "Build binaries"
    runs-on:  Linux  
    steps:

      - name: 'Checkout repository'
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          token: ${{ secrets.GH_TOKEN }}
         
      - name: 'Setup Python'
        uses: actions/setup-python@v4
        with:
          python-version: '3.11' 
            
      - name: 'Install Cross Dependencies'
        shell: bash
        run: pip install -r requirements/cross.txt

      - name: 'Install Windows Dependencies'
        shell: bash
        if: runner.os == 'Windows'
        run: pip install -r requirements/windows.txt
          
      - name: 'Install Unix Dependencies'
        shell: bash
        if: runner.os == 'Linux'
        run: pip install -r requirements/unix.txt          
          
      - name: 'Build Executable'
        uses: Nuitka/Nuitka-Action@main
        with:
          nuitka-version: main
          onefile: true
          script-name: src/cli.py
          assume-yes-for-downloads: true
          include-data-files: src/lib/logs/logging.conf=lib/logs/logging.conf
          include-plugin-directory: src,src/lib,src/core,src/probe
          output-dir: bin
          mingw64: true
          output-file: test.exe

      - name: 'Upload Artifacts'
        uses: actions/upload-artifact@v3
        with:
          name: 'Windows Build'
          path: |
            ./bin/test.exe

Workflow Output

set -e
  python -m nuitka --github-workflow-options
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    TOKEN: ***
    TAG_RELEASE: v12.2.2
    BIN_FILE: itrion-agent_v12.2.2.bin
    pythonLocation: /home/github/actions-runner-dev/_work/_tool/Python/3.11.5/x64
    PKG_CONFIG_PATH: /home/github/actions-runner-dev/_work/_tool/Python/3.11.5/x64/lib/pkgconfig
    Python_ROOT_DIR: /home/github/actions-runner-dev/_work/_tool/Python/3.11.5/x64
    Python2_ROOT_DIR: /home/github/actions-runner-dev/_work/_tool/Python/3.11.5/x64
    Python3_ROOT_DIR: /home/github/actions-runner-dev/_work/_tool/Python/3.11.5/x64
    LD_LIBRARY_PATH: /home/github/actions-runner-dev/_work/_tool/Python/3.11.5/x64/lib
    NUITKA_CACHE_DIR: /home/github/actions-runner-dev/_work/_actions/Nuitka/Nuitka-Action/main/nuitka/cache
    PYTHON_VERSION: 3.11
    NUITKA_WORKFLOW_INPUTS: {
    "nuitka-version": "main",
    "onefile": "true",
    "script-name": "src/cli.py",
    "working-directory": ".",
    "access-token": "",
    "module": "false",
    "standalone": "true",
    "assume-yes-for-downloads": "true",
    "show-scons": "true",
    "enable-plugins": "",
    "include-qt-plugins": "",
    "noinclude-qt-plugins": "",
    "include-data-dir": "",
    "include-data-files": "",
    "include-package": "",
    "include-package-data": "",
    "include-module": "",
    "include-plugin-directory": "",
    "include-plugin-files": "",
    "prefer-source-code": "",
    "nofollow-import-to": "",
    "user-package-configuration-file": "",
    "onefile-tempdir-spec": "",
    "onefile-child-grace-time": "",
    "onefile-no-compression": "false",
    "deployment": "false",
    "no-deployment-flag": "",
    "output-dir": "build",
    "output-file": "",
    "disable-console": "false",
    "company-name": "",
    "product-name": "",
    "file-version": "",
    "product-version": "",
    "file-description": "",
    "copyright": "",
    "trademarks": "",
    "windows-icon-from-ico": "",
    "windows-uac-admin": "false",
    "windows-uac-uiaccess": "false",
    "mingw64": "false",
    "macos-create-app-bundle": "false",
    "macos-app-icon": "",
    "macos-target-arch": "",
    "macos-signed-app-name": "",
    "macos-app-mode": "",
    "macos-sign-identity": "",
    "macos-sign-notarization": "",
    "macos-app-version": "",
    "macos-app-protected-resource": "",
    "embed-data-files-compile-time-pattern": "",
    "embed-data-files-run-time-pattern": "",
    "embed-data-files-qt-resource-pattern": "",
    "embed-debug-qt-resources": "",
    "encryption-key": "",
    "encrypt-stdout": "false",
    "encrypt-stderr": "false",
    "disable-cache": ""
  }

I made a change where 1.8 is required now, options are now parsed by Nuitka rather than the action code, removing the parsing there. I cannot tell if you are using 1.8 there. I guess, I need to verify, that the combination now actually works properly.

Thanks for the update.

I can confirm it was updating to the latest nuitka version 1.8 with the latest action. It seems there is a problem reading the environment even though it's present.

for key, value in json.loads(os.environ["NUITKA_WORKFLOW_INPUTS"]).items():

I switched back to 1.7.10 and 0.5 action and build works again.

I will dig deeper next week.

I'm having the same problem, an action that was working fine is now failing, and looking at the logs I see that none of the set parameters are being read!

What was normal before:
image

Failure now:
image

The problems seems to be in _considerGithubWorkflowOptions

In phase early the function is removing --github-workflow-options
Thats why in pahse later the ValueError is thrown.

def _considerGithubWorkflowOptions(phase):
    try:
        github_option_index = sys.argv.index("--github-workflow-options)
    except ValueError:
        return

I think the arg mapping needs to be adjusted from:
[OptionParsing.py:1887]
sys.argv[: github_option_index + (0 if phase == "early" else 1)]
to
sys.argv[: github_option_index + (1 if phase == "early" else 0)]

After the change my arguments are parsed properly and the workflow is running.

Nuitka-Options:INFO: Used command line options: --onefile --assume-yes-for-downloads --include-data-files=src/lib/logs/logging.conf=lib/logs/logging.conf --include-plugin-directory=src,src/lib,src/core,src/probe --output-dir=bin
 --windows-uac-admin --mingw64 --output-file=agent_v12.2.2.bin --standalone --show-scons --script-name=src/cli.py --script-name=tst.py --standalone
FATAL: Error, company name and file or product version need to be given when any version information is given.

Ok, I will make that into the first hotfix to Nuitka, expect it coming relatively soon then. Seems this somehow regressed at some point.

I have exactly the same. Looking forward for fixes 🙂

Hi!
May ask for some update?
Is any support needed?

Tested with Nuitka 1.8.4 and latest Nuitka Action without any problem.
Seems to work now.

Thank you for the comment. I'll Test it in two weeks.