-
Notifications
You must be signed in to change notification settings - Fork 17
Change Makefile to handle reeeeeally long lists of files #76
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
Conversation
… Bash maximum arguments count
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.
👍 assuming all the testing with CI changes were done end-to-end/verified.
Looks like AWS pack made our life harder once again
|
Eh, I think the blame here lies with Bash, or at least the way we used it. I love Bash, but it really is terrible sometimes. From a Bash user perspective, if a command accepts filenames as arguments, and it works for 10 filenames/arguments, then why shouldn't it work for 10 thousand filenames/arguments? And filename globbing and passing the list of filenames to a script is an extremely common (and apparently subtly limited/brittle) paradigm in Bash. Even though none of the Bash scripts changed, Bash still broke because the environment changed. It just goes to show how brittle Bash actually is compared to more elegant solutions. The fact that the And I love Bash to death. I've written thousands of lines of Bash in my life. I've even written an (extremely simple) package manager for Bash profiles, in Bash itself. I still consider Bash to be terrible. But once we/I convert to invoke, this shouldn't be an issue, since Python (and by extension, everything written in it) is perfect. 😆
|
|
From the build failure
Someone from CircleCI changed security OS limits and we suddenly hit this CI failure when number of possible arguments program/cli can accept exceeded the allowed bar. I don't think replacing Makefile/bash with something else will make life much easier, it'll just trade one set of issues for another. |
|
We could recompile kernel with a larger value for On a more serious note - I'm personally not a fan of (convoluted) Makefile. It's similar to the StackStorm coverage Makefile changes which made Makefile so convoluted so it's very hard to understand what is going on and make any changes to it (I gave up last then when I wanted to improve it). I think it's more more clear and easier to understand by having that logic in a separate bash script or similar. And part of the reason that logic was in those git-changes script was so it can potentially be re-used by other pack developers for their pack CI. I'm not sure if anyone is using it though. @nmaludy are you usig git-changes script for your pack CI? |
|
Regarding modifying the git-changes scripts, I think it was a poor decision to put A more concrete reason to remove the @Kami Check out my work in StackStorm/st2#4782 - it's not done, and I'm still figuring out how to (re-) implement a few tasks, but it's a good first stab at breaking up a convoluted A major draw of using Invoke for me is the ability to pass options to individual tasks. This is exceptionally useful for running tests with and without coverage enabled, because instead of being a completely separate make target, it's the same Invoke task, you just pass it a flag to enable coverage. Make is great when you are building artifacts that you want to cache. But for any interpreted language, or as a generic task runner, it is absolutely awful. It's the wrong tool for that job, and we shouldn't use make to begin with if we're just going to mark every single target as |

Only the files that have changed are validated for PR CI runs, but for the weekly CI runs all files are checked.
The AWS pack has a lot of actions. Like a lot a lot of actions. So when, during the weekly CI run, the
Makefilegathered a list of all of the YAML files and then tried to evaluate that in a Bashif [ ! $(CHANGED_YAML) ]statement, the number of arguments exceeded Bash's maximum number of arguments and the CI job failed (I setFORCE_CHECK_ALL_FILEStotrueso it would behave like the weekly CI runs).Due to that, I had to change up how all of that was processed. It doesn't really make sense to me to have the
FORCE_CHECK_ALL_FILESenvironment variable option in all of thegit-changessub-scripts, since that option was only used in theMakefileand when that was specified the returned list of files had nothing to do with git at all. So I moved that logic into theMakefileand had it execute commands for each file instead of trying to interpolate the huge list into a string and then re-interpreting that string into a list of arguments to a Bashforcommand.All of that made some lines in the
Makefilereally long, so then I also reformatted some of the recipes using backticks. Now it looks like a spilled box of toothpicks (eg: there are backticks ending a lot of lines), but there's a lot less horizontal scrolling required now and it kinda sorta reads like the Bash script that it is.I hope/plan on rewriting the
Makefileto use Python's excellent invoke library soon, so hopefully this problem will be avoided entirely in the future.