osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/39796?usp=email )
Change subject: lint/lint_diff: run clang-format if config was found
......................................................................
lint/lint_diff: run clang-format if config was found
The osmo-asf4-dfu and osmo-ccid-firmware now have clang-format configs.
Adjust the lint script to run clang-format if such a config is found in
the repository for which the lint script is running.
Change-Id: Ie210966ebfbada43dd8507b9b48218df4925820d
---
M lint/lint_diff.sh
1 file changed, 20 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/lint/lint_diff.sh b/lint/lint_diff.sh
index 9458ca7..60fd8b1 100755
--- a/lint/lint_diff.sh
+++ b/lint/lint_diff.sh
@@ -46,6 +46,25 @@
fi
}
+test_clang_format() {
+ if ! [ -e ".clang-format" ] || ! command -v clang-format >/dev/null; then
+ return
+ fi
+
+ echo "Running clang-format on 'git diff $COMMIT'..."
+ echo
+
+ # Run clang-format-diff and colorize its output
+ local diff="$(git diff -U0 --relative "$COMMIT" \
+ | clang-format-diff -p1 \
+ | sed 's/^-/\x1b[41m-/;s/^+/\x1b[42m+/;s/^@/\x1b[34m@/;s/$/\x1b[0m/')"
+
+ if ! [ -z "$diff" ]; then
+ ERROR=1
+ echo "$diff"
+ fi
+}
+
show_error() {
echo
echo "Please fix the linting errors above. More information:"
@@ -86,6 +105,7 @@
set_commit
test_docker_run_rm
test_checkpatch
+test_clang_format
if [ "$ERROR" = 1 ]; then
show_error
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39796?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ie210966ebfbada43dd8507b9b48218df4925820d
Gerrit-Change-Number: 39796
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/39797?usp=email )
Change subject: lint/lint_diff: allow skipping with OSMO_LINT=0
......................................................................
lint/lint_diff: allow skipping with OSMO_LINT=0
When this script is set as pre-commit hook, it can be useful to skip the
linter with this env var to make a commit that intentionally does not
pass the linter (e.g. to test if it will be caught in gerrit + jenkins).
There is also "git commit --no-verify", but with that the hook that
applies the Change-Id does not run.
Change-Id: Ia4563c13d9916a879a1e8afeacad8c541662adaa
---
M lint/lint_diff.sh
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/lint/lint_diff.sh b/lint/lint_diff.sh
index 60fd8b1..4b95b9f 100755
--- a/lint/lint_diff.sh
+++ b/lint/lint_diff.sh
@@ -5,6 +5,11 @@
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
ERROR=0
+if [ "$OSMO_LINT" = 0 ]; then
+ echo "Skipping lint_diff.sh (OSMO_LINT=0)"
+ exit 0
+fi
+
check_git_dir() {
if [ -z "$GIT_DIR" ]; then
echo "ERROR: path is not a git repository: $PWD"
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39797?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ia4563c13d9916a879a1e8afeacad8c541662adaa
Gerrit-Change-Number: 39797
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/39796?usp=email )
Change subject: lint/lint_diff: run clang-format if config was found
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39796?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ie210966ebfbada43dd8507b9b48218df4925820d
Gerrit-Change-Number: 39796
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Mar 2025 12:35:36 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/39795?usp=email )
Change subject: lint/lint_diff: make use of shell functions
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39795?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: If884f51f20e794397ee0fecff0cf1f958957da05
Gerrit-Change-Number: 39795
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 17 Mar 2025 12:35:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/39789?usp=email )
Change subject: sysmoOCTSIM/README: Describe how to build matching libosmocore
......................................................................
sysmoOCTSIM/README: Describe how to build matching libosmocore
we currently require a libosmocore that's cross-compiled for this
specific embedded target. This information was so far hidden
in contrib/jenkins.sh - let's expose it to README.md (slightly modified
command to install it to /usr/local/arm-none-eabi)
Change-Id: I3392d134ed75dbdd558643aac6d58407e00d23ba
---
M sysmoOCTSIM/README.md
1 file changed, 10 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/sysmoOCTSIM/README.md b/sysmoOCTSIM/README.md
index 1927255..3eae229 100644
--- a/sysmoOCTSIM/README.md
+++ b/sysmoOCTSIM/README.md
@@ -24,7 +24,16 @@
GNU make and the arm-none-eabi-gcc compiler are required to build the firmware.
-The compile the firmware, run the following commands:
+Also, you will need a libosmocore built for arm-none-eabi installed to /usr/local/arm-none-eabi
+
+You can use the following commands (in the libosmocore directory) to build
+
+```
+./configure --prefix=/usr/local/arm-none-eabi --enable-static --host=arm-none-eabi --enable-embedded --disable-log-macros --disable-doxygen --disable-shared --disable-pseudotalloc --disable-libsctp --disable-libusb --disable-gb --enable-external-tests CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=cpp -mthumb -Os -mlong-calls -g3 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -I /my/path/to/osmo-ccid-firmware/sysmoOCTSIM -Wno-error=format" CPPFLAGS="-D__thread=''"
+make install
+```
+
+To subsequently compile the firmware, run the following commands (in osmo-ccid-firmware):
```
cd sysmoOCTSIM/gcc
--
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/39789?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I3392d134ed75dbdd558643aac6d58407e00d23ba
Gerrit-Change-Number: 39789
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>