-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Pub Transformers running in parallel instead of in stages #23323
Comments
What exactly makes you think they're running in parallel? Added NeedsInfo label. |
This comment was originally written by @kaendfinger When I added print statements to my 2 transformers, around the work they do, it went like this: transformer 1 started |
What I should have said was, please provide code that demonstrates this issue. |
This comment was originally written by @kaendfinger Use the following pubspec: name: pub_transformer_bug
Modify .pub-cache/hosted/pub.dartlang.org/libffi6_extension-0.0.3/lib/transformer.dart and .pub-cache/hosted/pub.dartlang.org/unsafe_extension-0.0.16/lib/transformer.dart and add print statements around the following code in each file: try { run pub get |
Changing the working directory is never going to work out well for you in transformers. It's 100% intended for transformers to run in parallel on multiple files, so you're going to have serious race conditions any time you have multiple transformers modifying the same global state, including the working directory. |
This comment was originally written by @kaendfinger Ahh I didn't even pay attention to the fact that it's doing that. So that would be the issue I guess then, correct? If so, go ahead in close this. The reason why we change directories for these transformers is really just a hack (acts like an install hook for us). Thanks for checking into it though! |
Added AsDesigned label. |
This comment was originally written by @mezoni
Need special kind of the transformers which can be sure that their instance run exclusively. Eg. abstract class PreinstallTransformer implements Transformer { abstract class PostinstallTransformer implements Transformer { Where "InstallationTransform" should provide the path to the package in pub-cache. |
This comment was originally written by @mezoni Better way: abstract class GlobalTransformer implements Transformer { Future apply(GlobalTransform transform); Eg. class MyInstallTransformer extends GlobalTransformer { Future apply(GlobalTransform transform) { |
This comment was originally written by @mezoni I am more than sure that the developers never did anything for the minority (read: for the community). Only for the majority. And as all we know that the majority is a developers themselves, and the minority is an all rest of the people in the world. |
This issue has been moved to dart-lang/pub#13. |
This issue was originally filed by @kaendfinger
What steps will reproduce the problem?
What is the expected output? What do you see instead?
with the given transformer definitions:
transformers:
this should run the first transformer and then the second one.
What version of the product are you using?
Dart VM version: 1.11.0-edge.45391 (Thu Apr 23 17:40:55 2015) on "macos_x64"
On what operating system?
Mac OS X
What browser (if applicable)?
N/A
Please provide any additional information below.
According to https://www.dartlang.org/tools/pub/assets-and-transformers.html
To specify that transformers run in parallel, use [transformer_1, ..., transformer_n]. If order matters, put the transformers on separate lines.
For example, consider three transformers, specified as follows:
transformers:
The text was updated successfully, but these errors were encountered: