-
Notifications
You must be signed in to change notification settings - Fork 210
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
NNBD support #2744
Comments
You need to do Otherwise you are enabling NNBD for the build script, not the build itself :). It is confusing for sure though :D. |
Note that we do not support toggling null safety mode on/off yet, and we also don't support dart2js directly yet (you can hack it with the dart2js args options, but I wouldn't bother). |
Thanks. This seems to rely on
Well, I know how to make it work locally, I can build an SDK with built_value in allowed_experiments.json :) which should unblock me for now; but it won't work for travis. Any ideas appreciated :) Thanks. |
Oh, I didn't realize you were also using null safety in your code generator code. To do that you would need to pass However this won't work with the latest build_runner because it has an sdk constraint which opts it in to null safety even though it doesn't want to be.... cc @jonasfj @leafpetersen @natebosch an example of why we need some alternate mechanism for setting the language version. I will not be adding opt out comments to the entire build_runner package, nor will I be approving such a cl, because that is unreasonable IMO. |
The code generator Anyway, I'm not blocked--I was able to work with a custom built SDK allowlist :)--I mention since I think you said this would matter for external support at some point. Thanks. |
(I think, makes sense to reopen? Feel free to reclose if not...) |
I'm curious, why does it have such an SDK constraint? |
It's related to the problems we had with the analyzer package not pinning to a specific SDK which caused problems for codegen users when their SDK and version of analyzer didn't agree won language versioning details. |
Note that this sdk constraint only causes a problem with the null safety experiment flag enabled. On its own today the constraint is totally valid. Any package with a min sdk constraint of |
I am going to go ahead and close this as I don't believe there is anything actionable here that isn't covered by other issues |
I've been looking at the
built_value
generator.There are a whole pile of fun issues here, including hacks needed to get build runner to run at all when some things are opted in to NNBD:
One thing that does not seem to work currently, is that the
LibraryElement.isNonNullableByDefault
property is alwaysfalse
. I'm kind of puzzled by this--even if the target is clearly NNBD enabled, i.e. is using NNBD syntax, it seems to returnfalse
.For now I can work around this by checking the source for an explicit version comment, but this misses other types of configuration.
I think this works in google3, so I am guessing it is a matter of the wiring around the generators, and so probably
package:build
:)The text was updated successfully, but these errors were encountered: