Skip to content

Conversation

@jonpryor
Copy link
Contributor

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073
Context: a296784

When we added the new classes.zip functionality, there was one oddity
present. On the first build, everything appears to be normal. On the
second build, classes.zip appeared to contain itself inside itself???

To make things even stranger, I wrote a unit test that contains a
Java.Lang.Object subclass in which its type and namespace names change
on each write. This worked fine on macOS, even with the oddity of
classes.zip continually zipping itself inside itself... The new java
sources would appear at the bottom of the list within the zip file.

Everything broke down when I tried my unit test on Windows, the case of
classes.zip trying to compress itself inside itself was silently
failing. It was not processing any further files after the failing zip
entry, and so in theory this situation would cause many Java stubs to
be missing from the zip.

Solution? Let's just put classes.zip up one directory.

So instead of:

obj/Debug/android/bin/classes/classes.zip

Move it to:

obj/Debug/android/bin/classes.zip

This prevents the classes directory from containing classes.zip, and
our strange case of classes.zip inception.

Merry Christmas! I'm going to go play Skylanders now.

Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=61073
Context: a296784

When we added the new `classes.zip` functionality, there was one oddity
present. On the first build, everything appears to be normal. On the
second build, `classes.zip` appeared to contain itself inside itself???

To make things even stranger, I wrote a unit test that contains a
`Java.Lang.Object` subclass in which its type and namespace names change
on each write. This worked fine on macOS, even with the oddity of
`classes.zip` continually zipping itself inside itself... The new java
sources would appear at the bottom of the list within the zip file.

Everything broke down when I tried my unit test on Windows, the case of
`classes.zip` trying to compress itself inside itself was silently
failing. It was not processing any further files after the failing zip
entry, and so *in theory* this situation would cause many Java stubs to
be missing from the zip.

Solution? Let's just put `classes.zip` up one directory.

So instead of:
```
obj/Debug/android/bin/classes/classes.zip
```
Move it to:
```
obj/Debug/android/bin/classes.zip
```

This prevents the `classes` directory from containing `classes.zip`, and
our strange case of `classes.zip` inception.

Merry Christmas! I'm going to go play Skylanders now.
@jonpryor jonpryor merged commit 8b34f1d into dotnet:d15-5-no-dtb Jan 10, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants