-
-
Notifications
You must be signed in to change notification settings - Fork 26
add debug option to setup-environment-commands #289
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
da57f9f
to
1e9584f
Compare
- adds an args processing while loop - adds debug flag that allows for detailed logging of env before and after `setup-environment-commands`
1e9584f
to
888bf90
Compare
Interesting. The WIP stuff I'm doing has a __debug_lines helper in bash.bash. Why --debug here better than debug-bash -x -- setup-environment-commands |
Yeah, i know ;)
Good question. I realized the For example, I had a path with oh-my-zsh that i couldnt understand why it was not being set correctly. Using the --debug flag made it possible to see that "Ahaa, it was already being set before dorothy for some reason and so the debug showed variable 'variable was modified' and now things made sense." Also, with the history issue we both experience, atm i could not scroll back far enough to check the value in the output. etc etc. |
Makes sense. Let's reevaluate after devilbird merges. |
Had a crazy situation where updating https://github.com/bevry/dorothy/actions/runs/16187103925/job/45694731505#step:2:2589 The latest WIP code pushed to #281 includes debug code for the environment stuff now. So thank you for the inspiration for this. Also, I was able to use the new |
- ci: - remove `macos-13`, deprecated: https://github.blog/changelog/2025-07-11-upcoming-changes-to-macos-hosted-runners-macos-latest-migration-and-xcode-support-policy-updates - `*`: - remove trailing empty line in help texts for consistency - `echo-numeric`: - remove error message, perhaps re-add at a later date with `--verbose` - `fs-filename`: - fix bad `__slice` call - `checksum`, `cpr`, `fs-path`: - remove unnecessary `__slice` call - `choose`: - define array targets, such that references work as intended - `debug-bash`, `dorothy`, `eval-tester`, `setup-environment-commands`, `bash.bash`: - redo and rethink debug handling - `bash.bash:(__do|__split)`, `dorothy-internals`, `setup-environment-commands`, `eval-tester`, `styles.bash`, `env.bash`: - correctly handle trailing newlines - `__do` now keeps them by default for consistency with other targets, and `eval-tester` removes them by default for legacy reasons (thousands of test cases would need to be updated) - `dorothy-internals`: - fixed regressed bash binary/version handling - test all implementatiosn - fix leak of incomplete calculation - style `it was` and `it should be` comparisons - split into `bash-legacy.bash`, and add new tests for `bash.bash` helpers - `echo-revolving-door`: - fix bad earlier conversion to `__slice` that wasn't needed - `echo-style`, `bash.bash`, `styles.bash`: - split `__is_var_set` into `__is_var_declared` and `__is_var_defined` - `echo-verbose`, `eval-tester`, `bash.bash:__dump`, `styles.bash`: - use the correct `...nothing-provided` style - `bash.bash`: - rename several capability detection variables for consistency - add `__print_without_styles` - fix `__dump`'s handling of empty, declared, and undefined variables - have `__dump` support `--value=<value>` - update `BASH_VERSION_LATEST` to `5.3` - use more performant array string conversions on bash versions that support them - error messages now use `__dump` for better clarity - fix bad detection of var capabilities on bash 4.3 and implement workaround - `__to`: do not do divergent behaviour across bash versions for undefined variables, instead error requiring definition (see the `choose` changelog entry earlier, and the definitions now in all reference helpers in `bash.bash`) - `__to`, `__do`: more performant tty target handling - `__do`: support `--(no-)trailing-lines` flag, which was unnecessarily complicated due to bash <4.4 bugs, see <https://gist.github.com/balupton/cb05a7a8a161a9df2b246cf1491b7654> - `__do`: remove a trailing newline from a status file write - `__do`: if reading the semaphore fails, handle that - `__do`: pass `--inverted` to redirection eval calls to avoid (hopefully) unnecessary recursion - `__ansi_trim`: improve performance dramatically by simple pattern matching at the start and using substring matching instead of globs for non-pattern keys - `__cat_whole` => `__read_whole` which is now used throughout dorothy - `__array`: consistent behaviour with other reference helpers - fix missing definitions in all `bash.bash` reference helpers causing divergent bash behaviour across bash versions - `__slice`: rewrote the length handling for simplicity and performance, and improved error messages when out of bounds - `__split`: support `--(no-)trailing-lines` flag for `--invoke` usage - `is-windows`: - document various environment variables - `setup-util-bash`: - move the dev dep handling into the install function so existence checks aren't non-performant - `setup-environment-commands`, `env.bash`: - better debugging, thanks @molleweide for inspiration from #289 - handling malformated `env` output, because that is possible - use the `bash.bash` helpers to dramatically simplify what was once very complex redundant logic - use associative arrays on bash versions that support them for performance - use a single print at the end for performance - use safety functions (todo: use/convert more later) - `environment.*`, `history.sh`, `oz.fish`: - change from `>>/dev/stderr` to `>&2` as all the relavant shells support that conversion - `environment.sh`: - better output and capturing and handling of failures, allowing survival on failures
- ci: - remove `macos-13`, deprecated: https://github.blog/changelog/2025-07-11-upcoming-changes-to-macos-hosted-runners-macos-latest-migration-and-xcode-support-policy-updates - `*`: - remove trailing empty line in help texts for consistency - `echo-numeric`: - remove error message, perhaps re-add at a later date with `--verbose` - `fs-filename`: - fix bad `__slice` call - `checksum`, `cpr`, `fs-path`: - remove unnecessary `__slice` call - `choose`: - define array targets, such that references work as intended - `debug-bash`, `dorothy`, `eval-tester`, `setup-environment-commands`, `bash.bash`: - redo and rethink debug handling - `bash.bash:(__do|__split)`, `dorothy-internals`, `setup-environment-commands`, `eval-tester`, `styles.bash`, `env.bash`: - correctly handle trailing newlines - `__do` now keeps them by default for consistency with other targets, and `eval-tester` removes them by default for legacy reasons (thousands of test cases would need to be updated) - `dorothy-internals`: - fixed regressed bash binary/version handling - test all implementatiosn - fix leak of incomplete calculation - style `it was` and `it should be` comparisons - split into `bash-legacy.bash`, and add new tests for `bash.bash` helpers - `echo-revolving-door`: - fix bad earlier conversion to `__slice` that wasn't needed - `echo-style`, `bash.bash`, `styles.bash`: - split `__is_var_set` into `__is_var_declared` and `__is_var_defined` - `echo-verbose`, `eval-tester`, `bash.bash:__dump`, `styles.bash`: - use the correct `...nothing-provided` style - `bash.bash`: - rename several capability detection variables for consistency - add `__print_without_styles` - fix `__dump`'s handling of empty, declared, and undefined variables - have `__dump` support `--value=<value>` - update `BASH_VERSION_LATEST` to `5.3` - use more performant array string conversions on bash versions that support them - error messages now use `__dump` for better clarity - fix bad detection of var capabilities on bash 4.3 and implement workaround - `__to`: do not do divergent behaviour across bash versions for undefined variables, instead error requiring definition (see the `choose` changelog entry earlier, and the definitions now in all reference helpers in `bash.bash`) - `__to`, `__do`: more performant tty target handling - `__do`: support `--(no-)trailing-lines` flag, which was unnecessarily complicated due to bash <4.4 bugs, see <https://gist.github.com/balupton/cb05a7a8a161a9df2b246cf1491b7654> - `__do`: remove a trailing newline from a status file write - `__do`: if reading the semaphore fails, handle that - `__do`: pass `--inverted` to redirection eval calls to avoid (hopefully) unnecessary recursion - `__ansi_trim`: improve performance dramatically by simple pattern matching at the start and using substring matching instead of globs for non-pattern keys - `__cat_whole` => `__read_whole` which is now used throughout dorothy - `__array`: consistent behaviour with other reference helpers - fix missing definitions in all `bash.bash` reference helpers causing divergent bash behaviour across bash versions - `__slice`: rewrote the length handling for simplicity and performance, and improved error messages when out of bounds - `__split`: support `--(no-)trailing-lines` flag for `--invoke` usage - `is-windows`: - document various environment variables - `setup-util-bash`: - move the dev dep handling into the install function so existence checks aren't non-performant - `setup-environment-commands`, `env.bash`: - better debugging, thanks @molleweide for inspiration from #289 - handling malformated `env` output, because that is possible - use the `bash.bash` helpers to dramatically simplify what was once very complex redundant logic - use associative arrays on bash versions that support them for performance - use a single print at the end for performance - use safety functions (todo: use/convert more later) - `environment.*`, `history.sh`, `oz.fish`: - change from `>>/dev/stderr` to `>&2` as all the relavant shells support that conversion - `environment.sh`: - better output and capturing and handling of failures, allowing survival on failures
setup-environment-commands
.--debug
sets a variable that allowsenv.bash
print in detail what happens so that you can diagnose exactly what happens.I think this is preparatory to moving #288 into SEC so that you can more easilly debug what happens when you are playing around with the cache.