Status Update
Comments
uc...@google.com <uc...@google.com>
je...@google.com <je...@google.com>
lu...@google.com <lu...@google.com>
je...@google.com <je...@google.com> #2
Branch: master
commit 84bc198202e5be2cb1c96f8c0cb21047c557a82a
Author: Nicolas Capens <capn@google.com>
Date: Tue Jun 15 21:44:31 2021
Disable -warn-stack-size for LLVM older than version 12
This command line option is getting replaced with a module attribute in
versions newer than 11. Once LLVM 12 is released we should be able to
use the attribute instead to retain this functionality.
Note that upstream SwiftShader still uses LLVM 10, and the primary usage
of this functionality is to prevent stack overflow in Chrome's fuzzers,
which is not affected by this temporary change.
Bug:
Change-Id: I2edb0dc4df5d434540741bcb3007539311eb958a
Reviewed-on:
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
M src/Reactor/LLVMJIT.cpp
wo...@gmail.com <wo...@gmail.com> #3
lu...@google.com <lu...@google.com>
vv...@gmail.com <vv...@gmail.com> #4
Thanks for the update, Nick. This will only be part of the LLVM 13 major release, right?
We may upgrade upstream SwiftShader to the LLVM 12 release (or 12.0.1) in the not too distant future, and it looks like we should still be using the -warn-stack-size
command line flag. In my previous change I was wrong to assume 12 hadn't been released yet, and the "older than version 12" description doesn't match the code. :-(
je...@google.com <je...@google.com> #5
Correct. Upstream LLVM patch has landed as commit 8ace12130526f450c822ca232d1f865b247d7434.
zt...@gmail.com <zt...@gmail.com> #6
Branch: master
commit f679fc179b9b478bf5f116026df9c8d483ab3c65
Author: Nicolas Capens <capn@google.com>
Date: Fri Jun 25 14:50:41 2021
Fix -warn-stack-size command line option for LLVM 12
The -warn-stack-size command line option won't be deprecated until the
LLVM 13 release.
This change also produces a compile-time error when LLVM 13+ is used so
we won't fail to notice that the the stack size checking functionality
has to be implemented using the per-function "warn-stack-size" attribute
introduced by
builds of LLVM use LLVM_MAJOR_VERSION=9999.
Bug:
Change-Id: I044d576a6dcd73354710783a7f7e042cb43254c5
Reviewed-on:
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
M src/Reactor/LLVMJIT.cpp
je...@google.com <je...@google.com> #7
I'm considering this fixed for now since it won't affect us until we upgrade to LLVM 13+, and there's a check in place so it won't regress unnoticed. No strict need to make use of the function attribute before the upgrade, since that will involve a bunch of work anyway. Patches welcome though!
b....@gmail.com <b....@gmail.com> #8
As part of
sw...@gmail.com <sw...@gmail.com> #9
Branch: master
commit c13f4b1db4593b2d6a2fec856737374f47100379
Author: Nicolas Capens <capn@google.com>
Date: Fri Feb 25 11:08:07 2022
Set the stack limit through a function attribute
Recent versions of LLVM control the stack size limit through a function
attribute.
Note that older versions of LLVM simply ignore this attribute so we
don't have to set it conditionally. The -warn-stack-size command line
option can be removed though once we use LLVM 13+ everywhere.
Bug:
Bug:
Change-Id: Ie5d18031c5cd13e1fb2703110974e4cf59458077
Reviewed-on:
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
M src/Reactor/LLVMReactor.cpp
M src/Reactor/LLVMJIT.cpp
sh...@gmail.com <sh...@gmail.com> #10
je...@gmail.com <je...@gmail.com> #11
mo...@tikalk.com <mo...@tikalk.com> #12
This called a "breaking change."
Why not first deprecate VERSION_CODE
and VERSION_NAME
?
tu...@gmail.com <tu...@gmail.com> #13
ma...@fromatob.com <ma...@fromatob.com> #14
Same problem. It seems VERSION_CODE
and VERSION_NAME
generated only for application module. Other library gradle module don't have these constants in their BuildConfig.
xa...@google.com <xa...@google.com> #15
Hi all,
Yes, we should have deprecated this first. Since this happened (several months ago), we have put in place better policies for deprecation/removal of properties. This happened kind of late for 4.1 though, and this particular issue fell through the cracks so we did not get a chance to decide whether to revert this change (and we even missed putting this change in the release notes at first). We apologize for this.
Some of the motivation behind this were to reduce/remove the confusion around 2 points:
- Users accessing the
BuildConfig
fields but not setting them in the DSL. This would definitively be broken and not do what one would expect (ie these are static values, and won't magically reflect the version of the app the library is embedded in) - The library
AndroidManifest.xml
file contains the values set in the DSL, but these values are completely ignored by the consuming app(s) during manifest merging (they are also overridden)
If you want to keep injecting the values from a common place into all your library project's BuildConfig
fields, you could continue to do this manually with your own custom fields. These fields will only exist if you set them via the DSL (therefore preventing problem #1 above), and will not impact the library manifest (problem #2 above).
However, if you have a large setup with many library projects, this pattern will generate a lot of duplicates. It would make more sense to have a single module that generates a similar class, and have all your library projects (or at least the ones that need the info) depend on it.
[Deleted User] <[Deleted User]> #16
in the library's `build.gradle`:
```
defaultConfig {
//Required for our library version retrieval to work as of Android Studio 4.1.0:
buildConfigField 'int', 'VERSION_CODE', "${project.android_version_code}"
buildConfigField 'String', 'VERSION_NAME', "\"${project.android_version_name}\""
}
```
...and in the root `build.gradle`:
```
buildscript {
//Required for our library version retrieval to work as of Android Studio 4.1.0:
project.ext.set("android_version_code", 70806)
project.ext.set("android_version_name", "7.8.6")
}
```
xa...@google.com <xa...@google.com> #17
Why do you still set
defaultConfig {
versionCode project.android_version_code
versionName project.android_version_name
}
?
This has no impact on the library. All this does is put the version in the manifest, and this gets overridden by the app anyway.
as we mentioned in the release note versionCode
and versionName
from the library DSL at some point (ETA is early 2022 as we need to move fully to our new DSL interfaces first.)
[Deleted User] <[Deleted User]> #18
As for the "why", this is because we need to stay updated and also need to be able to build our library again - so just doing what is necessary to scramble and fix what you guys broke without deprecating first. Thanks for that by the way.
It is rarely obvious to everyone what is obvious to you internal Google devs. Please be more clear with your responses, recommendations, and provide examples if you actually want to assist your userbase properly when breaking changes like this are made.
(i.e. I didn't understand from your comments and the release notes that these could be removed already.)
sa...@gmail.com <sa...@gmail.com> #19
This should be marked duplicate of
ch...@numbereight.ai <ch...@numbereight.ai> #20
I just ran into this issue and find this change absolutely ridiculous.
Rather than deprecating a valuable field that many library developers rely on for logging, crash reporting, serialization, HTTP request tagging, and more, why not rename the field to LIBRARY_VERSION_NAME/CODE if preventing confusion was the rationale behind this change?
And considering it was removed without deprecation, I find it very unprofessional.
I vote to bring it back.
je...@google.com <je...@google.com> #21
it is true that we should have deprecated it first, we will be more careful next time.
as for your example, if you are ready to change your code to use a new property name, then nothing prevents you from generating an appropriate build config field and use that throughout your code.
to...@gmail.com <to...@gmail.com> #22
Because I have an app module and it disappear also from it.
I'm using it to display the app version on the about screen.
But also using it to get information about used libraries version was quite useful :-(
It was possible to use this code com.google.firebase.BuildConfig.VERSION_NAME
je...@google.com <je...@google.com> #23
#22, it should only affect libraries. can you share a repro case ?
to...@gmail.com <to...@gmail.com> #24
One of the library modules was used there. So everything OK. Thanks!
sa...@gmail.com <sa...@gmail.com> #25
#24 So, this actually means that the change itself is helpful. And for anybody who for whatever reason cannot use any of the workarounds listed above, they should simply delay upgrade to the new version of AGP.
fa...@gmail.com <fa...@gmail.com> #26
mu...@gmail.com <mu...@gmail.com> #27
And what to do with BuildConfig.DEBUG? (Sorry it is not for this thread, but I didn't found thread for BuildConfig.DEBUG).
Description
I'm seeing my
BuildConfig.VERSION_NAME
andBuildConfig.VERSION_CODE
fail to be generated, resulting in a build failure.This issue is not present for AGP
4.1.0-alpha04
, but occurs in4.1.0-alpha05
. This issue is still present in4.1.0-beta01
With AGP
4.1.0-alpha04
With AGP
4.1.0-alpha05
VERSION_CODE
andVERSION_NAME
are missing