Skip to content

--workdir is ignored #40

@VladRassokhin

Description

@VladRassokhin

Not sure whether it's a bug of run-snapcraft.sh or pebble.

In the old official docker container it was possible to place snapcraft.yaml into an arbitrary directory (e.g. mount it as ...:/build/snapcraft.yaml:ro) and use --workdir=/build. Now it doesn't work and gives following error:

2024-04-29T09:59:11.631Z [snapcraft] Could not find snap/snapcraft.yaml. Are you sure you are in the right directory?
2024-04-29T09:59:11.631Z [snapcraft] Recommended resolution: To start a new project, use `snapcraft init`

Whole docker args if you're interested (paths removed and newlines added for readability):

docker
run
--rm
--volume=/work/out/idea-ce/dist.snap.amd64/snapcraft.yaml:/build/snapcraft.yaml:ro
--volume=/work/out/idea-ce/dist.snap.amd64/intellij-idea-community.desktop:/build/snap/gui/intellij-idea-community.desktop:ro
--volume=/work/out/idea-ce/dist.snap.amd64/intellij-idea-community.png:/build/prime/meta/gui/icon.png:ro
--volume=/work/out/idea-ce/dist.snap.amd64/result:/build/result
--volume=/work/out/idea-ce/dist.all:/build/dist.all:ro
--volume=/work/out/idea-ce/temp/linux.dist.snap.product-info.json.amd64:/build/dist.product-json:ro
--volume=/work/out/idea-ce/dist.unix.x64:/build/dist.unix:ro
--volume=/work/community/build/download/jbr_jcef-21.0.3b442.1-linux-x64:/build/jre:ro
--workdir=/build
ghcr.io/canonical/snapcraft:8_core22@sha256:ea7434407f1ccede1feee183b982b23e1914a36267701063c392fb299a04dd89
snap
--build-for=amd64
-o
result/intellij-idea-community_2024.2-EAP_amd64.snap

Turns out one must inspect sources (https://github.com/canonical/snapcraft-rocks/blob/core22-8/rockcraft.yaml) and use /project. Is it documented anywhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions