-
Notifications
You must be signed in to change notification settings - Fork 76
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
Misc. build fixes encountered when cross-compiling #418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we could do that. The problem now is that @@ expands only one step so that eg @sysconfdir@
expands to ${prefix}/etc/example.xml
where ${prefix} is not evaluated further. And this is an XML file.
I dont know how to expand it all the way in the configure step?
Alternative would be to evaluate it in runtime/loadtime but that would mean evaluation of $prefix
after parsing the XML. That is more complex and maybe even unsafe.
I noted that this was not covered in regression testing, and the main example is a greyzone wrt being part of the core package.
Nevertheless this needs to be fixed since ioto serves as the main example for others.
util/Makefile.in
Outdated
@@ -95,7 +95,9 @@ APPSRC += clixon_util_yang.c | |||
APPSRC += clixon_util_xpath.c | |||
APPSRC += clixon_util_path.c | |||
APPSRC += clixon_util_datastore.c | |||
ifdef with_libxml2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is too restrictive. clixon_util_regexp is needed in the regexp tests also for non-libxml2 regexps (ie posix regexps).
Preferably it should be enough with the HAVE_LIBXML2 define inside the code of clixon_util_regexp.c, so that only posix regexps are run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll fix that, no problem!
configure.ac
Outdated
@@ -228,6 +229,9 @@ if test "$ac_enable_publish" = "yes"; then | |||
AC_CHECK_HEADERS(curl.h,[], AC_MSG_ERROR([curl missing])) | |||
AC_CHECK_LIB(curl, curl_global_init,, AC_MSG_ERROR([libcurl missing])) | |||
AC_DEFINE(CLIXON_PUBLISH_STREAMS, 1, [Enable publish of notification streams using SSE and curl]) | |||
with_curl=yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency here is wrong in the original configure.ac.
That is, curl is checked for only if --enable-publish is set.
But --enable-publish is a little-used option while the clxon_util_ applications are necessary for regression testing.
Therefore, the with-curl should be made independent of --enable-publish and also the dependencies on the regression testing should be sorted out, ie the places where clixon_util_stream etc are used in the tests.
My recommendation is to move this out of this PR and add a separate issue on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wanted to keep the diff as small as possible, but you're right I considered refactoring that whole thing first. OK, I'll break out a refactor as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it before I submitted, and it works in my cross-build setup, replacing |
Btw, what do you prefer: force-push to update this PR, or additional commits to see the review comments being addressed? |
Thanks! It would be nice if you have something to share? For example some high-level comparison. We often get the question how clixon compares to other alternatives, but I see no public info. Another info sharing would be wether clixon builds on buildroot and/or how to make it build.
The patches as they were proposed work for the actual target build. However they broke the regression test scripts (and example as s showcase). As long as the regression is embedded inside clixon-core this is a problem. |
Good idea, I'll see what I can do!
When fully integrated and tested out that will be published here: https://github.com/kernelkit/infix/tree/main/package/clixon Currently only the initial packaging is done. We aim to do implement ietf-system and ietf-network yang modules to a certain extent and there will likely be more work on this packaging for that. When we're happy with the result we'll upstream packaging to Buildroot proper.
I'm going for alt. (1). Thank you so much for this initial review! <3 |
Not additional commits |
This patch replaces the hard-coded `-I /usr/include/libxml2` used when building clixon_util_regexp with the output from `xml2-config --cflags`. To support cross-compiling, and preserve backwards compatibility with the `--with-libxml2` option, we allow the user to pass the path to the xml2-config tool as an optional argument. Similar to what python-lxml, and other packages, that rely on libxml2 do. The argument is optional to ensure that we default to use the hard-coded path from before. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Both util/clixon_util_stream.c and lib/src/clixon_stream.c depend on libcurl. The latter has `#ifdef CLIXON_PUBLISH_STREAMS` but the former does not. So `make util` fails without `--enable-publish` if libcurl is not installed. To preserve the original behavior (libcurl is an implicit dependency), this patch adds a `--without-libcurl` option to indicate this default. The check for libcurl and curl/curl.h is factored out as a separate check before checking for `--enable-publish`. If the two build options are in conflict we exit with a clear error code. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is used everywhere else so looks loke a simple omission. Needed when cross-compiling (or packaging) Clixon. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Natvie build with GCC 11.3 generates the following warning. The patch is silly and the code path should never be reached, but it silences the compiler. restconf_main_native.c:572:9: warning: ‘addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Lots of action in this PR, I'll let you know when I lift the draft status, still testing out the changes I've made today (on a separate Ubuntu 18.04 machine). |
Sorry for the delay, I'm having trouble getting the regression tests to work properly. I've managed to run all of them except one that always fails for me, even on the master branch, but I can see that it does not fail in GitHub Actions. So I'm a bit curious if you could provide some insight into why I've tried to figure out what differs between my Linux Mint 22.1 system (same as Ubuntu 22.04 with other GUI) and GitHub's
I've stripped down the output above, including complete-test.log as well for reference. |
test_restconf_internal.sh is somewhat sensitive to timing, so it may fail occasionally on some platforms, which is the action true vs false issue that I see in the trace above. It usually works fine in the docker test which is run in the regression (make test). |
I've only run |
native tests are run by building and install natively, cd to the test/ directory and running the tests from there, such as ./sum.sh |
Aha, of course, thank you! I'll give it a go in a dedicated VM. |
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This was a tricky one, but with a bit of help from a colleague we figured out the problem with With the "fixes" from there I've retested the updated patches I force-pushed last week and they pass OK now. So I'm removing the draft status of the PR. Thank you for your patience! |
There is some problem with the ci https://github.com/clicon/clixon/actions/runs/4135494336/jobs/7175071886
|
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
My bad, I interpreted your "the clxon_util_ applications are necessary for regression testing." as |
it seems to be the action host not the docker, actually the config part of the host in .github/workflows/ci.yml is not really necessary, but needs to be done for the bootstrapping of the test container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the actions problem I have reviiewed the changes and run native tests without problems.
Thank you for your work.
Ah, I see. OK, since you approved the PR I guess you'll look into that yourself? |
No, thank you for your patience and for Clixon! I expect we'll have more fixes and ideas coming soon. |
I guess I will |
We've set about to evaluate sysrepo vs Clixon for our little nework os, and Clixon is looking really awesome so far! :)
Wd when building the toolchain, example, and utils in Buildroot we ran into the following minor things. Please let me know if you want something done in another way.