Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Flutter-engine package help wanted.
@ 2023-07-15  3:02 Adam Duskett
  2023-07-15 16:24 ` Peter Korsgaard
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Adam Duskett @ 2023-07-15  3:02 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni, Yann E. MORIN, Arnout Vandecappelle,
	Luca Ceresoli


[-- Attachment #1.1: Type: text/plain, Size: 3888 bytes --]

Hello! I have a task to port Flutter to Buildroot and to make the packages
suitable for the master branch.

I have talked with Yann in IRC about the problems facing the first package,
flutter-engine [https://github.com/flutter/engine]. However, after another
full
day of hacking away at the package, it's time to talk about a significant
problem I must overcome.

Here is a summary of the issue I am facing and the main reason for the
email:

Flutter is developed and maintained by Google.
Of course, it stands to reason that Flutter does not use a conventional
configure/build system. Oh no, it couldn't be that easy. Instead, Flutter
uses
gclient and gn from the chromium depot_tools repository, which contains all
sorts of exciting utilities. One of which is gclient.

What is gclient? From:
https://www.chromium.org/developers/how-tos/depottools

gclient is a Python script to manage a workspace of modular dependencies
that
are each checked out independently from different subversion or git
repositories. Features include:

  - Dependencies can be specified on a per-OS basis.
  - Dependencies can be specified relative to their parent dependency.
  - Variables can be used to abstract concepts.
  - Hooks can be specified to be run after a checkout.
  - .gclient and DEPS are Python scripts. You can hack in easily or add
     additional configuration data.

.gclient file: It's the primary file. It is, in fact, a Python script. It
specifies the following variables:

  - solutions: an array of dictionaries specifying the projects that will be
               fetched.
  - hooks: additional hooks to be run when this meta checkout is synced.
  - target_os: an optional array of (target) operating systems to fetch
               OS-specific dependencies for.
  - cache_dir: Primarily for bots, multiple working sets use a single git
               cache.


Why is this a significant issue?

The release tarballs from https://github.com/flutter/engine are in no state
to
compile! No, they are only for the use of gclient to download and build a
source directory structure suitable to build the Flutter engine! If you
download, extract and attempt to run
./tools/gn --no-goma --no-prebuilt-dart-sdk,
you receive the error message:
No such file or directory: 'flutter/flutter/third_party/gn/gn.'

But wait! Wasn't the gn binary just called? No, that's a wrapper in the
Flutter
source tree that formats arguments to call the real gn binary. The real gn
is
not provided in the tarball but is downloaded via gclient
(among many other repositories.)

The above leads to the question: What do we do about this? We can't use the
existing download infrastructure to download the tarball from Git Hub, as
that
isn't meant for us. The gclient download works if called out directly via a
pre_download hook; however, this leads to other issues in recreating a
consistent tarball because gclient writes the date to various files all
around
the directory, thus changing the shasum every time I attempt to generate a
tarball. I can sed the dates in a flutter-engine-gen-tarball script I've
made,
which solves the problem; however, there is one last hurdle to overcome:
When I
compress the directory created by gclient, any .git folder in a subdirectory
also changes when running mk_tar_gz from the script. The .git directories,
of
course, can be removed, and that DOES create a reproducible tarball, but the
build system relies on the .git directories to fill in a bunch of
information
before configuring, causing failures.

I won't ask the best course of action because anything we decide will be
pretty
ugly, thanks to Google and its decisions. Instead, I will ask, what is the
least-bad solution that can be upstreamed to the master branch?

If you want to play around with any of this, you can clone
git@gitlab.com:aduskett/buildroot-flutter.git and build the
flutter_defconfig.

Thanks!
Adam

[-- Attachment #1.2: Type: text/html, Size: 4389 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-20  2:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-15  3:02 [Buildroot] Flutter-engine package help wanted Adam Duskett
2023-07-15 16:24 ` Peter Korsgaard
2023-07-15 18:35   ` Adam Duskett
2023-07-15 21:45     ` Peter Korsgaard
2023-07-16 15:32 ` Arnout Vandecappelle via buildroot
2023-07-17 17:44   ` Adam Duskett
2023-07-17 18:38 ` Yann E. MORIN
2023-07-17 19:16   ` Yann E. MORIN
2023-07-17 19:33     ` Adam Duskett
2023-07-19  2:04       ` Adam Duskett
2023-07-20  2:12         ` Adam Duskett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox