lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2025

  • 1 participants
  • 1491 discussions
[XS] Change in libosmo-netif[master]: stream: Undeprecate osmo_stream_srv_set_segmentation_cb()
by pespin 24 Jan '25

24 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39412?usp=email ) Change subject: stream: Undeprecate osmo_stream_srv_set_segmentation_cb() ...................................................................... stream: Undeprecate osmo_stream_srv_set_segmentation_cb() It has been decided that it's convenient to use the older segmentation_cb() callback when user wants to segment traffic which doesn't require any external pointer (like IPA), since then less glue code is needed to call the relevant segmentation functions. Change-Id: Icec7ed9e16eb92a2384c16ff5b3e7011205e767c --- M include/osmocom/netif/stream.h M src/stream_cli.c M src/stream_srv.c 3 files changed, 2 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/12/39412/1 diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index 83f17d7..91a9b5e 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -140,7 +140,7 @@ void osmo_stream_srv_set_flush_and_destroy(struct osmo_stream_srv *conn); void osmo_stream_srv_set_data(struct osmo_stream_srv *conn, void *data); -void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb_t segmentation_cb) OSMO_DEPRECATED("Use osmo_stream_srv_set_segmentation_cb2() instead"); +void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb_t segmentation_cb); void osmo_stream_srv_set_segmentation_cb2(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb2_t segmentation_cb2); void osmo_stream_srv_send(struct osmo_stream_srv *conn, struct msgb *msg); @@ -228,7 +228,7 @@ void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, osmo_stream_cli_disconnect_cb_t disconnect_cb); void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, osmo_stream_cli_read_cb_t read_cb); void osmo_stream_cli_set_read_cb2(struct osmo_stream_cli *cli, osmo_stream_cli_read_cb2_t read_cb); -void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) OSMO_DEPRECATED("Use osmo_stream_cli_set_segmentation_cb2() instead"); +void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb); void osmo_stream_cli_set_segmentation_cb2(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb2_t segmentation_cb2); void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli); bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli); diff --git a/src/stream_cli.c b/src/stream_cli.c index 586b1b0..6628ad7 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -821,7 +821,6 @@ * \param[in,out] cli Stream Client to modify * \param[in] segmentation_cb Target segmentation callback * - * DEPRECATED: Use osmo_cli_set_segmentation_cb2() instead. */ void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) diff --git a/src/stream_srv.c b/src/stream_srv.c index 261539b..05f780c 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -1104,8 +1104,6 @@ * \param[in,out] conn Target Stream Server to modify * \param[in] segmentation_cb Segmentation callback to be set * - * DEPRECATED: Use osmo_stream_srv_set_segmentation_cb2() instead. - * * A segmentation call-back can optionally be used when a packet based protocol (like TCP) is used within a * STREAM style socket that does not preserve message boundaries within the stream. If a segmentation * call-back is given, the osmo_stream_srv library code will makes sure that the read_cb called only for -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39412?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Icec7ed9e16eb92a2384c16ff5b3e7011205e767c Gerrit-Change-Number: 39412 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-netif[master]: stream: osmo_stream_{cli,srv}_set_segmentation_cb(2): documentation i...
by pespin 24 Jan '25

24 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39413?usp=email ) Change subject: stream: osmo_stream_{cli,srv}_set_segmentation_cb(2): documentation improvements ...................................................................... stream: osmo_stream_{cli,srv}_set_segmentation_cb(2): documentation improvements * Wrap lines to a shorter width * Improve osmo_stream_cli_set_segmentation_cb() adding text available in osmo_stream_srv_set_segmentation_cb() * Refer to segmentation_cb in segmentation_cb2 documentation and only outline the differences. Change-Id: I55eb9a7781c22db68446265d2a174ae4f5e9f6ef --- M src/stream_cli.c M src/stream_srv.c 2 files changed, 21 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/13/39413/1 diff --git a/src/stream_cli.c b/src/stream_cli.c index 6628ad7..fa3ac76 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -821,6 +821,11 @@ * \param[in,out] cli Stream Client to modify * \param[in] segmentation_cb Target segmentation callback * + * A segmentation call-back can optionally be used when a packet based protocol + * (like TCP) is used within a STREAM style socket that does not preserve + * message boundaries within the stream. If a segmentation call-back is given, + * the osmo_stream_srv library code will makes sure that the read_cb called + * only for complete single messages, and not arbitrary segments of the stream. */ void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) @@ -834,6 +839,10 @@ /*! Set the segmentation callback for the client. * \param[in,out] cli Stream Client to modify * \param[in] segmentation_cb2 Target segmentation callback + * + * Same as osmo_stream_cli_set_segmentation_cb(), but a + * osmo_stream_cli_segmentation_cb2_t is called instead which allows access to + * the related cli object. */ void osmo_stream_cli_set_segmentation_cb2(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb2_t segmentation_cb2) diff --git a/src/stream_srv.c b/src/stream_srv.c index 05f780c..366fe64 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -1104,13 +1104,15 @@ * \param[in,out] conn Target Stream Server to modify * \param[in] segmentation_cb Segmentation callback to be set * - * A segmentation call-back can optionally be used when a packet based protocol (like TCP) is used within a - * STREAM style socket that does not preserve message boundaries within the stream. If a segmentation - * call-back is given, the osmo_stream_srv library code will makes sure that the read_cb called only for - * complete single messages, and not arbitrary segments of the stream. + * A segmentation call-back can optionally be used when a packet based protocol + * (like TCP) is used within a STREAM style socket that does not preserve + * message boundaries within the stream. If a segmentation call-back is given, + * the osmo_stream_srv library code will makes sure that the read_cb called + * only for complete single messages, and not arbitrary segments of the stream. * - * This function only works with osmo_stream_srv in osmo_io mode, created by osmo_stream_srv_create2()! - * The connection has to have been established prior to calling this function. + * This function only works with osmo_stream_srv in osmo_io mode, created by + * osmo_stream_srv_create2()! The connection has to have been established prior + * to calling this function. * */ void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn, @@ -1128,16 +1130,12 @@ * \param[in,out] conn Target Stream Server to modify * \param[in] segmentation_cb2 Segmentation callback to be set * - * A segmentation call-back can optionally be used when a packet based protocol (like TCP) is used within a - * STREAM style socket that does not preserve message boundaries within the stream. If a segmentation - * call-back is given, the osmo_stream_srv library code will makes sure that the read_cb called only for - * complete single messages, and not arbitrary segments of the stream. - * - * This function only works with osmo_stream_srv in osmo_io mode, created by osmo_stream_srv_create2()! - * The connection has to have been established prior to calling this function. + * Same as osmo_stream_srv_set_segmentation_cb(), but a + * osmo_stream_srv_segmentation_cb2_t is called instead which allows access to + * the related conn object. */ void osmo_stream_srv_set_segmentation_cb2(struct osmo_stream_srv *conn, - osmo_stream_srv_segmentation_cb2_t segmentation_cb2) + osmo_stream_srv_segmentation_cb2_t segmentation_cb2) { /* Note that the following implies that iofd != NULL, since * osmo_stream_srv_create2() creates the iofd member, too */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39413?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I55eb9a7781c22db68446265d2a174ae4f5e9f6ef Gerrit-Change-Number: 39413 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmocore[master]: tests/osmo_io: Rework test_file()
by pespin 24 Jan '25

24 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39411?usp=email ) Change subject: tests/osmo_io: Rework test_file() ...................................................................... tests/osmo_io: Rework test_file() The amount of read and write on each callback is actually not really managed by us but by the kernel. Instead of validating the amount of read/write callbacks, monitor the amount of read/write bytes (and also make sure the received a final read with len=0 to signal EOF). Add fflush(stdout) before calling ASSERT to make sure stdout is flushed before terminating the program. Related: SYS#6708 Change-Id: Ie1e686b407532eee76a8692dfc632af73183e614 --- M tests/osmo_io/osmo_io_test.c 1 file changed, 23 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/39411/1 diff --git a/tests/osmo_io/osmo_io_test.c b/tests/osmo_io/osmo_io_test.c index 82de564..d072ebe 100644 --- a/tests/osmo_io/osmo_io_test.c +++ b/tests/osmo_io/osmo_io_test.c @@ -20,6 +20,7 @@ #include <stdio.h> #include <stdint.h> +#include <stdbool.h> #include <stdlib.h> #include <unistd.h> #include <string.h> @@ -45,18 +46,23 @@ static void *ctx = NULL; -static unsigned file_read_wr_compl_counter = 0; +static unsigned file_bytes_read = 0; +static unsigned file_bytes_write_compl = 0; +static bool file_eof_read = false; static void file_read_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) { printf("%s: read() msg with rc=%d\n", osmo_iofd_get_name(iofd), rc); if (rc < 0) printf("%s: error: %s\n", osmo_iofd_get_name(iofd), strerror(-rc)); - if (msg) + if (msg) { printf("%s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); - file_read_wr_compl_counter++; - talloc_free(msg); - if (rc == 0) + file_bytes_read += msgb_length(msg); + talloc_free(msg); + } + if (rc == 0) { + file_eof_read = true; osmo_iofd_close(iofd); + } } static void file_write_cb(struct osmo_io_fd *iofd, int rc, struct msgb *msg) @@ -64,9 +70,10 @@ printf("%s: write() returned rc=%d\n", osmo_iofd_get_name(iofd), rc); if (rc < 0) printf("%s: error: %s\n", osmo_iofd_get_name(iofd), strerror(-rc)); - if (msg) + if (msg) { printf("%s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); - file_read_wr_compl_counter++; + file_bytes_write_compl += msgb_length(msg); + } } static void test_file(void) @@ -97,12 +104,13 @@ osmo_iofd_write_msgb(iofd, msg); /* Allow enough cycles to handle the messages */ for (int i = 0; i < 128; i++) { - OSMO_ASSERT(file_read_wr_compl_counter <= 1); - if (file_read_wr_compl_counter == 1) + OSMO_ASSERT(file_bytes_write_compl <= sizeof(TESTDATA)); + if (file_bytes_write_compl == sizeof(TESTDATA)) break; osmo_select_main(1); } - OSMO_ASSERT(file_read_wr_compl_counter == 1); + fflush(stdout); + OSMO_ASSERT(file_bytes_write_compl == sizeof(TESTDATA)); /* Now, re-configure iofd to only read from the fd. Adjust the read/write offset beforehand: */ printf("Enable read\n"); @@ -113,12 +121,14 @@ OSMO_ASSERT(rc == 0); /* Allow enough cycles to handle the message. We expect 2 reads, 2nd read will return 0. */ for (int i = 0; i < 128; i++) { - OSMO_ASSERT(file_read_wr_compl_counter <= 3); - if (file_read_wr_compl_counter == 3) + OSMO_ASSERT(file_bytes_read <= sizeof(TESTDATA)); + if (file_bytes_read == sizeof(TESTDATA) && file_eof_read) break; osmo_select_main(1); } - OSMO_ASSERT(file_read_wr_compl_counter == 3); + fflush(stdout); + OSMO_ASSERT(file_bytes_read == sizeof(TESTDATA)); + OSMO_ASSERT(file_eof_read); osmo_iofd_free(iofd); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39411?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ie1e686b407532eee76a8692dfc632af73183e614 Gerrit-Change-Number: 39411 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-sigtran[master]: Implement ASP loadsharing
by osmith 24 Jan '25

24 Jan '25
Attention is currently required from: daniel, fixeria, laforge, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?usp=email ) Change subject: Implement ASP loadsharing ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I5f47e40b70ed566034cd1533b71e21fc03e94f6c Gerrit-Change-Number: 39408 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 11:44:40 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-sigtran[master]: Pass xua_msg down to xua_as_transmit_msg
by osmith 24 Jan '25

24 Jan '25
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398?usp=email ) Change subject: Pass xua_msg down to xua_as_transmit_msg ...................................................................... Patch Set 2: Code-Review+1 (1 comment) File src/xua_as_fsm.h: https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398/comment/7e8f2f37_e2dee… : PS2, Line 17: ownsership transferred. ```suggestion XUA_AS_E_TRANSFER_REQ, /* param: struct xua_msg*, ownership transferred */ ``` -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I70e5d33c7537dc0b72b5abced876e69018cc0829 Gerrit-Change-Number: 39398 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 11:28:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-sigtran[master]: Pass ownership of Rx xua_msg up the stack [2/2]
by osmith 24 Jan '25

24 Jan '25
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397?usp=email ) Change subject: Pass ownership of Rx xua_msg up the stack [2/2] ...................................................................... Patch Set 2: (6 comments) File src/ipa.c: https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397/comment/29f5077a_e90f7… : PS2, Line 304: ownsership ```suggestion * xua ownership is passed here: */ ``` File src/m3ua.c: https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397/comment/dffd42dd_90bd5… : PS2, Line 627: ownsership ```suggestion /* xua ownership is passed here: */ ``` https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397/comment/07ee013d_bb213… : PS2, Line 784: goto out; missing `xua_msg_free(xua);` since it doesn't go through any `m3ua_rx_*`? https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397/comment/8d4a16fc_3800a… : PS2, Line 815: err = m3ua_gen_error_msg(M3UA_ERR_UNSUPP_MSG_CLASS, msg); missing `xua_msg_free(xua);` since it doesn't go through any `m3ua_rx_*`? https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397/comment/281384d5_b2152… : PS2, Line 1015: return M3UA_ERR_UNSUPP_MSG_TYPE; ```suggestion rc = M3UA_ERR_UNSUPP_MSG_TYPE; ``` https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397/comment/ab8840ca_076b4… : PS2, Line 1019: return M3UA_ERR_UNSUPP_MSG_TYPE; ```suggestion rc = M3UA_ERR_UNSUPP_MSG_TYPE; ``` -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39397?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: Icf3b4dda550637f722a9fe56d0313f49c8a2964e Gerrit-Change-Number: 39397 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 11:15:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in libosmo-sigtran[master]: Pass ownership of Tx xua_msg down the stack [1/2]
by osmith 24 Jan '25

24 Jan '25
Attention is currently required from: daniel, fixeria, laforge, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39396?usp=email ) Change subject: Pass ownership of Tx xua_msg down the stack [1/2] ...................................................................... Patch Set 2: Code-Review+1 (1 comment) Patchset: PS2: The patch looks good to me. Since these are just internal changes in libosmo-sigtran (from what I can tell no Osmocom program/library is using the modified functions directly outside of libosmo-sigtran, even the non-static ones) and Pau said that all tests pass with this, it should be fine to merge this IMHO if Harald is fine with the architectural change. -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39396?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I49e718e624da08510a9c3d28bdb360c59f9a65d3 Gerrit-Change-Number: 39396 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 11:00:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-dev[master]: gen_makefile: modernize gen_make
by osmith 24 Jan '25

24 Jan '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/39403?usp=email ) Change subject: gen_makefile: modernize gen_make ...................................................................... gen_makefile: modernize gen_make Use an f-string instead of .format() to make it more maintainable. Change-Id: I03350986c07226889b618869ec74a95be8712e3e --- M gen_makefile.py 1 file changed, 44 insertions(+), 41 deletions(-) Approvals: osmith: Looks good to me, approved; Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve diff --git a/gen_makefile.py b/gen_makefile.py index 4a4748c..e1baa5b 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -424,62 +424,65 @@ sudo_ldconfig = '' if ldconfig_without_sudo else 'sudo ' sudo_make_install = 'sudo ' if sudo_make_install else '' - return r''' + return f''' ### {proj} ### -{proj}_configure_files := $(shell find -L {src_proj} \ - -name "Makefile.am" \ - -or -name "*.in" \ - -and -not -name "Makefile.in" \ +{proj}_configure_files := $(shell find -L {src_proj} \\ + -name "Makefile.am" \\ + -or -name "*.in" \\ + -and -not -name "Makefile.in" \\ -and -not -name "config.h.in" 2>/dev/null) -{proj}_files := $(shell find -L {src_proj} \ - \( \ - -name "*.[hc]" \ - -or -name "*.py" \ - -or -name "*.cpp" \ - -or -name "*.tpl" \ - -or -name "*.map" \ - -or -name "*.erl" \ - \) \ +{proj}_files := $(shell find -L {src_proj} \\ + \\( \\ + -name "*.[hc]" \\ + -or -name "*.py" \\ + -or -name "*.cpp" \\ + -or -name "*.tpl" \\ + -or -name "*.map" \\ + -or -name "*.erl" \\ + \\) \\ -and -not -name "config.h" 2>/dev/null) -{clone_rule} +{gen_makefile_clone(proj, src, src_proj, url, push_url)} -{autoconf_rule} +{gen_makefile_autoconf(proj, src_proj, distclean_cond)} -{configure_rule} +{gen_makefile_configure(proj, + deps_installed, + distclean_cond, + build_proj, + cflags, + docker_cmd, + build_to_src, + configure_opts_str)} -{build_rule} +{gen_makefile_build(proj, + distclean_cond, + build_proj, + docker_cmd, + jobs, + check, + src_proj)} -{install_rule} +{gen_makefile_install(proj, + docker_cmd, + sudo_make_install, + build_proj, + no_ldconfig, + sudo_ldconfig)} -{reinstall_rule} +{gen_makefile_reinstall(proj, + deps_reinstall, + sudo_make_install, + build_proj)} -{clean_rule} +{gen_makefile_clean(proj, build_proj)} -{distclean_rule} +{gen_makefile_distclean(proj, src_proj)} .PHONY: {proj} {proj}: .make.{proj}.install - -'''.format( - proj=proj, - src_proj=src_proj, - clone_rule=gen_makefile_clone(proj, src, src_proj, url, push_url), - autoconf_rule=gen_makefile_autoconf(proj, src_proj, distclean_cond), - configure_rule=gen_makefile_configure(proj, deps_installed, distclean_cond, - build_proj, cflags, docker_cmd, - build_to_src, configure_opts_str), - build_rule=gen_makefile_build(proj, distclean_cond, build_proj, docker_cmd, - jobs, check, src_proj), - install_rule=gen_makefile_install(proj, docker_cmd, sudo_make_install, - build_proj, no_ldconfig, sudo_ldconfig), - reinstall_rule=gen_makefile_reinstall(proj, deps_reinstall, - sudo_make_install, build_proj), - clean_rule=gen_makefile_clean(proj, build_proj), - distclean_rule=gen_makefile_distclean(proj, src_proj), - ) - +''' projects_deps = read_projects_deps(all_deps_file) projects_urls = read_projects_dict(all_urls_file) -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39403?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I03350986c07226889b618869ec74a95be8712e3e Gerrit-Change-Number: 39403 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-dev[master]: gen_makefile: modernize gen_make
by osmith 24 Jan '25

24 Jan '25
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-dev/+/39403?usp=email ) Change subject: gen_makefile: modernize gen_make ...................................................................... Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39403?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I03350986c07226889b618869ec74a95be8712e3e Gerrit-Change-Number: 39403 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 10:14:34 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-dev[master]: gen_makefile: modernize generator for "regen"
by osmith 24 Jan '25

24 Jan '25
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/39402?usp=email ) Change subject: gen_makefile: modernize generator for "regen" ...................................................................... gen_makefile: modernize generator for "regen" Use f-string instead of .format() to make it more maintainable. Change-Id: I345d2ae64a0afd5fe71d483c7dfe6a2ce2248c74 --- M gen_makefile.py 1 file changed, 50 insertions(+), 50 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, approved; Verified laforge: Looks good to me, but someone else must approve diff --git a/gen_makefile.py b/gen_makefile.py index 7d73df8..4a4748c 100755 --- a/gen_makefile.py +++ b/gen_makefile.py @@ -513,45 +513,45 @@ configure_opts_args += f' \\\n\t\t{os.path.relpath(f, make_dir)}' # convenience: add a regen target that updates the generated makefile itself -content += r''' +content += f''' default: usrp # # Convenience targets for whole networks # .PHONY: cn -cn: \ - osmo-ggsn \ - osmo-hlr \ - osmo-iuh \ - osmo-mgw \ - osmo-msc \ - osmo-sgsn \ - osmo-sip-connector \ - osmo-smlc \ +cn: \\ + osmo-ggsn \\ + osmo-hlr \\ + osmo-iuh \\ + osmo-mgw \\ + osmo-msc \\ + osmo-sgsn \\ + osmo-sip-connector \\ + osmo-smlc \\ $(NULL) .PHONY: cn-bsc -cn-bsc: \ - cn \ - osmo-bsc \ +cn-bsc: \\ + cn \\ + osmo-bsc \\ $(NULL) .PHONY: cn-bsc-nat -cn-bsc-nat: \ - cn \ - mobile \ - osmo-bsc \ - osmo-bsc-nat \ - osmo-bts \ - virtphy \ +cn-bsc-nat: \\ + cn \\ + mobile \\ + osmo-bsc \\ + osmo-bsc-nat \\ + osmo-bts \\ + virtphy \\ $(NULL) .PHONY: usrp -usrp: \ - cn-bsc \ - osmo-bts \ - osmo-trx \ +usrp: \\ + cn-bsc \\ + osmo-bts \\ + osmo-trx \\ $(NULL) # @@ -577,33 +577,33 @@ # regenerate this Makefile, in case the deps or opts changed .PHONY: regen regen: - {script} \ - {configure_opts} \ - --output {makefile} \ - --src-dir {src_dir} \ - --make-dir {make_dir} \ - --build-dir {build_dir} \ - --jobs {jobs} \ - --url "{url}"{push_url}{sudo_make_install}{no_ldconfig}{ldconfig_without_sudo}{make_check}{docker_cmd}{build_debug}{auto_distclean} + {os.path.relpath(sys.argv[0], make_dir)} \\ + {configure_opts_args} \\ + --output {args.output} \\ + --src-dir {os.path.relpath(args.src_dir, make_dir)} \\ + --make-dir . \\ + --build-dir {os.path.relpath(build_dir, make_dir)} \\ + --jobs {args.jobs} \\ + --url "{args.url}" \\ +''' -'''.format( - script=os.path.relpath(sys.argv[0], make_dir), - configure_opts=configure_opts_args, - make_dir='.', - makefile=args.output, - src_dir=os.path.relpath(args.src_dir, make_dir), - build_dir=os.path.relpath(build_dir, make_dir), - jobs=args.jobs, - url=args.url, - push_url=(" \\\n\t\t--push-url '%s'"%args.push_url) if args.push_url else '', - sudo_make_install=' \\\n\t\t--sudo-make-install' if args.sudo_make_install else '', - no_ldconfig=' \\\n\t\t--no-ldconfig' if args.no_ldconfig else '', - ldconfig_without_sudo=' \\\n\t\t--ldconfig-without-sudo' if args.ldconfig_without_sudo else '', - make_check='' if args.make_check else " \\\n\t\t--no-make-check", - docker_cmd=f' \\\n\t\t--docker-cmd "{args.docker_cmd}"' if args.docker_cmd else '', - build_debug=' \\\n\t\t--build-debug' if args.build_debug else '', - auto_distclean=' \\\n\t\t--auto-distclean' if args.auto_distclean else '', -) +if args.push_url: + content += f" --push-url {shlex.quote(args.push_url)} \\\n" +if args.sudo_make_install: + content += " --sudo-make-install \\\n" +if args.no_ldconfig: + content += " --no-ldconfig \\\n" +if args.ldconfig_without_sudo: + content += " --ldconfig-without-sudo \\\n" +if not args.make_check: + content += " --no-make-check \\\n" +if args.docker_cmd: + content += f" --push-url {shlex.quote(args.docker_cmd)} \\\n" +if args.build_debug: + content += " --build-debug \\\n" +if args.auto_distclean: + content += " --auto-distclean \\\n" +content += " $(NULL)\n" # convenience target: clone all repositories first content += 'clone: \\\n\t' + ' \\\n\t'.join([ '.make.%s.clone' % p for p, d in projects_deps ]) + '\n\n' -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39402?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I345d2ae64a0afd5fe71d483c7dfe6a2ce2248c74 Gerrit-Change-Number: 39402 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.