Status Update
Comments
ch...@gmail.com <ch...@gmail.com> #2
(1) Create new C++ project
(2) Run the app (this create's the binary directories
(3) Do something to cause a gradle Sync
(4) Look for files under .externalNativeBuild. They're there:
jomof@jomof:~/projects/client/src/android/MyApplication4/app$ find "." -name "*.o"
./.externalNativeBuild/cmake/debug/x86/CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
Please add repro steps so I can get a better idea of what's happening.
>> It should only delete the CMake binary directories *if and only if* parameters change in Gradle that cause cmake toolchain parameters to change (such as platform version, abi, toolchain) or parameters passed to CMake to change.
This is the way it's design to work and it is working that way for the cases I know
na...@gmail.com <na...@gmail.com> #3
[Deleted User] <[Deleted User]> #4
1. Make a change to a CMake script
2. Switch to Android Studio. I am prompted to do gradle sync, and so I do it.
On next build, a full rebuild is performed. For some reason it is not performing a delta build. Some libraries are rebuilding that should not be rebuilt. So obviously a "ninja clean" is happening somewhere. There's simply no other explanation for this.
Jomo, can you please reopen? This is still a very real problem.
pa...@gmail.com <pa...@gmail.com> #5
From what you wrote I think this is intended behavior. If you change the CMake script then the CMake-generated Ninja project must be regenerated. Since there's a new Ninja project there needs to be a full build. There's no concept of delta build that survives changes to build command files (CMakeLists.txt or ninja build files) because any behavior difference is possible.
le...@gmail.com <le...@gmail.com> #6
If you do a traditional CMake build from the command line, CMake will regenerate but it will not clean your previously compiled translation units (the object files). Those remain in-place. This allows you to perform another build (e.g. execute "ninja" command) and the build tool and compiler working together will be smart enough to know which files need to be rebuilt.
From this standpoint, I disagree with your assertions. There's no functional reason AFAIC to "clean" build every time a CMake script changes. If command line parameters to CMake change in such a way that it would completely invalidate previously compiled translation units outside of the knowledge of ninja and the toolchain programs, such as changing the Android ABI via toolchain arguments, then yes you would need to clean everything and rebuild. However, beyond that, you should be relying on ninja and the compiler to perform delta builds on previously compiled translation units.
As you have it now, I am unable to do a simple task like add new CPP files without having to rebuild my entire project. This wastes about 15-20 minutes of my time (that's how long a full rebuild takes), versus less than 60 seconds to just build the new file.
I think you should aim for smarter introspection into how this mechanism works. I see two very simple scenarios:
1) A build & sync was triggered due to parameter changes from gradle (those that affect the externalNativeBuild configuration, such as native ABI changes and custom user arguments)
2) A build was triggered because CMake.exe told you that a regeneration was needed since it detected a CMakeLists.txt changed
#1 should perform a clean & rebuild
#2 should not require any special action from you; you should simply run "ninja" command as if the scripts hadn't changed at all, and let Ninja run CMake to regenerate as needed
I feel like #2 is being treated as #1 right now. Also I noticed that Android Studio wants to re-sync Gradle when a CMakeLists.txt file changed. I do not think Android Studio should be "watching" CMake scripts. It should only resync if gradle scripts changed. If a CMake script changes, let your "ninja" command handle it.
As a final note, I realize I'm probably oversimplifying this a little. I'm sure there's reasons and edge cases as to why you need that level of control over CMake. However, at some point the full clean build has to be triggered in a smarter way to avoid these giant productivity problems. You obviously know much more about how CMake integrates with Android Studio than I do; I can only offer feedback based on my direct usage of CMake outside of AS. However, I hope my feedback makes sense and is agreeable.
le...@gmail.com <le...@gmail.com> #7
External native generate JSON x86Debug: - dependent build file missing or changed
External native generate JSON x86Debug: removing stale contents from 'E:\code\frontend\source\Applications\zPayService\TestTool\.externalNativeBuild\cmake\x86Debug\x86'
The "removing stale contents"... those contents aren't stale at all. A build could be executed that reuses those existing object files if all I did was modify the cmake script to add new files to compile.
bj...@edlisten.com <bj...@edlisten.com> #8
1. Go from branch A to branch B
2. Go from branch B back to A
Cmake script is still physically the same, but because you swapped branches around, the timestamp of the Cmake script changed so this triggers a full rebuild.
At this point I'd say this is our biggest issue at Ziosk and the one causing the most productivity problems. Our team of about 15 engineers is constantly complaining. There's concern on how long Google will take to address these issues, some have proposed rolling back to Eclipse + ANT. If we're a year out from any improvements I may have to consider it.
ko...@gmail.com <ko...@gmail.com> #9
[Deleted User] <[Deleted User]> #10
I think I can cover this case by specific removing only unrecognized .so files during sync.
pa...@gmail.com <pa...@gmail.com> #11
However, this still falls into the pattern of behavior I've outlined previously. Indirect or direct changes to Gradle or Gradle scripts that result in a different command line invocation of CMake should result in a full clean (delete binary dir + regenerate using CMake). Changes to the CMake scripts themselves shouldn't be monitored by Android Studio at all. If you have weird cases where CMake is doing work the NDK toolchain should be doing, such as lots of system introspection and runtime changes to toolchain, I'd simply document that Google does not support that usage of CMake, and all changes should go through Gradle instead (or file a bug with the NDK team and have them fix the toolchain file).
ve...@gmail.com <ve...@gmail.com> #12
This solution is simple and doesn't require introspection into CMake targets. If you have more direct access to targets defined by CMake, you could keep track a list of targets found during configuration and query the OUTPUT property on each of them and correlate that to files you find in your CMake output directory. Not sure if this has much benefit over the idea above, though.
ko...@google.com <ko...@google.com> #13
wa...@kcusd.net <wa...@kcusd.net> #14
pd...@gmail.com <pd...@gmail.com> #15
ma...@pipplet.com <ma...@pipplet.com> #16
el...@gmail.com <el...@gmail.com> #17
fa...@gmail.com <fa...@gmail.com> #18
pa...@gmail.com <pa...@gmail.com> #19
mc...@cep-redlands.com <mc...@cep-redlands.com> #20
le...@gmail.com <le...@gmail.com> #21
team that works on this product.
Does that mean that the team is actually working on it?
Great!
On Mon, Apr 3, 2017 at 2:55 AM, <buganizer-system@google.com> wrote:
ek...@google.com <ek...@google.com>
cw...@faultlineplumbing.com <cw...@faultlineplumbing.com> #22
ek...@google.com <ek...@google.com>
sa...@gmail.com <sa...@gmail.com> #23
fa...@gmail.com <fa...@gmail.com> #24
I am not sure but it seems like a one-hour feature as we already have getSheetByName
ta...@gmail.com <ta...@gmail.com> #25
Whatever the case, this is easy enough to work around with the solution proposed in the first post. I'd recommend any future users go that route; this is just one of a few different topics that have brought this up over the past decade. Unlikely change is coming soon.
cr...@gmail.com <cr...@gmail.com> #26
Anyway for those looking for a less intuitive and not 100% solution: use openByUrl + getActiveSheet
A link that links directly to a certain sheet in a spreadsheet looks like this
So if you open spreadsheet by this link, the active sheet would be exactly the sheet you are looking for
[Deleted User] <[Deleted User]> #27
er...@medable.com <er...@medable.com> #28
ha...@nightline.fr <ha...@nightline.fr> #29
tl...@outdoorequipped.com <tl...@outdoorequipped.com> #30
ig...@gmail.com <ig...@gmail.com> #31
You will be surprised when you find out that it doesn't work.
We needed this "getSheetById" method
jp...@google.com <jp...@google.com>
jp...@google.com <jp...@google.com> #32
I am marking this issue as FIXED
as the internally reported issue has been marked as FIXED
. Please note that there may be a delay in rolling this out to production. Thank you for your patience and please comment here if the issue remains.
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #33
Yesss!!!
Rhino runtime: working ok!
v8 runtime: "TypeError: sp.getSheetById is not a function"
I will try again in a few days.
THANK YOU ALL
jp...@google.com <jp...@google.com> #34
It is currently rolling out, possibly available by next week for all scripts.
lu...@lvdenvironnement.fr <lu...@lvdenvironnement.fr> #35
jp...@google.com <jp...@google.com> #36
Still in staging, if it doesn't roll out this week to production, it is likely going to be the first week of December. This time of year is slow with releases due to various production freezes.
jo...@ascensoreslaplata.com.ar <jo...@ascensoreslaplata.com.ar> #37
I confirm:
Rhino runtime: working ok!
v8 runtime: working ok!
Thanks, again.
jp...@google.com <jp...@google.com> #38
I posted an example at
Note that there currently is a bug in sheet.getSheetId(),
Description
The sheet id is the only immutable reference to the sheets within a spreadsheet. (Name, Index are both variable based on user behavior)
Methods for retrieving sheets rely are limited to using the name or index (e.g. ss.getSheetByName("Sheet1") or ss.getSheets)[0]) of the sheet.
There is currently a method to get the ID of a sheet (e.g. sheet.getSheetId() ) but no method for retrieving the sheet by ID (e.g. ss.getSheetById(id). Instead, this must be accomplished by writing a custom function like the one below:
function getSheetById(ss, id) {
var sheets = ss.getSheets();
for (var i=0; i<sheets.length; i++) {
if (sheets[i].getSheetId() == id) {
return sheets[i];
}
}
return;
}
While this is not a huge inconvenience, it creates a performance penalty and seems like something that should be part of the service given how frequently it arises.