Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable incremental build using transitive digests #3677

Open
haenah opened this issue May 9, 2024 · 2 comments
Open

Disable incremental build using transitive digests #3677

haenah opened this issue May 9, 2024 · 2 comments

Comments

@haenah
Copy link

haenah commented May 9, 2024

  • Dart SDK Version: 3.3.3
  • Package: build_resolvers 2.4.2

I recently implemented a CI/CD system using GitHub Actions to deploy our company's Flutter app. However, running build_runner takes an immense amount of time. Therefore, I investigated which builders were causing the delay. Through performance tracking of build_runner, I discovered that build_resolvers|transitive_digests was consuming time by digesting all package dependencies, particularly in the CI environment. I speculate this slowdown is due to the lack of dedicated digest computing hardware on GitHub-hosted runner machines compared to Apple Silicon Mac(It gets 20 times slower on github-hosted runner, which is almost 5 minutes). Implementing a lightweight build resolver that omits generating transitive digests could significantly reduce build times in environments not requiring incremental builds, especially as CI environments. I welcome your insights. Are there any reasons why digesting is mandatory even in environments that do not necessitate incremental builds?

@jakemac53
Copy link
Contributor

You should be able to try just disabling that builder - but most likely it will make your build slower and not faster (digests will end up being computed still, just later on by a different builder, and multiple times). You can try disabling it by adding a build_resolvers.build.yaml file in your package which is empty.

We don't have a mode for doing non-incremental builds. I don't believe it would help all that much, and it would probably be quite involved to add, digests are a pretty core piece of the package.

Note as well that you can try enabling caching of the .dart_tool/build directory, which should allow you to get incremental builds on CI. This is probably your best path toward faster CI builds - especially if you check in your pubspec.lock file.

@jakemac53 jakemac53 added the needs-info Additional information needed from the issue author label May 9, 2024
@haenah
Copy link
Author

haenah commented May 10, 2024

@jakemac53 Thanks for your opinion! I'll try out approaches you suggested.

@github-actions github-actions bot removed the needs-info Additional information needed from the issue author label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants