Change in osmo-dev[master]: gen_makefile.py: add --docker-cmd argument

osmith gerrit-no-reply at lists.osmocom.org
Thu Aug 12 15:31:10 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/25189 )


Change subject: gen_makefile.py: add --docker-cmd argument
......................................................................

gen_makefile.py: add --docker-cmd argument

To be used by ttcn3.sh to run the actual build inside docker. ttcn3.sh
runs the programs built by osmo-dev inside docker with the exact
configs that we use on jenkins.osmocom.org, but so far it builds the
component outside of docker. But building inside docker is necessary to
avoid incompatibilities between the host system and the docker
containers (e.g. different glibc).

Change-Id: Ibd20f0e0e2a5105085066a9f04b5868c68691024
---
M gen_makefile.py
1 file changed, 9 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/89/25189/1

diff --git a/gen_makefile.py b/gen_makefile.py
index fb81aac..508b862 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -107,6 +107,9 @@
   default=True, action='store_false',
   help='''do not 'make check', just 'make' to build.''')
 
+parser.add_argument('--docker-cmd',
+    help='''prefix configure/make/make install calls with this command (used by ttcn3.sh)''')
+
 args = parser.parse_args()
 
 class listdict(dict):
@@ -191,19 +194,19 @@
 	-chmod -R ug+w {build_proj}
 	-rm -rf {build_proj}
 	mkdir -p {build_proj}
-	cd {build_proj}; {build_to_src}/configure {configure_opts}
+	cd {build_proj}; {docker_cmd}{build_to_src}/configure {configure_opts}
 	sync
 	touch $@
 
 .make.{proj}.build: .make.{proj}.configure $({proj}_files)
 	@echo -e "\n\n\n===== $@\n"
-	$(MAKE) -C {build_proj} -j {jobs} {check}
+	{docker_cmd}$(MAKE) -C {build_proj} -j {jobs} {check}
 	sync
 	touch $@
 
 .make.{proj}.install: .make.{proj}.build
 	@echo -e "\n\n\n===== $@\n"
-	{sudo_make_install}$(MAKE) -C {build_proj} install
+	{docker_cmd}{sudo_make_install}$(MAKE) -C {build_proj} install
 	{no_ldconfig}{sudo_ldconfig}ldconfig
 	sync
 	touch $@
@@ -238,6 +241,7 @@
     no_ldconfig='#' if no_ldconfig else '',
     sudo_ldconfig='' if ldconfig_without_sudo else 'sudo ',
     check='check' if make_check else '',
+    docker_cmd=f'{args.docker_cmd} ' if args.docker_cmd else '',
     )
 
 
@@ -286,7 +290,7 @@
 		-o {makefile} \
 		-s {src_dir} \
 		-b {build_dir} \
-		-u "{url}"{push_url}{sudo_make_install}{no_ldconfig}{ldconfig_without_sudo}{make_check}
+		-u "{url}"{push_url}{sudo_make_install}{no_ldconfig}{ldconfig_without_sudo}{make_check}{docker_cmd}
 
 '''.format(
     script=os.path.relpath(sys.argv[0], make_dir),
@@ -302,6 +306,7 @@
     no_ldconfig=' \\\n\t\t-L' 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 ''
     ))
 
   # convenience target: clone all repositories first

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/25189
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Ibd20f0e0e2a5105085066a9f04b5868c68691024
Gerrit-Change-Number: 25189
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210812/127621bb/attachment.htm>


More information about the gerrit-log mailing list