You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running in the override-build step, the output of go run is not being redirected to a file as expected. In my override-build step I am using a go package to do some formatting on a file.
As I was typing out this bug report, I realised that I think this is happening because of snap confinement. It feels a bit frustrating to face snap confinement issues while in a build environment.
To Reproduce
Use the rockcraft.yaml below and put an exit 1 at the start of override-build and run rockcraft pack --debug.
Then try the following:
go run github.com/openfga/cli/cmd/fga@latest model -h
go run github.com/openfga/cli/cmd/fga@latest model -h > test-file
ls -lah test-file
go install github.com/openfga/cli/cmd/fga@latest
/root/go/bin/fga model -h > test-file
ls -lah test-file
On my machine:
# go run github.com/openfga/cli/cmd/fga@latest model -h > test-file
# ls -lah test-file
-rw-r--r-- 1 root root 0 Nov 19 12:31 test-file
# /root/go/bin/fga -h > test-file
# ls -lah test-file
-rw-r--r-- 1 root root 1.5K Nov 19 12:35 test-file
As you can see the first attempt results in an empty file (maybe because of snap confinement?) while the second attempt works.
Environment
$ lxc version
Client version: 6.1
Server version: 6.1
rockcraft.yaml
name: jimmbase: [email protected]version: '0.1'summary: Juju Intelligent Model Manager provides a convient way to manage all of your models!description: | JIMM is a Juju controller, used in conjunction with the JaaS dashboard to provide a seamless way to manage models, regardless of where their controllers reside or what cloud they may be running on.license: GPL-3.0platforms:
amd64:
parts:
ca-certs:
plugin: niloverlay-packages: [ca-certificates]builder:
plugin: go # https://canonical-craft-parts--694.com.readthedocs.build/en/694/common/craft-parts/reference/plugins/go_plugin.htmlafter:
- ca-certssource: .source-type: localbuild-snaps:
- go/1.23/stablebuild-packages:
- git
- make build-environment:
- GOOS: linuxoverride-build: | set -ex mkdir -p $CRAFT_PART_INSTALL/usr/local/bin make build/server cp ./jimmsrv $CRAFT_PART_INSTALL/usr/local/bin # The location of SQL files isn't configurable right now, as such we just # place it in bin cp -r ./internal/dbmodel/sql $CRAFT_PART_INSTALL/usr/local/bin/sql # Convert the OpenFGA auth model to JSON and place a copy in the ROCK # Used by the charm to apply to the OpenFGA server, not by the container itself mkdir -p $CRAFT_PART_INSTALL/root/openfga/ go install github.com/openfga/cli/cmd/fga@latest go run github.com/openfga/cli/cmd/fga@latest model transform --file ./openfga/authorisation_model.fga --output-format json > $CRAFT_PART_INSTALL/root/openfga/authorisation_model.json exit 1
Relevant log output
None
The text was updated successfully, but these errors were encountered:
Bug Description
When running in the override-build step, the output of
go run
is not being redirected to a file as expected. In my override-build step I am using a go package to do some formatting on a file.As I was typing out this bug report, I realised that I think this is happening because of snap confinement. It feels a bit frustrating to face snap confinement issues while in a build environment.
To Reproduce
Use the rockcraft.yaml below and put an
exit 1
at the start of override-build and runrockcraft pack --debug
.Then try the following:
On my machine:
As you can see the first attempt results in an empty file (maybe because of snap confinement?) while the second attempt works.
Environment
rockcraft.yaml
Relevant log output
The text was updated successfully, but these errors were encountered: