https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

saket

12/12/2019, 7:08 AM
Uh… I think I got confused with something while juggling many different kind of changes. Replacing
iosX64()
with
fromPreset(presets.iosX64)
is fine, but the actual error is coming from these lines:
Copy code
framework {
  // Disable bitcode embedding for the simulator build.
  if (!buildForDevice) {
    embedBitcode("disable")
  }
}
i

ilya.matveev

12/12/2019, 9:05 AM
Thank you, we will look at this problem. Do I understand correctly that a repro for this problem is just this PR: https://github.com/saket/press/pull/22?
s

saket

12/12/2019, 2:20 PM
Yes!
k

kpgalligan

12/12/2019, 10:49 PM
I kind of whittled down the code and got past the header gen issue. I thought I had it spotted, but reverting to isolate brought it all back
s

saket

12/12/2019, 11:02 PM
I realized that
assertk
is also a bottleneck because it's on an older version of kotlin. Once I get this setup working, I'm never updating the kotlin version until k/n becomes ABI stable.
k

kpgalligan

12/13/2019, 2:43 AM
It’s not that bad. Just need to use updated libraries 🙂
I’ve cloned and updated the old test libraries. See deps.
They’re snapshots but I can publish them for real if interested
I used my special compiler sniffer tech to isolate the problem with the header. Or at least “a” problem. If you replace the object with TODO(), this will compile and build the framework: https://github.com/kpgalligan/press/blob/kpg/dec12/no-crash/shared/src/commonMain/kotlin/me/saket/press/shared/rx/TakeWhile.kt#L21
Copy code
subscribe(
        object : ObservableObserver<T>, CompletableCallbacks by emitter {
          override fun onSubscribe(disposable: Disposable) {
            disposableWrapper.set(disposable)
          }

          override fun onNext(value: T) {
            emitter.tryCatch(block = { predicate(value) }) {
              when {
                it -> emitter.onNext(value)
                else -> emitter.onComplete()
              }
            }
          }
        }
    )
Instead of that, this
Copy code
subscribe(
            TODO()
        /*object : ObservableObserver<T>, CompletableCallbacks by emitter {
          override fun onSubscribe(disposable: Disposable) {
            disposableWrapper.set(disposable)
          }

          override fun onNext(value: T) {
            emitter.tryCatch(block = { predicate(value) }) {
              when {
                it -> emitter.onNext(value)
                else -> emitter.onComplete()
              }
            }
          }
        }*/
    )
That compiles and builds framework, so whatever is failing is in there. Either just the standalone
object
, or
by emitter
, but something is crashing the compiler.
The “special compiler sniffer tech” is just smart guesses and cutting out lots of code till it works, then adding it back.
s

saket

12/13/2019, 9:24 PM
Omg kevin how did you manage to do this. There were so many files. I'll try this as soon as I get back home today.
k

kpgalligan

12/13/2019, 9:27 PM

https://youtu.be/5Nvxv2R01po?t=62

Some guesses. Some “binary search” as in cut out a bunch of code, and see if it still crashes.