go-use go plugin test fails on non-amd64 architectures
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
When running on arm64, the `test_go_use` test in `test_go.py` fails.
### To Reproduce
https://github.com/canonical/craft-parts/actions/runs/17603137845/job/50008812681?pr=1277
### part yaml
```shell
```
### Relevant log output
```shell
_________________________________ test_go_use __________________________________
self = <craft_parts.executor.step_handler.StepHandler object at 0xffc124e994f0>
def _builtin_build(self) -> StepContents:
# Plugin commands.
build_commands = self._plugin.get_build_commands()
# save script to set the build environment
build_environment_script_path = (
self._part.part_run_dir.absolute() / "environment.sh"
)
build_environment_script_path.write_text(self._env)
build_environment_script_path.chmod(0o644)
try:
> _create_and_run_script(
build_commands,
script_path=self._part.part_run_dir.absolute() / "build.sh",
environment_script_path=build_environment_script_path,
cwd=self._part.part_build_subdir,
stdout=self._stdout,
stderr=self._stderr,
)
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/step_handler.py:179:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/step_handler.py:564: in _create_and_run_script
process.run(
/home/runner/work/craft-parts/craft-parts/craft_parts/utils/process.py:186: in run
result.check_returncode()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ProcessResult(returncode=1, stdout=b'', stderr=b'+ go work init .\ngo: downloading go1.23 (linux/arm64)\ngo: download ...oolchain not available\n', command=[PosixPath('/tmp/pytest-of-runner/pytest-0/test_go_use1/parts/hello/run/build.sh')])
def check_returncode(self) -> None:
"""Raise an exception if the process returned non-zero."""
if self.returncode != 0:
> raise ProcessError(self)
E craft_parts.utils.process.ProcessError: ProcessResult(returncode=1, stdout=b'', stderr=b'+ go work init .\ngo: downloading go1.23 (linux/arm64)\ngo: download go1.23 for linux/arm64: toolchain not available\n', combined=b'+ go work init .\ngo: downloading go1.23 (linux/arm64)\ngo: download go1.23 for linux/arm64: toolchain not available\n', command=[PosixPath('/tmp/pytest-of-runner/pytest-0/test_go_use1/parts/hello/run/build.sh')])
/home/runner/work/craft-parts/craft-parts/craft_parts/utils/process.py:52: ProcessError
The above exception was the direct cause of the following exception:
new_dir = local('/tmp/pytest-of-runner/pytest-0/test_go_use1')
partitions = None
@pytest.mark.plugin
def test_go_use(new_dir, partitions):
# Ensure we're not using cached sources
source_location = Path(__file__).parent / "test_go_workspace"
(new_dir / "go-cache").mkdir()
parts_yaml = textwrap.dedent(
f"""
parts:
sys:
source: https://go.googlesource.com/sys
source-type: git
plugin: go-use
go-flags:
source: https://github.com/jessevdk/go-flags.git
plugin: go-use
source-tag: v1.6.1
build-environment:
- GOPROXY: "off"
hello:
after:
- go-flags
- sys
plugin: go
source: {source_location}
build-environment:
- GO111MODULE: "on"
- GOPROXY: "off"
- GOFLAGS: "-json"
- GOMODCACHE: {new_dir / "go-cache"}
"""
)
parts = yaml.safe_load(parts_yaml)
lf = LifecycleManager(
parts,
application_name="test_go",
cache_dir=new_dir,
work_dir=new_dir,
partitions=partitions,
)
actions = lf.plan(Step.PRIME)
with lf.action_executor() as ctx:
> ctx.execute(actions)
/home/runner/work/craft-parts/craft-parts/tests/integration/plugins/test_go.py:167:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/executor.py:342: in execute
self._executor.execute(actions, stdout=stdout, stderr=stderr)
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/executor.py:136: in execute
self._run_action(act, stdout=stdout, stderr=stderr)
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/executor.py:229: in _run_action
handler.run_action(action, stdout=stdout, stderr=stderr)
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/part_handler.py:309: in run_action
state = handler(step_info, stdout=stdout, stderr=stderr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/part_handler.py:457: in _run_build
self._run_step(
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/part_handler.py:674: in _run_step
return step_handler.run_builtin()
^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/step_handler.py:139: in run_builtin
return handler()
^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <craft_parts.executor.step_handler.StepHandler object at 0xffc124e994f0>
def _builtin_build(self) -> StepContents:
# Plugin commands.
build_commands = self._plugin.get_build_commands()
# save script to set the build environment
build_environment_script_path = (
self._part.part_run_dir.absolute() / "environment.sh"
)
build_environment_script_path.write_text(self._env)
build_environment_script_path.chmod(0o644)
try:
_create_and_run_script(
build_commands,
script_path=self._part.part_run_dir.absolute() / "build.sh",
environment_script_path=build_environment_script_path,
cwd=self._part.part_build_subdir,
stdout=self._stdout,
stderr=self._stderr,
)
except process.ProcessError as process_error:
> raise errors.PluginBuildError(
part_name=self._part.name,
plugin_name=self._part.plugin_name,
stderr=process_error.result.stderr,
) from process_error
E craft_parts.errors.PluginBuildError: Failed to run the build script for part 'hello'.
E
E :: + go work init .
E :: go: downloading go1.23 (linux/arm64)
E :: go: download go1.23 for linux/arm64: toolchain not available
E Check the build output and verify the project can work with the 'go' plugin.
/home/runner/work/craft-parts/craft-parts/craft_parts/executor/step_handler.py:188: PluginBuildError
----------------------------- Captured stderr call -----------------------------
+ mkdir -p /tmp/pytest-of-runner/pytest-0/test_go_use1/parts/go-flags/export/go-use
+ ln -sf /tmp/pytest-of-runner/pytest-0/test_go_use1/parts/go-flags/src /tmp/pytest-of-runner/pytest-0/test_go_use1/parts/go-flags/export/go-use/go-flags
+ mkdir -p /tmp/pytest-of-runner/pytest-0/test_go_use1/parts/sys/export/go-use
+ ln -sf /tmp/pytest-of-runner/pytest-0/test_go_use1/parts/sys/src /tmp/pytest-of-runner/pytest-0/test_go_use1/parts/sys/export/go-use/sys
+ go work init .
go: downloading go1.23 (linux/arm64)
go: download go1.23 for linux/arm64: toolchain not available
```
Evaluation history
No evaluation history available.