git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ci: make sure we build Git parallel

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 7, 2019, 22:32 UTC
Message-ID
<nycvar.QRO.7.76.6.1902072331060.41@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqsgwzo0ib.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Thu, 7 Feb 2019, Junio C Hamano wrote:
Show 59 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
> > Wouldn't all other hits of "MAKEFLAGS=" in ci/lib.sh also want the
> > same treatment, though?  We know that "if travis to this, otherwise
> > if Asure, do that" is the first block to muck with MAKEFLAGS in the
> > script, but a new assignment before that block can be added in the
> > future and cause a similar issue unless we do so.
> >
> > Of course, at some point we do want to say "we do not want to
> > inherit it from the outside environment", but then such an
> > assignment of empty value should be done at the very beginning with
> > a comment, not with "this happens to be the first one to set, so
> > let's not append but assign to clear any previous value", I would
> > think.
> 
> That is, in a patch form on top of yours, something like this.
> 
> 
>  ci/lib.sh | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/ci/lib.sh b/ci/lib.sh
> index cee51a4cc4..288a5b3884 100755
> --- a/ci/lib.sh
> +++ b/ci/lib.sh
> @@ -74,6 +74,9 @@ check_unignored_build_artifacts ()
>  	}
>  }
>  
> +# Clear MAKEFLAGS that may come from the outside world.
> +export MAKEFLAGS=
> +
>  # Set 'exit on error' for all CI scripts to let the caller know that
>  # something went wrong.
>  # Set tracing executed commands, primarily setting environment variables
> @@ -101,7 +104,7 @@ then
>  	BREW_INSTALL_PACKAGES="git-lfs gettext"
>  	export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
>  	export GIT_TEST_OPTS="--verbose-log -x --immediate"
> -	export MAKEFLAGS="--jobs=2"
> +	MAKEFLAGS="$MAKEFLAGS --jobs=2"
>  elif test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
>  then
>  	CI_TYPE=azure-pipelines
> @@ -126,7 +129,7 @@ then
>  	BREW_INSTALL_PACKAGES=gcc@8
>  	export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
>  	export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
> -	export MAKEFLAGS="--jobs=10"
> +	MAKEFLAGS="$MAKEFLAGS --jobs=10"
>  	test windows_nt != "$CI_OS_NAME" ||
>  	GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
>  else
> @@ -185,4 +188,4 @@ GIT_TEST_GETTEXT_POISON)
>  	;;
>  esac
>  
> -export MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"
> +MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"

Since this is intended to be run in a CI setting, there is not a whole lot of opportunity to set `MAKEFLAGS` outside of the script. And if there is, that might open a rabbit hole when debugging issues that somehow in the end turn out to come from a hard-coded `MAKEFLAGS` somewhere in the CI system.

So I'd rather clear `MAKEFLAGS` at the beginning (i.e. where you `export MAKEFLAGS`, I'd simply append a `=`).

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 11 in “ci: make sure we build Git parallel”
  1. ci: make sure we build Git parallelSZEDER Gábor, Feb 7, 2019
  2. Junio C HamanoFeb 7, 2019
  3. Junio C HamanoFeb 7, 2019
  4. Junio C HamanoFeb 7, 2019
  5. Johannes SchindelinFeb 7, 2019
  6. Junio C HamanoFeb 7, 2019
  7. ci: clear and mark MAKEFLAGS exported just onceJunio C Hamano, Feb 7, 2019
  8. SZEDER GáborFeb 8, 2019
  9. Johannes SchindelinFeb 8, 2019
  10. Johannes SchindelinFeb 8, 2019
  11. Junio C HamanoFeb 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.