Skip to content

Conversation

@AbduAzim424
Copy link
Contributor

@AbduAzim424 AbduAzim424 commented Aug 5, 2025

Read architecture from the package definition or default to x86_64 to prevent architecture specific packages to fail.

Example:

2025/08/05 19:16:32 ERRO error: skip this arch
Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repogddl7mr3/py_env-python3.12/bin/shellcheck-run-steps", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/runner/.cache/pre-commit/repogddl7mr3/py_env-python3.12/lib/python3.12/site-packages/pre_commit_hooks/shellcheck_run_steps.py", line 112, in main
    subprocess.check_call(
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--volume=/home/runner/work/enterprise-packages/enterprise-packages:/work', '--rm', 'cgr.dev/chainguard/melange:latest', 'compile', '--arch=x86_64', '--pipeline-dir=./pipelines', 'raspberry-pi-utils.yaml']' returned non-zero exit status 1.
Unable to find image 'cgr.dev/chainguard/melange:latest' locally
latest: Pulling from chainguard/melange

raspberry-pi-utils.yaml package failed to pass the lint phase as we were using os.uname().machine of the CI environment for all the packages.

…ile portion to prevent architecture specific packages to fail

Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
@AbduAzim424 AbduAzim424 force-pushed the shellcheck-hook-arch branch from c8e17ed to cdaf3eb Compare August 5, 2025 20:13
@AbduAzim424 AbduAzim424 changed the title shellcheck_run_steps.py: add architecture variety to the melange comp… shellcheck_run_steps.py: add architecture variety Aug 5, 2025
Copy link
Contributor

@dannf dannf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just look at the melange YAML and parse target-architectures. if that field exists, use the first arch it lists. If it doesn't exist, maybe just use x86_64.

@AbduAzim424 AbduAzim424 force-pushed the shellcheck-hook-arch branch from 682d899 to 825c568 Compare August 5, 2025 22:03
Copy link
Contributor

@dannf dannf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! I like this better. A few more comments inline.

Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
@AbduAzim424 AbduAzim424 force-pushed the shellcheck-hook-arch branch from 825c568 to b10a5b1 Compare August 5, 2025 22:20
@AbduAzim424 AbduAzim424 changed the title shellcheck_run_steps.py: add architecture variety shellcheck_run_steps.py: read arch from pkg YAML Aug 5, 2025
Signed-off-by: Azimjon Ulmasov <azimjon.ulmasov@chainguard.dev>
@AbduAzim424 AbduAzim424 merged commit 70fee29 into chainguard-dev:main Aug 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants