Post-build step for asset canister fails because directory is considered to be outside the workspace root #2633
Replies: 6 comments
-
My workaround is as follows.
I'm using It would be great if things like |
Beta Was this translation helpful? Give feedback.
-
Hi Paul, I feel your pain! We have reworking the custom build command on our backlog and know the current state is mediocre at best. Thanks for giving good examples that we can test against! |
Beta Was this translation helpful? Give feedback.
-
I think I saw some code that looked like it might try to write to the provided directory as well. If that's true then that would have been another problem I would have run into. |
Beta Was this translation helpful? Give feedback.
-
@sesi200 I saw some PRs mentioning this so I wondered if I had missed anything that might allow me to work around this now. |
Beta Was this translation helpful? Give feedback.
-
I think it would help if I'm surprised that doesn't work; the assets need to get built somehow, and having something like |
Beta Was this translation helpful? Give feedback.
-
It currently runs |
Beta Was this translation helpful? Give feedback.
-
My
dfx.json
looks like this:There's apparently some issue with using
"result/dist/"
as the source directory because when I rundfx deploy myproject_assets
I seeError: The post-build step failed for canister 'ryjl3-tyaaa-aaaaa-aaaba-cai' with an embedded error: Directory at '/Users/py/projects/paulyoung/myproject/main/result/dist/' is outside the workspace root.
I suspect this is because
result
is actually a symlink to/nix/store/<hash>-myproject
. I'm working around this for now but it might be nice if people could opt out of this check.Also, is there a way to specify a build command for asset canisters? The above relies on the dependency of
myproject
to put the assets in the right place. It would help with my workaround if I could decouple the two.Beta Was this translation helpful? Give feedback.
All reactions