-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bldr-build] Prefix public callback functions with do_
.
#120
Conversation
This PR has passed 'Verify' and is ready for review and approval! |
done | ||
$(MAKE) $(addprefix publish-,$(PKGS)) | ||
|
||
$(PKGS): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know you could do this, that's awesome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm re-remembering a lot of Makefile-isms after reading them to build our softwares 😄
@fnichol works for me. Do you think we perhaps should prefix all of our callbacks with |
@reset It's something I was wondering about, but I'd rather change them all like that to the following:
There are few of functions that happen in the build flow (i.e. Thoughts? |
@fnichol yeah I'm thinking that we should prefix all of our callbacks/public functions with |
Ths addresses an issue where the author of a Plan wants to call the `install(1)` command to copy files, create directories, etc. Here's a short example that happens in an `install()` callback: ```sh install() { make install install -D -m644 LICENSE ${pkg_path}/share/LICENSE } ``` The call to `install` on line 3 won't execute the `install(1)` command, but will instead recursively call the defined `install()` shell function, which recurses into foreverland. Additionally, now all user-facing callbacks that are designed to be overwritten are of the naming form `do_*()`. The following functions are now part of the public API for Plan files: * `do_begin()` (formerly `bldr_begin()`) * `do_download()` (formerly `download()`) * `do_verify()` (formerly `verify()`) * `do_clean()` (formerly `clean_cache()`) * `do_unpack()` (formerly `unpack()`) * `do_prepare_wrapper()` (formerly `prepare_wrapper()`) * `do_prepare()` (formerly `prepare()`) * `do_build_wrapper()` (formerly `build_wrapper()`) * `do_build()` (formerly `build()`) * `do_install_wrapper()` (formerly `install_wrapper()`) * `do_install()` (formerly `install()`) * `do_build_config()` (formerly `config()`) * `do_service()` (formerly `service()`) * `do_strip()` (formerly `strip_binaries()`) * `do_docker_image_wrapper()` (formerly `dockerfile_wrapper()`) * `do_dockerfile_inline()` (formerly `docker_inline()`) * `do_docker_image()` (formerly `dockerfile()`) * `do_end()` (formerly `bldr_end()`)
This change changes the names of some internally-facing functions in order to signal that external users (i.e. Plan authors) should not call these functions or rely on their current behavior over the long term. A function which is prefix with a single underscore (`_`) is API/private visibility.
The `resolve_dep()` function was using `exit_with()`, but since it was being called from a subshell and the return code was not being checked, the program would continue after a bad depdency solve.
It turns out that using a shell-style for loop in a Makefile does not give you the same guarentees as running that same for loop in a shell script with `set -e` set. The for loop is considered a single line statement to `make(1)` so any failures inside the loop will not trigger an abort. This change uses Makefile targets to accomplish the same end goal.
31570c5
to
b5a4978
Compare
install()
callback to install_files()
.do_
.
This PR has passed 'Verify' and is ready for review and approval! |
@delivery approve |
Merged change 19030a67-f5c3-4371-806a-c301b1b4765b From review branch rename-install-callback into master Signed-off-by: adam <[email protected]>
Change: 19030a67-f5c3-4371-806a-c301b1b4765b approved by: @adamhjk |
This was a missed oversight with changes made in #120.
This was missed when updating variables in #120.
[AtomicWriter] fsync() parent directory after rename
Ths addresses an issue where the author of a Plan wants to call the
install(1)
command to copy files, create directories, etc. Here's ashort example that happens in an
install()
callback:The call to
install
on line 3 won't execute theinstall(1)
command,but will instead recursively call the defined
install()
shellfunction, which recurses into foreverland.
Additionally, now all user-facing callbacks that are designed to be
overwritten are of the naming form
do_*()
. The following functions arenow part of the public API for Plan files:
do_begin()
(formerlybldr_begin()
)do_download()
(formerlydownload()
)do_verify()
(formerlyverify()
)do_clean()
(formerlyclean_cache()
)do_unpack()
(formerlyunpack()
)do_prepare_wrapper()
(formerlyprepare_wrapper()
)do_prepare()
(formerlyprepare()
)do_build_wrapper()
(formerlybuild_wrapper()
)do_build()
(formerlybuild()
)do_install_wrapper()
(formerlyinstall_wrapper()
)do_install()
(formerlyinstall()
)do_build_config()
(formerlyconfig()
)do_service()
(formerlyservice()
)do_strip()
(formerlystrip_binaries()
)do_docker_image_wrapper()
(formerlydockerfile_wrapper()
)do_dockerfile_inline()
(formerlydocker_inline()
)do_docker_image()
(formerlydockerfile()
)do_end()
(formerlybldr_end()
)