`rockcraft pack` with go-framework fails with `FileNotFoundError`
Metadata
Current evaluation
go-framework packing a module with no .go sources ends in a low-level FileNotFoundError; the cause is confirmed and open PR #1114 proposes clearer early validation.
Suggested action: keep open
Reason: The reproduction creates go.mod but no Go source; javierdelapuente confirmed the plugin should fail because "there are no go files (and no main function either)." Open PR #1114 directly adds early validation, so the issue remains valid and should remain open pending review or merge.
Evaluated by: mr-cal-bot
Impact:
30
Quick Win:
24
Complexity:
12
Confidence:
95
Actionability:
92
Issue body
### Bug Description
When packing a go application with the experimental go framework, rockcraft fails with a `FileNotFoundError`.
The full log is here: https://pastebin.canonical.com/p/xr627JZ8HQ/.
### To Reproduce
Found following the build a rock for a Go application tutorial but without multi-pass: https://documentation.ubuntu.com/rockcraft/en/1.8.0/tutorial/go.html
```
go mod init example
sudo snap install rockcraft --classic
rockcraft init --profile go-framework
ROCKCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS=True rockcraft pack
```
### Environment
OS: ubuntu@24.04
Rockcraft: 1.8.0 (latest/stable)
Not running in multipass.
### rockcraft.yaml
```yaml
name: my-rock-name
# see https://documentation.ubuntu.com/rockcraft/en/1.8.0/explanation/bases/
# for more information about bases and using 'bare' bases for chiselled rocks
base: bare # as an alternative, a ubuntu base can be used
build-base: ubuntu@24.04 # build-base is required when the base is bare
version: '0.1' # just for humans. Semantic versioning is recommended
summary: A summary of your Go application # 79 char long summary
description: |
This is my-rock-name's description. You have a paragraph or two to tell the
most important story about it. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the
container registries out there.
# the platforms this rock should be built on and run on.
# you can check your architecture with `dpkg --print-architecture`
platforms:
amd64:
# arm64:
# ppc64el:
# s390x:
# to ensure the go-framework extension functions properly, your Go project
# should have a go.mod file. Check the parts section for the selection of
# the default binary.
# see https://documentation.ubuntu.com/rockcraft/en/1.8.0/reference/extensions/go-framework
# for more information.
# +-- my_rock_name
# | |-- go.mod
# | |-- migrate.sh
extensions:
- go-framework
# uncomment the sections you need and adjust according to your requirements.
# parts:
# go-framework/install-app:
# # select a specific Go version. Otherwise the current stable one will be used.
# build-snaps:
# - go/1.22/stable
# organize:
# # if the main package is in the base directory and the rockcraft name
# # attribute is equal to the go module name, the name of the server will
# # be selected correctly, otherwise you can adjust it.
# # the file in /usr/local/bin/ with the name of the rockcraft project will be
# # the binary to run your server.
# # you can also include here other binary files to be included in the rock.
# bin/otherbinary: usr/local/bin/projectname
# go-framework/assets:
# stage:
# # by default, only the files migrate, migrate.sh, templates/ and static/
# # are copied into the image. You can modify the list below to override
# # the default list and include or exclude specific files/directories
# # in your project.
# # note: Prefix each entry with "app/" followed by the local path.
# - app/templates
# - app/static
# - app/otherdirectory
# - app/otherfile
```
### Relevant log output
```shell
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.338 Staging go-framework/install-app
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.338 execute action go-framework/install-app:Action(part_name='go-framework/install-app', step=Step.STAGE, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None))
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.348 /root/parts/go-framework/install-app/install/usr: No such file or directory
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.348 Detailed information: FileNotFoundError: filename: '/root/parts/go-framework/install-app/install/usr'
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 Traceback (most recent call last):
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_application/services/lifecycle.py", line 269, in run
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 aex.execute(action, stdout=stream, stderr=stream)
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 324, in execute
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 self._executor.execute(actions, stdout=stdout, stderr=stderr)
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 136, in execute
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 self._run_action(act, stdout=stdout, stderr=stderr)
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 211, in _run_action
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 handler.run_action(action, stdout=stdout, stderr=stderr)
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 171, in run_action
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 state = handler(step_info, stdout=stdout, stderr=stderr)
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 369, in _run_stage
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.359 contents = self._run_step(
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 ^^^^^^^^^^^^^^^
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 493, in _run_step
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 return step_handler.run_builtin()
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/step_handler.py", line 107, in run_builtin
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 return handler()
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 ^^^^^^^^^
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/step_handler.py", line 201, in _builtin_stage
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 files, dirs = migrate_files(
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 ^^^^^^^^^^^^^^
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/executor/migration.py", line 77, in migrate_files
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 file_utils.create_similar_directory(
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 File "/snap/rockcraft/3025/lib/python3.12/site-packages/craft_parts/utils/file_utils.py", line 270, in create_similar_directory
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 stat = os.stat(source, follow_symlinks=False)
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-02-12 18:30:42.872 :: 2025-02-12 18:30:42.360 FileNotFoundError: [Errno 2] No such file or directory: '/root/parts/go-framework/install-app/install/usr'
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
30
Quick Win:
24
Complexity:
12
Confidence:
95
Actionability:
92
|
keep open | go-framework packing a module with no .go sources ends in a low-level FileNotFoundError; the cause is confirmed and open PR #1114 proposes clearer early validation. | |
| stealth/space-bunny-alpha |
Impact:
30
Quick Win:
21
Complexity:
20
Confidence:
91
Actionability:
86
|
keep open | go-framework accepts a project with go.mod but no Go source, then fails during staging with a low-level FileNotFoundError; early validation with a clearer error is proposed. | |
| qwen/qwen3.6-35b-a3b |
Impact:
60
Quick Win:
29
Complexity:
30
Confidence:
60
Actionability:
70
|
keep open | rockcraft pack with go-framework fails with FileNotFoundError when project has go.mod but no Go source files. A PR was proposed to validate .go file presence and fail early with clearer error. | |
| qwen/qwen3.8-27b |
Impact:
45
Quick Win:
36
Staleness:
15
Complexity:
20
Confidence:
75
Support Request:
10
|
keep open | rockcraft pack with go-framework extension fails with FileNotFoundError at staging when project has go.mod but no Go source files. Maintainer confirmed root cause (2026-02-26) and opened a PR to validate .go file presence and fail early; fix not yet merged. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
25
Complexity:
20
Confidence:
85
Support Request:
0
|
keep open | rockcraft pack with go-framework crashes with FileNotFoundError during staging when no Go source files are present. A maintainer opened a PR to validate .go files and fail early, but the issue remains open awaiting merge/verification. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
40
Complexity:
20
Confidence:
85
Support Request:
10
|
keep open | Rockcraft pack with go-framework crashes with FileNotFoundError when building a project with go.mod but no source files. Maintainer diagnosed the issue and opened a PR to add early validation and a clearer error message. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
40
Complexity:
25
Confidence:
90
Support Request:
0
|
keep open | rockcraft pack with go-framework crashes with FileNotFoundError when a project has go.mod but no Go source files. A PR was opened to validate .go files and fail early with a clearer error, awaiting merge/verification. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/rockcraft#1114
(confidence 95%)
Open PR adds an early .go-source check and clearer ExtensionError for this exact scenario.
Related issues
No related issues found above the similarity threshold.