How to find out project root or location of snapcraft.yml? I don’t see any environment variables pointing to it. Why? There is a custom version file in project root, maintained by other people, and all parts should be built for version specified there.
I am doing out of tree builds, and usual “parent of stage” doesn’t work here.
while we should stop execution on errors, nounset should really be in the hands of the developer (i personally am for example not a fan of it since it makes scripts a lot bigger and harder to read if you have to zero-init variables everywhere)
The proper way to apply a patch is to install them to the /stage tree by a different part and applying them in the consuming part’s override-{pull,build} scriptlets, refer the following one for an example:
What is the scope of a variable I define arbitrarily inside a scriptlet? I’m assuming it’s local to just that scriptlet but I don’t see that written down explicitly anywhere.
Noticed this in another doc page, but it looks like the anchor is broken here too. Like the other doc page, the problem seems to be with how the anchor is rendered in the document. When you click on the anchor, nothing seems to happen on the page.
Potential solution
I found that adding an extra space between the anchor and the heading text fixes the issue:
Instead of:
## Overriding the **build** step[:anchor:](#heading--overriding-the-build-step)
do:
## Overriding the **build** step [:anchor:](#heading--overriding-the-build-step)
I’m not sure, but the term isn’t terribly useful outside the context of the snippets themselves. It might make better sense to simply rename this 'Overriding build steps` (actually, as originally suggested by Sergio a couple of years ago). I’ll do that now.
Let’s say the default build/install process ends up installing files with absolute paths in them, which need to be fixed up to look inside the snap:
@kyrofa is it really necessary? I run my bash script with #!/bin/sh and it is able to find all its stage-packages without patched stuff. If system level /bin/sh is used to run the script, the system level sh should not be able to discover snap’s bin.
Totally depends on the snap and what absolute paths we’re talking about, here. This was just an example for where overriding might be useful, that’s all.