Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly implement a message channel for scripts
For shell scripts a PKG_MSGFD variable is defined for each scripts representing the file descriptor of that message channel echo "something" >&${PKG_MSGFD} will append messages from script to pkg-messages For lua script: print_msg will now use the same mechanism as shell scripts
- Loading branch information
Showing
2 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
767fbd7
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.
This, unfortunately, creates some additional complication due to the fact that FD4 is now propagated into all descendants that the script creates and pkg would not exit until the last of them exits, even if the script itself has finished long time ago. As such, any runaway process would just make pkg hang indefinitely, which was not the case before. Yes, it's not nice to have a runaway processes but also true that ShitHappens[tm] and it would just create constant headache for people running automated build farms. Potential workaround perhaps is to have a timeout on poll() and mix it with calls to waitpid(WNOHANG) so that either condition would break the loop.
767fbd7
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.
@bapt P.S. Please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245462 for some context.