Canister type "custom" getting Permission Denied error

I’m trying to build a general canister that people can use to embed their frontend into the canister binary instead of using the asset canister.

I’m trying to copy the same mechanism as in the nns dapp nns-dapp/dfx.json at main · dfinity/nns-dapp · GitHub with a custom build script that creates a .tar of the frontend assets. However when I try to use the “custom” canister type I get the following error:

thread 'main' panicked at 'Could not run custom tool.: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', src/dfx/src/lib/builders/

When I look at the source code of the SDK the line numbers don’t go that far. Does anybody know where that error could come from?

I think you’d need to try looking at the tag of an older version, e.g.

For anyone seeing this in the future I had to make the build,sh script executable with:

chmod +x