diff mbox series

[v3,3/6] gitlab-ci: Run GNU make via the $MAKE variable

Message ID 20210519184549.2192728-4-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series gitlab-ci: Allow using FreeBSD runners | expand

Commit Message

Philippe Mathieu-Daudé May 19, 2021, 6:45 p.m. UTC
Add the $MAKE variable to call GNU make, and set it to 'gmake'
on FreeBSD to avoid:

  $ make -j"$JOBS"
  make: Unknown modifier ','
  make: "/builds/dTyar424/0/qemu/build/Makefile" line 3: Need an operator
  make: "/builds/dTyar424/0/qemu/build/Makefile" line 4: Missing dependency operator

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 .gitlab-ci.d/buildtest-template.yml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Willian Rampazzo May 19, 2021, 7:10 p.m. UTC | #1
On Wed, May 19, 2021 at 3:46 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Add the $MAKE variable to call GNU make, and set it to 'gmake'
> on FreeBSD to avoid:
>
>   $ make -j"$JOBS"
>   make: Unknown modifier ','
>   make: "/builds/dTyar424/0/qemu/build/Makefile" line 3: Need an operator
>   make: "/builds/dTyar424/0/qemu/build/Makefile" line 4: Missing dependency operator
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  .gitlab-ci.d/buildtest-template.yml | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Thomas Huth May 20, 2021, 7:56 a.m. UTC | #2
On 19/05/2021 20.45, Philippe Mathieu-Daudé wrote:
> Add the $MAKE variable to call GNU make, and set it to 'gmake'
> on FreeBSD to avoid:
> 
>    $ make -j"$JOBS"
>    make: Unknown modifier ','
>    make: "/builds/dTyar424/0/qemu/build/Makefile" line 3: Need an operator
>    make: "/builds/dTyar424/0/qemu/build/Makefile" line 4: Missing dependency operator
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   .gitlab-ci.d/buildtest-template.yml | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml
> index fe4f18595ac..f284d7a0eec 100644
> --- a/.gitlab-ci.d/buildtest-template.yml
> +++ b/.gitlab-ci.d/buildtest-template.yml
> @@ -5,9 +5,11 @@
>           ;
>         then
>           JOBS=$(sysctl -n hw.ncpu)
> +        MAKE=gmake
>           ;
>         else
>           JOBS=$(expr $(nproc) + 1)
> +        MAKE=make

Maybe we could use "gmake" on Linux, too, so we do not have to use the 
indirection with a variable here? Or are there Linux distros where the 
"gmake" link is not available?

  Thomas
Wainer dos Santos Moschetta May 20, 2021, 6:26 p.m. UTC | #3
On 5/19/21 3:45 PM, Philippe Mathieu-Daudé wrote:
> Add the $MAKE variable to call GNU make, and set it to 'gmake'
> on FreeBSD to avoid:
>
>    $ make -j"$JOBS"
>    make: Unknown modifier ','
>    make: "/builds/dTyar424/0/qemu/build/Makefile" line 3: Need an operator
>    make: "/builds/dTyar424/0/qemu/build/Makefile" line 4: Missing dependency operator
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>   .gitlab-ci.d/buildtest-template.yml | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)


Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>


>
> diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml
> index fe4f18595ac..f284d7a0eec 100644
> --- a/.gitlab-ci.d/buildtest-template.yml
> +++ b/.gitlab-ci.d/buildtest-template.yml
> @@ -5,9 +5,11 @@
>           ;
>         then
>           JOBS=$(sysctl -n hw.ncpu)
> +        MAKE=gmake
>           ;
>         else
>           JOBS=$(expr $(nproc) + 1)
> +        MAKE=make
>           ;
>         fi
>       - echo "=== Using $JOBS simultaneous jobs ==="
> @@ -33,22 +35,23 @@
>         then
>           ../meson/meson.py configure . -Dbackend_max_links="$LD_JOBS" ;
>         fi || exit 1;
> -    - make -j"$JOBS"
> +    - $MAKE -j"$JOBS"
>       - if test -n "$MAKE_CHECK_ARGS";
>         then
> -        make -j"$JOBS" $MAKE_CHECK_ARGS ;
> +        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
>         fi
>   
>   .native_test_job_template:
>     stage: test
>     image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
> +  extends: .environment_variables_template
>     script:
>       - scripts/git-submodule.sh update
>           $(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
>       - cd build
>       - find . -type f -exec touch {} +
>       # Avoid recompiling by hiding ninja with NINJA=":"
> -    - make NINJA=":" $MAKE_CHECK_ARGS
> +    - $MAKE NINJA=":" $MAKE_CHECK_ARGS
>   
>   .integration_test_job_template:
>     extends: .native_test_job_template
diff mbox series

Patch

diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml
index fe4f18595ac..f284d7a0eec 100644
--- a/.gitlab-ci.d/buildtest-template.yml
+++ b/.gitlab-ci.d/buildtest-template.yml
@@ -5,9 +5,11 @@ 
         ;
       then
         JOBS=$(sysctl -n hw.ncpu)
+        MAKE=gmake
         ;
       else
         JOBS=$(expr $(nproc) + 1)
+        MAKE=make
         ;
       fi
     - echo "=== Using $JOBS simultaneous jobs ==="
@@ -33,22 +35,23 @@ 
       then
         ../meson/meson.py configure . -Dbackend_max_links="$LD_JOBS" ;
       fi || exit 1;
-    - make -j"$JOBS"
+    - $MAKE -j"$JOBS"
     - if test -n "$MAKE_CHECK_ARGS";
       then
-        make -j"$JOBS" $MAKE_CHECK_ARGS ;
+        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
       fi
 
 .native_test_job_template:
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  extends: .environment_variables_template
   script:
     - scripts/git-submodule.sh update
         $(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
     - cd build
     - find . -type f -exec touch {} +
     # Avoid recompiling by hiding ninja with NINJA=":"
-    - make NINJA=":" $MAKE_CHECK_ARGS
+    - $MAKE NINJA=":" $MAKE_CHECK_ARGS
 
 .integration_test_job_template:
   extends: .native_test_job_template