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

feat: 2.0.0 Backport invil 0.1.7 features #88

Merged
merged 72 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e26c121
feat: enforce semver key match
jgabaut Dec 21, 2023
7aa224a
chore: move dot utils
jgabaut Dec 21, 2023
8583bc4
feat: basemode tags use B prefix
jgabaut Dec 21, 2023
4b2fb56
chore: remove 1.6.0 repo support
jgabaut Dec 21, 2023
b738da7
chore: less warning spam
jgabaut Dec 21, 2023
fb0a879
feat: ignore test files without .k extension
jgabaut Dec 22, 2023
c4ff1f7
chore: use 2.0.0-rc1 as version name
jgabaut Dec 22, 2023
09a2f87
fix: return earlier for -v
jgabaut Dec 22, 2023
1bbe995
feat: warn on empty version map
jgabaut Dec 22, 2023
d82a34b
chore: discard stderr for awk -W
jgabaut Dec 22, 2023
6692275
chore: don't return on mawk warn
jgabaut Dec 22, 2023
aa49c29
chore: prettier warn for older bash
jgabaut Dec 22, 2023
a2a3508
chore: add echo_invil_notice()
jgabaut Dec 22, 2023
1aa7ed1
feat: pass CC and CFLAGS to base mode
jgabaut Dec 22, 2023
6029cb1
chore: format env args print
jgabaut Dec 22, 2023
55a36e5
feat: run make with zero args call
jgabaut Dec 22, 2023
dc29e6c
chore: touch up try_doing_make()
jgabaut Dec 22, 2023
d4e9363
feat: add echo_amboso_splash()
jgabaut Dec 22, 2023
4c38e9e
fix: unset AMBOSO_LVL_REC
jgabaut Dec 22, 2023
38080da
chore: fix make call on no-args
jgabaut Dec 22, 2023
6da20e6
chore: nitpicks
jgabaut Dec 22, 2023
179e015
feat: log_cl to unify color output control
jgabaut Dec 22, 2023
cbde96a
chore: handle labeled logs
jgabaut Dec 22, 2023
d0b3165
feat: -P to turn off color output
jgabaut Dec 22, 2023
735e27b
chore: warn on bash 4.x
jgabaut Dec 22, 2023
d71a1f3
chore: refactor milestones_dir
jgabaut Dec 22, 2023
21b895c
feat: -J logs to amboso.log
jgabaut Dec 22, 2023
9f3524c
chore: drop some legacy code
jgabaut Dec 22, 2023
042f784
feat: remove color from amboso sourcing
jgabaut Dec 22, 2023
4ff929c
chore: quoting
jgabaut Dec 22, 2023
d3ab121
feat: pass -P to subcalls
jgabaut Dec 22, 2023
116e3ee
feat: pass -J to subcalls
jgabaut Dec 22, 2023
cf8116b
chore: update source fn in test
jgabaut Dec 22, 2023
7ca328d
chore: add -P to test calls
jgabaut Dec 22, 2023
7124e89
chore: update test records
jgabaut Dec 22, 2023
bedd23e
fix: don't reuse prog_name
jgabaut Dec 23, 2023
a381b96
feat: pass -C when doing init
jgabaut Dec 23, 2023
11453ca
chore: move -C arg check
jgabaut Dec 23, 2023
d3d9e3f
chore: pass unquoted config and verbose flag
jgabaut Dec 23, 2023
b81dcd2
fix: pass -V to purge
jgabaut Dec 23, 2023
e256ea9
feat: -R to turn off make rebuild
jgabaut Dec 23, 2023
ba4e2ee
chore: add dbg info for chosen build command
jgabaut Dec 23, 2023
27663ac
feat: -F to force building a tag
jgabaut Dec 23, 2023
25e7c4b
fix: missing ;;
jgabaut Dec 23, 2023
808f19f
fix: drop leading newline to make log_cl use [
jgabaut Dec 23, 2023
ef3c5d7
chore: bump stego.lock automakevers
jgabaut Dec 23, 2023
cb2e0e1
fix: index for array exp
jgabaut Dec 23, 2023
b8f6ff2
chore: update test records
jgabaut Dec 23, 2023
1f46aa9
chore: use -R in try_anvil
jgabaut Dec 23, 2023
c9b669d
chore: bump version
jgabaut Dec 23, 2023
3f732a6
chore: add tag dir
jgabaut Dec 23, 2023
4ea9afa
chore: use anvil.log for logged run
jgabaut Dec 23, 2023
21e3670
chore: update try_amboso_sourcing
jgabaut Dec 23, 2023
12c1baf
fix: use -V 3 in CI
jgabaut Dec 23, 2023
e9d30c7
chore: -V 2
jgabaut Dec 23, 2023
b93c5f0
feat: refactor verbose_flag to default to 3
jgabaut Dec 24, 2023
159f521
chore: drop some legacy code
jgabaut Dec 24, 2023
fd36a1f
chore: use -V in workflows
jgabaut Dec 24, 2023
cc0f769
fix: init command reports success
jgabaut Dec 24, 2023
791f06f
chore: use escaped tags for Makefile.am generation
jgabaut Dec 24, 2023
62be7ab
fix: current version on -V 4
jgabaut Dec 24, 2023
b854d7e
chore: ask for symlink on -V 4
jgabaut Dec 24, 2023
bc1f837
chore: no env display on -V 3
jgabaut Dec 24, 2023
4613e03
chore: report clean status on -V 4
jgabaut Dec 24, 2023
8866ddb
chore: put some logs under -V 4
jgabaut Dec 24, 2023
86a4e08
chore: use -gt 3 for verbose logs
jgabaut Dec 24, 2023
f34baba
chore: echo time fix
jgabaut Dec 24, 2023
7a1fff9
chore: Makefile format
jgabaut Dec 24, 2023
2af7fea
chore: Makefile format
jgabaut Dec 24, 2023
5895e9e
feat: improve help message
jgabaut Dec 24, 2023
84b5fd9
chore: add CHANGELOG
jgabaut Dec 26, 2023
d562245
chore: basename for program in testo macro
jgabaut Dec 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/anviltest-base-init-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: make distcheck

- name: Run ./amboso as base init mode, +verbose (-Bi -V 2)
run: ./amboso -Bi -V 2
run: ./amboso -Bi -V 5
2 changes: 1 addition & 1 deletion .github/workflows/anviltest-base-purge-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: make distcheck

- name: Run ./amboso as base init -> purge mode, +verbose (-Bip -V 2)
run: ./amboso -Bip -V 2
run: ./amboso -Bip -V 5
2 changes: 1 addition & 1 deletion .github/workflows/anviltest-git-init-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: make distcheck

- name: Run ./amboso as git init mode, +verbose (-gi -V 2)
run: ./amboso -gi -V 2
run: ./amboso -gi -V 5
2 changes: 1 addition & 1 deletion .github/workflows/anviltest-git-purge-mode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
run: make distcheck

- name: Run ./amboso as git init -> purge mode, +verbose (-gip -V 2)
run: ./amboso -gip -V 2
run: ./amboso -gip -V 5
2 changes: 1 addition & 1 deletion .github/workflows/anviltest-test-macro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:

- name: (anviltest) use -t test macro flag, +verbose (-tVV)
run: |
./amboso -tVV || echo -e "\033[1;31mFailed.\e[0m\n"
./amboso -t -V 5 || echo -e "\033[1;31mFailed.\e[0m\n"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ anvil__hello_world.h
logic.png
#ignore cfg dot output
amboso_cfg.dot

#ignore logfile
anvil.log
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Changelog

## [2.0.0] - 2023-12-26

### Added
- Add `-P` flag to turn off colored output
- Add `-J` to log output to `anvil.log`
- Add `-R` to turn off `make rebuild` and run `make`
- Add `-F` to force-build a tag
- Run `make` when no arguments are provided
- Closes #87
- Warn on empty version map
- Warn for detected `mawk`
- Closes #58
- Warn for `bash 4.x`
- Closes #21

### Changed
- Deprecate using `-ti` to record tests
- Closes #91
- Force `stego.lock` version tags to be strict semver
- Closes #85
- Run `make rebuild` by default
- Change base mode tags name prefix from `-` to `B`
- Pass `CC` and `CFLAGS` to base mode build
- Closes #5
- Ignore tests with no `.k` extension
- Closes #84
- Unify output format to `log_cl`
- Closes #92
- Colorless amboso sourcing
- Return earlier for `-v`
- Drop `$milestones_dir`
- Drop some comment legacy code
- Generated `.gitignore` for `init` subcommand includes `invil.log`, `anvil.log`
- `verbose_flag` defaults to `3` and allows `[0-5]`
- Closes #90
- Better error messages when sourcing a deprecated `amboso_fn`
- Closes #82
- Closes #80
- Closes #81
- Closes #83
- Improved help message

### Fixed

- Pass `-C` arguments when doing init
- Closes #89
- Proper pass of `-V <LVL>` to subcalls
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export SHELL=/bin/bash

VERSION="1.9.9"
ANVIL_C_HEADER_VERSION="1.9.9"
VERSION="2.0.0"
ANVIL_C_HEADER_VERSION="2.0.0"

ECHO_VERSION="./amboso"
RUN_VERSION := $(shell $(ECHO_VERSION) -qv)
Expand Down Expand Up @@ -53,7 +53,8 @@ pack: hello_world
install:
@echo -en "Installing amboso $(VERSION) globally as 'anvil': "
install "./amboso" /usr/local/bin/anvil
@echo -en "Installing amboso_fn.sh $(VERSION) globally as inside '/usr/local/bin':"
@echo -e "\033[1;33mDone.\e[0m"
@echo -en "Installing amboso_fn.sh $(VERSION) globally as inside '/usr/local/bin': "
install "./amboso_fn.sh" /usr/local/bin/
@echo -e "\033[1;33mDone.\e[0m"

Expand Down
56 changes: 34 additions & 22 deletions amboso
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ kernel_release="$(uname -r)"
kernel_version="$(uname -v)"
machine_name="$(uname -m)"
os_name="$(uname -o)"
amboso_currvers="1.9.9"
expected_AMBOSO_API_LVL="1.9.9"
amboso_testflag_version="1.9.9"
amboso_currvers="2.0.0"
expected_AMBOSO_API_LVL="2.0.0"
amboso_testflag_version="2.0.0"
verbose_flag=0
tell_uname_flag=0
quiet_flag=0
Expand All @@ -41,54 +41,54 @@ source_amboso_api() {
if [ "$(basename "$(pwd)")" = "amboso" ] ; then {
amboso_fn_path="$(realpath "$(pwd)")/amboso_fn.sh"
if [ -f "$amboso_fn_path" ] ; then {
[ "$verbose_flag" -gt 1 ] && printf "\033[0;35m[PREP] Running inside amboso dir. Sourcing: \"%s\".\e[0m\n" "$amboso_fn_path">&2
[ "$verbose_flag" -gt 1 ] && printf "[PREP] Running inside amboso dir. Sourcing: \"%s\".\n" "$amboso_fn_path">&2
# shellcheck source=./amboso_fn.sh
. "${amboso_fn_path}";
source_res="$?"
if [ "$source_res" -ne 0 ] ; then {
printf "\033[1;31m[PREP] Failed loading amboso_fn.\n\n Using file: \"%s\".\e[0m\n" "$amboso_fn_path" >&2
printf "[PREP] Failed loading amboso_fn.\n\n Using file: \"%s\".\n" "$amboso_fn_path" >&2
exit 3
}
fi
} else {
printf "\033[1;31m[ERROR] Couldn't load amboso_fn, check your symlinks.\e[0m\n"
printf "[ERROR] Could not load amboso_fn, check your symlinks.\e[0m\n"
exit 2
}
fi
} else {
amboso_fn_path="$(realpath "$(pwd)")/amboso/amboso_fn.sh"
found_amboso_dir=0
[ "$verbose_flag" -gt 1 ] && printf "\033[0;33m[PREP] Assuming we are running in super-repo. Sourcing: \"%s\".\e[0m\n" "$amboso_fn_path" >&2
[ "$verbose_flag" -gt 1 ] && printf "[PREP] Assuming we are running in super-repo. Sourcing: \"%s\".\n" "$amboso_fn_path" >&2
if [ -d "$(realpath "$(pwd)")"/amboso ]; then {
found_amboso_dir=1
}
fi
[ "$verbose_flag" -gt 1 ] && [ "$found_amboso_dir" -gt 0 ] && printf "\033[0;32m[PREP] Found amboso dir.\e[0m\n" >&2
[ "$verbose_flag" -gt 1 ] && [ "$found_amboso_dir" -gt 0 ] && printf "[PREP] Found amboso dir.\n" >&2
if [ -f "$amboso_fn_path" ] ; then {
[ "$verbose_flag" -gt 1 ] && printf "\033[0;35m[PREP] Valid file at: \"%s\".\e[0m\n" "$amboso_fn_path" >&2
[ "$verbose_flag" -gt 1 ] && printf "[PREP] Valid file at: \"%s\".\n" "$amboso_fn_path" >&2
# shellcheck source=./amboso_fn.sh
. "${amboso_fn_path}";
source_res="$?"
[ "$source_res" -ne 0 ] && printf "\033[1;31m[PREP] Failed loading amboso_fn.\n\n Using file: \"%s\".\e[0m\n" "$amboso_fn_path" >&2
[ "$source_res" -ne 0 ] && printf "[PREP] Failed loading amboso_fn.\n\n Using file: \"%s\".\n" "$amboso_fn_path" >&2
} else {
[ "$quiet_flag" -eq 0 ] && printf "\033[0;31m[WARN] \"%s\" was not a valid file. Not in valid super-repo.\e[0m\n" "$amboso_fn_path" >&2
[ "$quiet_flag" -eq 0 ] && printf "[WARN] \"%s\" was not a valid file. Not in valid super-repo.\n" "$amboso_fn_path" >&2
try_default=1
}
fi
if [ "$try_default" -eq 1 ] && [ -f "/usr/local/bin/amboso_fn.sh" ] ; then { #We only enter here if we failed sourcing
#We need one more error message to show me are missing functions because of an amboso directory with no file.
if [ "$found_amboso_dir" -gt 0 ] ; then {
printf "\033[1;31m[WARN] Deprecated amboso dir (< 1.4.3) found, as it doesn't provide a function api marker.\e[0m\n\n" >&2
printf "[WARN] Deprecated amboso dir (< 1.4.3) found, as it doesn't provide a function api marker.\n" >&2
exit 3
}
fi
amboso_fn_path="/usr/local/bin/amboso_fn.sh"
[ "$quiet_flag" -eq 0 ] && printf "\033[0;35m[WARN] Fallback to default path for amboso_fn. Sourcing: \"%s\".\e[0m\n" "$amboso_fn_path" >&2
[ "$quiet_flag" -eq 0 ] && printf "[WARN] Fallback to default path for amboso_fn. Sourcing: \"%s\".\n" "$amboso_fn_path" >&2
# shellcheck source=/usr/local/bin/amboso_fn.sh
. "$amboso_fn_path";
source_res="$?"
if [ "$source_res" -ne 0 ] ; then {
printf "\033[1;31m[PREP] Failed loading amboso_fn. Quitting.\n\n Using file: \"%s\".\e[0m\n" "$amboso_fn_path" >&2
printf "[PREP] Failed loading amboso_fn. Quitting.\n\n Using file: \"%s\".\n" "$amboso_fn_path" >&2
exit 3
}
fi
Expand All @@ -98,23 +98,35 @@ source_amboso_api() {
fi

if [ "$source_res" -ne 0 ] ; then {
printf "\033[1;31m[PANIC] Failed sourcing amboso_fn. Expected path: \"%s\".\e[0m\n" "$amboso_fn_path"
printf "[PANIC] Failed sourcing amboso_fn. Expected path: \"%s\".\n" "$amboso_fn_path"
exit 2
}
fi
[ "$verbose_flag" -gt 1 ] && printf "\033[0;32m[PREP] Done loading functions.\e[0m\n" >&2
[ "$verbose_flag" -gt 1 ] && printf "\033[0;37m[PREP] \"\$AMBOSO_API_LVL\" is: (\033[0;34m %s \033[0;37m, expected { \033[1;33m%s\033[0;37m } ).\e[0m\n" "$AMBOSO_API_LVL" "$expected_AMBOSO_API_LVL" >&2
[ "$verbose_flag" -gt 1 ] && printf "[PREP] Done loading functions.\n" >&2
[ "$verbose_flag" -gt 1 ] && printf "[PREP] \"\$AMBOSO_API_LVL\" is: ( %s , expected { %s } ).\n" "$AMBOSO_API_LVL" "$expected_AMBOSO_API_LVL" >&2
[ "$tell_uname_flag" -eq 1 ] && print_sysinfo
if expr "'$expected_AMBOSO_API_LVL" \> "'$AMBOSO_API_LVL" >/dev/null ; then {
printf "\033[1;31m[PANIC] AMBOSO_API_LVL not supported. Needed { \033[1;35m%s\033[1;31m } , { \033[1;33m%s\033[1;31m } is too low.\n\n Maybe check your \"amboso_fn.sh\" file.\n\e[0m\n" "$expected_AMBOSO_API_LVL" "$AMBOSO_API_LVL"
printf "\033[1;31m[PANIC] Couldn't load functions. Quitting.\e[0m\n"
printf "[PANIC] AMBOSO_API_LVL not supported. Needed { %s } , { %s } is too low.\n\n Maybe check your \"amboso_fn.sh\" file.\n\n" "$expected_AMBOSO_API_LVL" "$AMBOSO_API_LVL"
if [[ "$AMBOSO_API_LVL" < "1.4.3" ]] ; then {
printf "[WARN] amboso_fn.sh does not contain AMBOSO_API_LVL.\n"
} elif [[ "$AMBOSO_API_LVL" > "1.4.2" && "$AMBOSO_API_LVL" < "1.6.6" ]] ; then {
printf "[WARN] Unstable amboso version detected.\n"
} elif [[ "$AMBOSO_API_LVL" > "1.6.5" && "$AMBOSO_API_LVL" < "1.7.4" ]] ; then {
printf "[WARN] Legacy stego.lock format is not supported.\n"
} elif [[ "$AMBOSO_API_LVL" > "1.7.4" && "$AMBOSO_API_LVL" < "1.9.6" ]] ; then {
printf "[WARN] Incompatible -C flag, test mode\n"
} elif [[ "$AMBOSO_API_LVL" < "2.0.0" ]] ; then {
printf "[WARN] Deprecated amboso 1.x API found.\n"
}
fi
printf "[PANIC] Could not load functions. Quitting.\n"
exit 2
} elif expr "'$AMBOSO_API_LVL" \> "'$expected_AMBOSO_API_LVL" >/dev/null ; then {
[ "$verbose_flag" -gt 0 ] && printf "\033[0;31m[WARN] AMBOSO_API_LVL is greater than expected. Needed { \033[1;35m%s\033[0;31m } , { \033[1;34m%s\033[0;31m } is higher.\e[0m\n" "$expected_AMBOSO_API_LVL" "$AMBOSO_API_LVL" >&2
[ "$verbose_flag" -gt 0 ] && printf "\n\033[1;31m[WARN] Continuing run with unexpected AMBOSO_API_LVL: Needed { \033[1;35m%s\033[1;31m } , { \033[1;34m%s\033[1;31m } is higher.\e[0m\n" "$expected_AMBOSO_API_LVL" "$AMBOSO_API_LVL"
[ "$verbose_flag" -gt 0 ] && printf "[WARN] AMBOSO_API_LVL is greater than expected. Needed { %s } , { %s } is higher.\n" "$expected_AMBOSO_API_LVL" "$AMBOSO_API_LVL" >&2
[ "$verbose_flag" -gt 0 ] && printf "\n[WARN] Continuing run with unexpected AMBOSO_API_LVL: Needed { %s } , { %s } is higher.\n" "$expected_AMBOSO_API_LVL" "$AMBOSO_API_LVL"
#exit 2
} elif [ "$AMBOSO_API_LVL" = "$expected_AMBOSO_API_LVL" ] ; then {
[ "$verbose_flag" -gt 0 ] && printf "\033[0;32m[PREP] Running with \"\$AMBOSO_API_LVL\" [ \033[1;35m%s\033[0;32m ]; min is { \033[1;36m%s\033[0;32m }.\e[0m\n" "$AMBOSO_API_LVL" "$expected_AMBOSO_API_LVL" >&2
[ "$verbose_flag" -gt 0 ] && printf "[PREP] Running with \"\$AMBOSO_API_LVL\" [ %s ]; min is { %s }.\e[0m\n" "$AMBOSO_API_LVL" "$expected_AMBOSO_API_LVL" >&2
}
fi
}
Expand Down
Loading