`rockcraft pack` with go-framework fails with `FileNotFoundError`
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
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
No evaluation history available.