← Back to issue list

go-use test isn't working on arm64 github-hosted runners

View original Github issue

Metadata

Project
craft-parts
Number
#1313
Type
issue
State
open
Author
lengau
Labels
Status: Triaged Type: Bug
Created
2025-09-17 01:08:04+00:00
Updated
2025-09-17 01:08:21+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description `tests/integration/plugins/test_go.py::test_go_use` is failing on github-hosted arm64 runners. This is because we need go 1.24 but the runners have go 1.22 and we've disabled downloading go. ### To Reproduce https://github.com/canonical/craft-parts/actions/runs/17783205133/job/50546068446?pr=1311 ### part yaml ```shell ``` ### Relevant log output ```shell ______________________________ test_go_use[none] _______________________________ self = <craft_parts.executor.step_handler.StepHandler object at 0xffe0bdd8a180> 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 .\n+ go work use .\n+ go work use /tmp/pytest-of-runne...d by GOPROXY=off\n', command=[PosixPath('/tmp/pytest-of-runner/pytest-0/test_go_use_none_0/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 .\n+ go work use .\n+ go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/go-flags\n+ go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/sys\ngo: ../../../backstage/go-use/sys/go.mod requires go >= 1.24.0 (running go 1.22.2)\ngo: switching to go >= 1.24.0: module lookup disabled by GOPROXY=off\n', combined=b'+ go work init .\n+ go work use .\n+ go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/go-flags\n+ go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/sys\ngo: ../../../backstage/go-use/sys/go.mod requires go >= 1.24.0 (running go 1.22.2)\ngo: switching to go >= 1.24.0: module lookup disabled by GOPROXY=off\n', command=[PosixPath('/tmp/pytest-of-runner/pytest-0/test_go_use_none_0/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_use_none_0') partitions = None 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:170: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/runner/work/craft-parts/craft-parts/craft_parts/executor/executor.py:359: in execute self._executor.execute(actions, stdout=stdout, stderr=stderr) /home/runner/work/craft-parts/craft-parts/craft_parts/executor/executor.py:153: in execute self._run_action(act, stdout=stdout, stderr=stderr) /home/runner/work/craft-parts/craft-parts/craft_parts/executor/executor.py:246: in _run_action handler.run_action(action, stdout=stdout, stderr=stderr) /home/runner/work/craft-parts/craft-parts/craft_parts/executor/part_handler.py:313: in run_action state = handler(step_info, stdout=stdout, stderr=stderr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /home/runner/work/craft-parts/craft-parts/craft_parts/executor/part_handler.py:461: in _run_build self._run_step( /home/runner/work/craft-parts/craft-parts/craft_parts/executor/part_handler.py:678: 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 0xffe0bdd8a180> 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 use . E :: + go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/go-flags E :: + go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/sys E :: go: ../../../backstage/go-use/sys/go.mod requires go >= 1.24.0 (running go 1.22.2) E :: go: switching to go >= 1.24.0: module lookup disabled by GOPROXY=off 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 log setup ------------------------------ WARNING root:features.py:42 deleting current features configuration ----------------------------- Captured stderr call ----------------------------- + mkdir -p /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/parts/go-flags/export/go-use + ln -sf /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/parts/go-flags/src /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/parts/go-flags/export/go-use/go-flags + mkdir -p /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/parts/sys/export/go-use + ln -sf /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/parts/sys/src /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/parts/sys/export/go-use/sys + go work init . + go work use . + go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/go-flags + go work use /tmp/pytest-of-runner/pytest-0/test_go_use_none_0/backstage/go-use/sys go: ../../../backstage/go-use/sys/go.mod requires go >= 1.24.0 (running go 1.22.2) go: switching to go >= 1.24.0: module lookup disabled by GOPROXY=off ```

Evaluation history

No evaluation history available.