All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@smile.fr>
To: Ricardo Martincoski <ricardo.martincoski@gmail.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 07/16] Makefile: run check-* inside docker image
Date: Wed, 27 Jul 2022 15:16:33 +0200	[thread overview]
Message-ID: <9abfda1c-d67b-7102-a78e-e17a06da90d5@smile.fr> (raw)
In-Reply-To: <20220724054912.2354219-8-ricardo.martincoski@gmail.com>

Hello Ricardo,

Le 24/07/2022 à 07:49, Ricardo Martincoski a écrit :
> Currently the result for both check-package and check-flake8 targets
> depend on the version of the tools flake8 and shellcheck installed on
> the host.
> 
> In order to ensure reproducibility across machines of different
> developers, always use the docker image to run these targets.
> 
> When one of these targets is called, test if it is already running
> inside the docker image, and if it not, start the docker image and run
> the same command inside it.
> Do the check for the docker image in a simple way: just check current
> user belongs only to group br-user. It is very unlikely a developer has
> exactly this user configuration in the host.
> 
> Add a note in the Dockerfile about this use.
> 
> Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
> ---
>  Makefile                  | 10 ++++++++++
>  support/docker/Dockerfile |  1 +
>  2 files changed, 11 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index bd7ab9675d..f42dc3151d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1237,6 +1237,15 @@ release:
>  print-version:
>  	@echo $(BR2_VERSION_FULL)
>  
> +check_inside_docker := $(shell if [ "`groups`" = 'br-user' ]; then echo y; else echo n; fi)
> +
> +# List of target that need to run inside docker image to ensure reproducible results
> +inside_docker_targets := check-package check-flake8
> +
> +ifeq ($(check_inside_docker),n)
> +$(inside_docker_targets):
> +	$(Q)utils/docker-run $(MAKE) V=$(V) $@

While I understand the reproducibility issue, I'm not sure I really wand my make
check-package command starting starting a docker container.

I guess Buildroot user (or CI build machine) can do the same if they want.

Best regards,
Romain


> +else
>  check-flake8:
>  	$(Q)git ls-tree -r --name-only HEAD \
>  	| xargs file \
> @@ -1246,6 +1255,7 @@ check-flake8:
>  
>  check-package:
>  	$(Q)./utils/check-package `git ls-tree -r --name-only HEAD`
> +endif
>  
>  include docs/manual/manual.mk
>  -include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(sort $(wildcard $(dir)/docs/*/*.mk)))
> diff --git a/support/docker/Dockerfile b/support/docker/Dockerfile
> index f54c31b54a..afe8911e78 100644
> --- a/support/docker/Dockerfile
> +++ b/support/docker/Dockerfile
> @@ -60,6 +60,7 @@ RUN sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen && \
>  RUN useradd -ms /bin/bash br-user && \
>      chown -R br-user:br-user /home/br-user
>  
> +# Note: below user is used to check if we are running inside docker
>  USER br-user
>  WORKDIR /home/br-user
>  ENV HOME /home/br-user

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-07-27 13:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  5:48 [Buildroot] [PATCH 00/16] Preventing style regressions using check-package Ricardo Martincoski
2022-07-24  5:48 ` [Buildroot] [PATCH 01/16] DEVELOPERS: update entries for Ricardo Martincoski Ricardo Martincoski
2022-07-25 22:21   ` Arnout Vandecappelle
2022-07-24  5:48 ` [Buildroot] [PATCH 02/16] utils/check-package: improve shellcheck reproducibility Ricardo Martincoski
2022-07-25 22:21   ` Arnout Vandecappelle
2022-07-24  5:48 ` [Buildroot] [PATCH 03/16] utils/check-package: create an ignore list Ricardo Martincoski
2022-07-24  5:49 ` [Buildroot] [PATCH 04/16] support/testing: test check-package " Ricardo Martincoski
2022-07-24  5:49 ` [Buildroot] [PATCH 05/16] utils/check-package: add --failed-only Ricardo Martincoski
2022-07-24  5:49 ` [Buildroot] [PATCH 06/16] Makefile: make check-package assume a git tree Ricardo Martincoski
2022-07-27 12:54   ` Romain Naour
2022-07-31 14:31     ` Ricardo Martincoski
2022-07-31 19:23       ` Thomas Petazzoni via buildroot
2022-07-24  5:49 ` [Buildroot] [PATCH 07/16] Makefile: run check-* inside docker image Ricardo Martincoski
2022-07-27 13:16   ` Romain Naour [this message]
2022-07-31 14:34     ` Ricardo Martincoski
2022-07-24  5:49 ` [Buildroot] [PATCH 08/16] docs/manual: check-package before submitting patch Ricardo Martincoski
2022-07-27 13:22   ` Romain Naour
2022-07-31 14:37     ` Ricardo Martincoski
2022-07-24  5:49 ` [Buildroot] [PATCH 09/16] support/docker: add python3-magic Ricardo Martincoski
2022-07-24  5:49 ` [Buildroot] [PATCH 10/16] utils/check-package: check all shell scripts Ricardo Martincoski
2023-04-09 21:01   ` Arnout Vandecappelle
2022-07-24  5:49 ` [Buildroot] [PATCH 11/16] utils/check-package: check files in utils/ Ricardo Martincoski
2023-04-09 21:02   ` Arnout Vandecappelle
2022-07-24  5:49 ` [Buildroot] [PATCH 12/16] utils/check-package: check files in board/ Ricardo Martincoski
2023-04-09 21:02   ` Arnout Vandecappelle
2022-07-24  5:49 ` [Buildroot] [PATCH 13/16] utils/check-package: check files in support/ Ricardo Martincoski
2023-04-09 21:03   ` Arnout Vandecappelle
2022-07-24  5:49 ` [Buildroot] [PATCH 14/16] Makefile: merge check-flake8 into check-package Ricardo Martincoski
2023-04-09 21:04   ` Arnout Vandecappelle
2022-07-24  5:49 ` [Buildroot] [PATCH 15/16] utils/docker-run: fix shellcheck warnings Ricardo Martincoski
2023-04-09 21:05   ` Arnout Vandecappelle
2022-07-24  5:49 ` [Buildroot] [PATCH 16/16] utils/checkpackagelib: warn about $(HOST_DIR)/usr Ricardo Martincoski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9abfda1c-d67b-7102-a78e-e17a06da90d5@smile.fr \
    --to=romain.naour@smile.fr \
    --cc=buildroot@buildroot.org \
    --cc=ricardo.martincoski@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.