Closed mcdurdin closed 2 weeks ago
Test specification and instructions
User tests are not required
Okay, one problem here is that build-utils.sh is used for both builder scripts and other utility scripts, some of which are supposed to not change folder (e.g. mkver.inc.sh).
Two ways to fix:
BUILDER_NO_CD
flag to scripts that care about initial folder
pushd
/popd
but that looks uglier.Okay, one problem here is that build-utils.sh is used for both builder scripts and other utility scripts, some of which are supposed to not change folder (e.g. mkver.inc.sh).
Two ways to fix:
It took me a while to even understand the problem you are solving. Let me just put it in my words to see if it makes sense. If you add the line cd "$THIS_SCRIPT_PATH" to builder.inc.sh. builder.inc.sh is sourced in build-utils.inc.sh. So now all the subprojects that are sourcing build-utils.inc.sh will have the directory changed to the script path pf the calling script. This is not desirable eg mkver.inc.sh in which you want it to be the directory it is currently in at the time you source build-utils.inc.sh . I would go with BUILDER_NO_CD flag. That is because adding another script just to not do a cd seems confusing. What about If $THIS_SCRIPT_PATH was called $EXECUTE_PATH then for those scripts like that do not want to change directory set the $EXECUTE_PATH to pwd directory.
Let me just put it in my words to see if it makes sense. If you add the line cd "$THIS_SCRIPT_PATH" to builder.inc.sh. builder.inc.sh is sourced in build-utils.inc.sh. So now all the subprojects that are sourcing build-utils.inc.sh will have the directory changed to the script path pf the calling script. This is not desirable eg mkver.inc.sh in which you want it to be the directory it is currently in at the time you source build-utils.inc.sh .
Yep.
I would go with BUILDER_NO_CD flag. That is because adding another script just to not do a cd seems confusing. What about If $THIS_SCRIPT_PATH was called $EXECUTE_PATH then for those scripts like that do not want to change directory set the $EXECUTE_PATH to pwd directory.
I kinda started to go this way then realised I'd need to fixup all the random scripts that include build-utils.sh to do this, and it would still leave us in the spot where api contract for builder scripts is vague. So I ended up:
cd
4. resources/builder.inc.sh may be renamed in future to avoid confusion
Yes I think that needs to happen, something that helps reflect what it does the resources/build/builder.inc.sh
doesn't. Actually it is really the other way around isn't?. the later is an extension
- resources/builder.inc.sh may be renamed in future to avoid confusion
Yes I think that needs to happen, something that helps reflect what it does the
resources/build/builder.inc.sh
doesn't. Actually it is really the other way around isn't?. the later is an extension
I think resources/builder.inc.sh should become resources/build/builder.implementation.inc.sh or something like that (better not to have it in resources/ directly).
Changes in this pull request will be available for download in Keyman version 18.0.28-alpha
Fixes #11324.
cd "$THIS_SCRIPT_PATH"
cd
from all build.shset -eu
from all build.sh (and# set -x
)builder_describe
andbuilder_parse
, then you are not a builder script!@keymanapp-test-bot skip