I think there's something more at play here because I was able to produce fat AARs that looked healthy using artifact (i.e., `DISABLE_COMPILE_ENVIRONMENT`) builds when I wrote down some things about this process over in Bug 1759727. > > We found that `hasCompileArtifacts` defined to fix #1749693 does not take this case into account. > > Just adding `|| mozconfig.substs.MOZ_ANDROID_FAT_AAR_ARCHITECTURES` to the function does not work, unless it is added also to the first `if` in `syncLibsFromDistDir.onlyIf {`. > > > > As a temporary workaround, we changed the calls to `hasCompileArtifacts` in our fork with boolean values, and we could generate the fat .aar as we did before. > > I'm a little bit confused by this statement. [The first `if`](https://searchfox.org/mozilla-central/rev/0e93b94f4c2045c6a5f5260ee48bbf7a94a993bc/mobile/android/gradle/with_gecko_binaries.gradle#257) in `syncLibsFromDistDir.onlyIf` is for `hasCompileArtifacts` so how would adding `MOZ_ANDROID_FAT_AAR_ARCHITECTURES` do anything? or do you mean adding it _only_ there? This is as intended. (But it could be changed.) We use `!COMPILE_ENVIRONMENT && !MOZ_ARTIFACT_BUILDS` as the signal that we shouldn't manage JNI libraries: i.e., for lints, etc. (The comment is, in this fact, correct.) Pier is trying to use that configuration to do things with JNI libraries. The simplest thing to do is to perform an artifact build for these fat AAR productions. Otherwise, we'll need to add Yet Another Flag to distinguish this use case from all of the others.
Bug 1763770 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I was able to produce fat AARs that looked healthy using artifact (i.e., `DISABLE_COMPILE_ENVIRONMENT`) builds when I wrote down some things about this process over in Bug 1759727. > > We found that `hasCompileArtifacts` defined to fix #1749693 does not take this case into account. > > Just adding `|| mozconfig.substs.MOZ_ANDROID_FAT_AAR_ARCHITECTURES` to the function does not work, unless it is added also to the first `if` in `syncLibsFromDistDir.onlyIf {`. > > > > As a temporary workaround, we changed the calls to `hasCompileArtifacts` in our fork with boolean values, and we could generate the fat .aar as we did before. > > I'm a little bit confused by this statement. [The first `if`](https://searchfox.org/mozilla-central/rev/0e93b94f4c2045c6a5f5260ee48bbf7a94a993bc/mobile/android/gradle/with_gecko_binaries.gradle#257) in `syncLibsFromDistDir.onlyIf` is for `hasCompileArtifacts` so how would adding `MOZ_ANDROID_FAT_AAR_ARCHITECTURES` do anything? or do you mean adding it _only_ there? This is as intended. (But it could be changed.) We use `!COMPILE_ENVIRONMENT && !MOZ_ARTIFACT_BUILDS` as the signal that we shouldn't manage JNI libraries: i.e., for lints, etc. (The comment is, in this fact, correct.) Pier is trying to use that configuration to do things with JNI libraries. The simplest thing to do is to perform an artifact build for these fat AAR productions. Otherwise, we'll need to add Yet Another Flag to distinguish this use case from all of the others.