Skip to content
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

Display "repeat build options" at the end if process was cancelled #6379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iav
Copy link
Contributor

@iav iav commented Mar 8, 2024

Description

Currently "Repeat Build Options" shows at the end of screen log only if process was successfully finished.

This change adds "Repeat Build Options" text on the screen at the end of visible log.

@iav iav requested a review from a team as a code owner March 8, 2024 20:27
@iav iav added the Work in progress Unfinished / work in progress label Mar 8, 2024
@iav
Copy link
Contributor Author

iav commented Mar 8, 2024

Currently "Repeat Build Options" in case of break prints 2 times:

[🐳|🌱] Installing base system with 9 packages [ Stage 1/2 ]
[🐳|🔨]   I: Retrieving InRelease
[🐳|🔨]   I: Checking Release signature
[🐳|🔨]   I: Valid Release signature (key id A7236886F3CCCAAD148A27F80E98404D386FA1D9)
[🐳|🔨]   I: Retrieving Packages
[🐳|🔨]   I: Validating Packages
^C[🐳|🚸] Build interrupted [ Build interrupted by SIGINT ]
[🐳|💥] error! [ Debootstrap first stage failed /armbian/cache/sources/debootstrap-debian-devel/debootstrap trixie  kde-plasma no ]
[🐳|💥] Cleaning up [ please wait for cleanups to finish ]
[🐳|🌿] Unmounting recursively [ SDCARD - be patient ]
[🐳|🌿] Unmounting recursively [ MOUNT - be patient ]
[🐳|✨] Repeat Build Options [ ./compile.sh iav build BOARD=rockpi-4a BUILD_DESKTOP=yes DESKTOP_APPGROUPS_SELECTED= DESKTOP_ENVIRONMENT=kde-plasma DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base RELEASE=trixie ]
[🐳|🌿] ANSI log file built; inspect it by running: [ less -RS output/logs/log-build-bb926850-d130-40d0-afea-83c1f021e422.log.ans ]
[🐳|🌱] SHARE_LOG=yes, uploading log [ uploading logs ]
[🐳|🌿] Log uploaded, share URL: [ https://paste.armbian.com/iqayakawiw ]
[💥] -------------Docker run failed after 27s-------------------------- [ 🐳 failed ]
[🌱] Cleaning up [ please wait for cleanups to finish ]
[✨] Repeat Build Options [ ./compile.sh iav build BOARD=rockpi-4a BUILD_DESKTOP=yes DESKTOP_ENVIRONMENT=kde-plasma DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base RELEASE=trixie ]

Seems print operator added to the wrong place.
Please recommend better place to output this info in case of break or error.

@github-actions github-actions bot added the size/small PR with less then 50 lines label Mar 8, 2024
@igorpecovnik
Copy link
Member

IMO better is at the end.

@igorpecovnik igorpecovnik added the Discussion Being discussed - Voice your opinions :) label Mar 8, 2024
@iav
Copy link
Contributor Author

iav commented Mar 8, 2024

Confirm, better in the end. But I add one string into one place :)
How to avoid one of 2 occurrence — not idea for a while.

@rpardini
Copy link
Member

rpardini commented Mar 9, 2024

How to avoid one of 2 occurrence

Yeah, compare:

[🐳|✨] Repeat Build Options [... ]
...
[✨] Repeat Build Options [ ... ]

One has a whale while the other doesn't.
It's the same code running both during the launcher (your actual compile invocation, without the whale) and inside Docker , with the whale).

@iav
Copy link
Contributor Author

iav commented Mar 10, 2024

Insert print into end entrypoint.sh, after run_cleanup_handlers?

@iav
Copy link
Contributor Author

iav commented Mar 10, 2024

Next try:

diff --git a/lib/functions/cli/entrypoint.sh b/lib/functions/cli/entrypoint.sh
index a1ca19383..0655b446f 100644
--- a/lib/functions/cli/entrypoint.sh
+++ b/lib/functions/cli/entrypoint.sh
@@ -179,4 +179,10 @@ function cli_entrypoint() {
        # Build done, run the cleanup handlers explicitly.
        # This zeroes out the list of cleanups, so it"s not done again when the main script exits normally and trap = 0 runs.
        run_cleanup_handlers
+
+       # Gather repeat build args, included in the logs.
+#      declare -g repeat_args=()
+       produce_repeat_args_array # produces repeat_args
+       declare repeat_args_string="${repeat_args[*]}"
+       display_alert "Repeat Build Options" "${repeat_args[*]}" "ext" # * = expand array, space delimited, single-word.
 }

I see it prints string I use as command line, not string need to repeat build. It's not the same if some parameter entered via menu. Example:
command line:
./compile.sh iav BOARD=rockpi-4a BUILD_DESKTOP=yes DESKTOP_ENVIRONMENT= DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base RELEASE=
Repeat Build Options:
./compile.sh iav build BOARD=rockpi-4a BUILD_DESKTOP=yes DESKTOP_APPGROUPS_SELECTED='browsers multimedia office remote_desktop' DESKTOP_ENVIRONMENT=kde-plasma DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base RELEASE=jammy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Being discussed - Voice your opinions :) size/small PR with less then 50 lines Work in progress Unfinished / work in progress
Development

Successfully merging this pull request may close these issues.

3 participants