From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Adam Duskett <adam.duskett@amarulasolutions.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v4 1/1] package/flutter-sdk-bin/Config.in.host: change flutter-pub-cache location
Date: Sat, 20 Jan 2024 21:35:42 +0100 [thread overview]
Message-ID: <ZawungZjGBS6Z3Dq@landeda> (raw)
In-Reply-To: <20240113194950.11170-1-adam.duskett@amarulasolutions.com>
Adam, All,
On 2024-01-13 12:49 -0700, Adam Duskett spake thusly:
> When running the command "flutter pub get," the plugins are stored in the
> pub-cache directory along with their sha256sum hashes. The default location of
> the pub-cache directory is current $(HOST_DIR)/share/flutter/sdk/.pub-cache,
> which is not an acceptable choice by default because every plugin is
> re-downloaded during every build of a flutter application either during a new
> build or when building with the per-package-directory option enabled.
>
> Furthermore, keeping the pub-cache in its current location prevents users from
> committing the pub-cache directory to git for faster rebuilds of a
> Buildroot-based system, as users cannot store the pub-cache for later use.
>
> To fix the above issue completely, the following two changes must occur:
>
> - Change the hard-coded Flutter pub-cache location to
> $(DL_DIR)/br-flutter-pub-cache.
>
> - Remove the `rm -rf $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache` and the
> associated comment about why the build system removes the .pub-cache
> directory. After further research, the help text of the precache command
> reads, "Populate the Flutter tool's cache of binary artifacts."
> The current reasoning listed in the comments is not accurate for a
> the following reasons:
>
> 1. We do not want to remove their directory if users already have a pub
> cache they have symlinked to.
>
> 2. If the flutter-sdk-bin package previously set up the pub-cache, then
> the pub-cache directory is set up with the options we want, and there
> is no reason to remove the pub-cache directory.
I have added a little comment abot the concurrent acces to the shared
pub-cache, thanks for the pointer on IRC!
> Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> changes v3 -> v4:
> - Hardcode the directory to $(DL_DIR)/br-flutter-pub-cache. [Yann]
> - Remove the `rm -rf $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache` line. [Yann]
> - Remove the associated comments about the above line. [Yann]
> - Expand the commit log.
>
> package/flutter-sdk-bin/flutter-sdk-bin.mk | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/package/flutter-sdk-bin/flutter-sdk-bin.mk b/package/flutter-sdk-bin/flutter-sdk-bin.mk
> index 5e5042bea8..2e37e6f036 100644
> --- a/package/flutter-sdk-bin/flutter-sdk-bin.mk
> +++ b/package/flutter-sdk-bin/flutter-sdk-bin.mk
> @@ -41,11 +41,8 @@ define HOST_FLUTTER_SDK_BIN_CONFIGURE_CMDS
> $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/dart --disable-analytics
> endef
>
> -# Remove the cache, as we will run precache after setting up flutter and dart
> -# with the new config options.
> define HOST_FLUTTER_SDK_BIN_BUILD_CMDS
> mkdir -p $(HOST_FLUTTER_SDK_BIN_SDK)
> - rm -rf $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache
> cd $(@D) && \
> $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter precache;
> endef
> @@ -104,4 +101,4 @@ HOST_FLUTTER_SDK_BIN_DART_BIN = \
> $(eval $(host-generic-package))
>
> # For target packages to locate said pub-cache
> -FLUTTER_SDK_BIN_PUB_CACHE = $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache
> +FLUTTER_SDK_BIN_PUB_CACHE = $(DL_DIR)/br-flutter-pub-cache
> --
> 2.43.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| 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
next prev parent reply other threads:[~2024-01-20 20:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-13 19:49 [Buildroot] [PATCH v4 1/1] package/flutter-sdk-bin/Config.in.host: change flutter-pub-cache location Adam Duskett
2024-01-20 20:35 ` Yann E. MORIN [this message]
2024-02-03 11:24 ` Peter Korsgaard
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=ZawungZjGBS6Z3Dq@landeda \
--to=yann.morin.1998@free.fr \
--cc=adam.duskett@amarulasolutions.com \
--cc=buildroot@buildroot.org \
/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