Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Adam Duskett <adam.duskett@amarulasolutions.com>
Cc: Angelo Compagnucci <angelo@amarulasolutions.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Asaf Kahlon <asafka7@gmail.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v9 4/7] package/flutter-engine: new package
Date: Wed, 20 Sep 2023 00:08:02 +0200	[thread overview]
Message-ID: <20230919220802.GA512384@scaer> (raw)
In-Reply-To: <20230919204252.2272594-4-adam.duskett@amarulasolutions.com>

Adam, All,

This is really a good job you did on such a tough package!

We're entering the realm of the details, so it is a good sign that we're
close to a merge!

On 2023-09-19 14:42 -0600, Adam Duskett spake thusly:
[--SNIP--]
> diff --git a/package/flutter-engine/dot-gclient b/package/flutter-engine/dot-gclient
> new file mode 100644
> index 0000000000..4e5787419b
> --- /dev/null
> +++ b/package/flutter-engine/dot-gclient
> @@ -0,0 +1,12 @@
> +# This file is taken from the output of meta-flutter/lib/gn.py

This comment is a bit misleading: it hints that this file is generated
(it is!) from some metadata. So my question was goign to be: why can't
we carry that metadata, the script, and generate the file ourselves?

But in fact, there is no interesting metadata needed to generate that
file; the only thing that is not hard-coded in the generating script
(besides the name, version and URI) is the set of download dependencies,
all set to False in the bitbake recipe.

So indeed it is not interesting to generate that file. And thus the
comment is indeed a bit misleading. I'll try to tweak it when
applying...

> +solutions = [{
> +    "managed": False,
> +    "name": "src/flutter",
> +    "url": "https://github.com/flutter/engine.git@!FLUTTER_VERSION!",
> +    "custom_vars": {
> +        "download_android_deps": False,
> +        "download_windows_deps": False,
> +        "download_linux_deps": False
> +    },
> +}]
> diff --git a/package/flutter-engine/flutter-engine.mk b/package/flutter-engine/flutter-engine.mk
> new file mode 100644
> index 0000000000..76c6610fcd
> --- /dev/null
> +++ b/package/flutter-engine/flutter-engine.mk
> @@ -0,0 +1,234 @@
> +################################################################################
> +#
> +# flutter-engine
> +#
> +################################################################################
[--SNIP--]
> +# Generate a tarball if one does not already exist.
> +define FLUTTER_ENGINE_GENERATE_TARBALL
> +	PATH=$(BR_PATH):$(HOST_DIR)/share/depot_tools \

So here, two things:
  - you put $(HOST_DIR)/share/depot_tools in the PATH but .. -> [0]
  - you should probably set it in the front:
        PATH="$(HOST_DIR)/share/depot_tools:$(BR_PATH)"

> +	PYTHONPATH=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR) \
> +	$(FLUTTER_ENGINE_PKGDIR)/gen-tarball \
> +		--dot-gclient $(FLUTTER_ENGINE_PKGDIR)/dot-gclient \
> +		--jobs $(PARALLEL_JOBS) \
> +		--scratch-dir $(@D)/dl-tmp \
> +		--tarball-dl-path $(FLUTTER_ENGINE_TARBALL_PATH) \
> +		--version $(FLUTTER_ENGINE_VERSION)
> +endef
> +FLUTTER_ENGINE_POST_DOWNLOAD_HOOKS += FLUTTER_ENGINE_GENERATE_TARBALL
> +
> +define FLUTTER_ENGINE_EXTRACT_CMDS
> +	gzip -d -c $(FLUTTER_ENGINE_TARBALL_PATH) | tar --strip-components 1 -C $(@D) -xf -

We usually use suitable-extractor to decompress, and use $(TAR) and
$(TAR_OPTIONS) to extract:

    $(call suitable-extractor,$(not dir $(FLUTTER_ENGINE_TARBALL_PATH))) $(FLUTTER_ENGINE_TARBALL_PATH) \
    |$(TAR) --strip-components 1 -C $(@D) $(TAR_OPTIONS) -

[--SNIP--]
> diff --git a/package/flutter-engine/gen-tarball b/package/flutter-engine/gen-tarball
> new file mode 100755
> index 0000000000..e040beac75
> --- /dev/null
> +++ b/package/flutter-engine/gen-tarball
> @@ -0,0 +1,111 @@
[--SNIP--]
> +run_gclient() {
> +  local gclient="${HOST_DIR}"/share/depot_tools/gclient.py

[0] here you don't use PATH to locate gclient.py.

> +  if [[ ! -e "${gclient}" ]]; then
> +    message "${gclient} does not exist. Is host-depot-tools built and installed?"

That should not happen because host-depot-tools is a dependency of
flutter-engine.

> +    exit 1
> +  fi
> +  message "Downloading"
> +  "${gclient}" \

Assuming $(HOST_DIR)/share/depot_tools first int he PATH, can we just
run:

    gclient.py \
        sync \
        [...]

> +    sync \
> +    --delete_unversioned_trees \
> +    --no-history \
> +    --reset \
> +    --shallow \
> +    -j"${JOBS}"
> +}
> +
> +gen_tarball() {
> +  message "Generating tarball"
> +  mkdir -p "${DL_DIR}"
> +  # We would use the mk_tar_gz helper method from the support/download/helpers
> +  # script here. However, due to unknown reasons other than what I can
> +  # articulate as "Google," this is not possible. Even though creating a
> +  # tarball using the mk_tar_gz command results in a tarball that extracts and
> +  # builds flutter-engine without warnings or errors, the gen_snapshot host
> +  # utility, which turns dart applications into usable .so files for the
> +  # flutter engine, results in the error:
> +  # "Can't load kernel binary: Invalid SDK hash." As we are not interested in
> +  # creating a reproducible tarball, we need to use tar -C instead.

As discussed on IRC, I think the real reason was that mk_tar_gz only
archives non-directories, i.e. files, symlinks, etc... so empty
directories are missing, and the flutter-engine buildsystem requires
them.

So, based on your replies, I may be able to ammend the commit when
applying and save you a respin. So, be careful in your replies! ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-09-19 22:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-19 20:42 [Buildroot] [PATCH v9 1/7] package/python-httplib2: add host variant Adam Duskett
2023-09-19 20:42 ` [Buildroot] [PATCH v9 2/7] package/depot-tools: new package Adam Duskett
2023-09-19 20:42 ` [Buildroot] [PATCH v9 3/7] package/flutter-sdk-bin: " Adam Duskett
2023-09-19 20:42 ` [Buildroot] [PATCH v9 4/7] package/flutter-engine: " Adam Duskett
2023-09-19 22:08   ` Yann E. MORIN [this message]
2023-09-19 22:33     ` Adam Duskett
2023-09-19 20:42 ` [Buildroot] [PATCH v9 5/7] package/flutter-pi: " Adam Duskett
2023-09-19 20:42 ` [Buildroot] [PATCH v9 6/7] package/flutter-gallery: " Adam Duskett
2023-09-19 20:42 ` [Buildroot] [PATCH v9 7/7] support/testing/tests/package/test_flutter.py: new runtime test Adam Duskett
2023-09-23  8:35   ` Yann E. MORIN
2023-09-23  8:47     ` Yann E. MORIN
2023-09-26 19:23     ` Yann E. MORIN
2023-09-29 22:22       ` Yann E. MORIN

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=20230919220802.GA512384@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=adam.duskett@amarulasolutions.com \
    --cc=angelo@amarulasolutions.com \
    --cc=asafka7@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=michael@amarulasolutions.com \
    --cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox