<!-- Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment). -->
### Description
We're considering migrating our Kamailio-based product to Gitlab and attempted to setup a PoC of a build pipeline using Gitlab's CI capabilities. We used the same Docker build image but ran into some unexpected problems when running `make`. In short, sequence of steps can be summarised like this: ``` # 1. Generating build config files make Q=0 cfg PREFIX=/usr/local LOCALBASE=/usr/local cfg_prefix=/tmp doc_prefix=/tmp modules_dirs=modules group_include=standard 'include_modules=inesrp inkeepalive sanity json sctp htable avpops uac uac_redirect rtimer dialog tls' 'skip_modules=stun sipt rtpproxy auth_diameter msrp qos seas siptrace sipcapture xhttp xhttp_rpc acc_diameter call_control mediaproxy topoh topos nat_traversal sms smsops jsonrpcs ss7ops ctl dmq dmq_usrloc mqueue rtpengine malloc_test mangler nosip blst app_sqlang app_jsdt auth_xkeys cfg_rpc sca sctp evrexec exec sdpops sipdump nathelper path pike' # 2. Since MY_CUSTOM_FLAG variable is custom and is not set by default, injecting it into src/Makefile.defs sed -i 's/C_DEFS=.*/&\n\o011 -DMY_CUSTOM_FLAG \/' src/Makefile.defs # 3. should succeed make Q=0 ```
At this point we expected build to succeed since it's exactly the same sequence of steps as we have been running for almost a year now, but what we got was build failures due to `MY_CUSTOM_FLAG` not being visible:
``` core/dprint.h:301:19: error: 'MY_CUSTOM_FLAG' undeclared (first use in this function) ``` (we're using patched Kamailio sources so don't get sidetracked by `MY_CUSTOM_FLAG` not being actually present in `core/dprint.h:301`)
Although clues seem to be pointing in the direction of new cloud CI environment being the culprit, we're not really sure how to approach this issue and where to start debugging from. Any suggestions?
### Troubleshooting
#### Reproduction
<!-- If the issue can be reproduced, describe how it can be done. -->
For the record, [here is the Gitlab ticket](https://gitlab.com/gitlab-org/gitlab/issues/198551#note_293261974) with further reproduction details and examples of successful and failing builds
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
Running the code from this repo's `5.1` branch: `git checkout -b 5.1 origin/5.1`
* **Operating System**:
<!-- Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...; Kernel details (output of `uname -a`) -->
Official Docker `centos:7` image
Hello, just for the record - the 5.1 branch is end of life, you should upgrade to a newer supported stable branch. Are your errors only related to the MY_CUSTOM_FLAG variable injection? Does it work reliable if you build directly from source in your CI/CD environment, or fails at well? I would try to tackle this issue by the usual process, step by step trying to change different points in the environment to find the one that causes the problem.
Closed as 5.1 branch is not supported anymore.
Closed #2228.
Just small hints that can do it: * try to add `CC_EXTRA_OPTS="-DMY_CUSTOM_FLAG"` to `make cfg ...` command. * changing `Makefile.defs` after `make cfg ...` makes the `make Q=0` run internally another simple `make cfg`
As Henning said, in case of still having issue, open an issue for a maintained branch to try to get some more help.
Also you can use our docker build environment for codefresh. Codefresh also use docker and you can port this for GitLab.
https://github.com/kamailio/kamailio-ci/blob/builder/builder/codefresh-cron....