Skip to content

[ffigen] Output dependencies & only rerun if dependencies change #1101

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

Open
dcharkes opened this issue Apr 24, 2024 · 0 comments
Open

[ffigen] Output dependencies & only rerun if dependencies change #1101

dcharkes opened this issue Apr 24, 2024 · 0 comments
Labels
P4 A feature or bug we're unlikely to address package:ffigen

Comments

@dcharkes
Copy link
Collaborator

Pulling some learnings from #977.

My preference would be to let a higher level of build system handle checking the file times, like Bazel or package:build or native assets.

👍 Great thinking about how this integrates in the larger eco system.

I think the FFIgen (and JNIgen) should be able to report the list of dependencies (#1008). We don't want every user of FFIgen (and JNIgen) to manually come up with a list of dependencies.

The logic of checking the files timestamps could maybe live in a shared package that then FFIgen, JNIgen, and native_assets_builder can reuse.

One question to ask is what abstraction to use for listing dependencies:

  1. File paths
  2. Directory paths (which would mean all files transitively in that directory, and it also means that if someone adds a file in such directory it's added).
  3. Glob patterns? (which would mean that any files added to the file system matching such pattern would trigger a rebuild). -> But not every build system wrapping FFIgen/JNIgen might be able consume glob patterns (native assets, package:build, ...)

Originally posted by @dcharkes in #977 (comment)

Some more edge cases to consider -

  1. Transitive dependencies could be changed
  2. ffigen version might be updated in pubspec.yaml
  3. Any updates to compiler-opts specified via the environment itself.

Originally posted by @mannprerak2 in #977 (comment)

I think the first step is to output a list of dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 A feature or bug we're unlikely to address package:ffigen
Projects
None yet
Development

No branches or pull requests

1 participant