Skip to content

Conversation

aafa
Copy link
Contributor

@aafa aafa commented Mar 5, 2016

Adding some more details on why build failed to be processed

@pfn
Copy link
Member

pfn commented Mar 7, 2016

I'm tempted to not merge this change. Mostly, bytecode corruption would be a problem caused by tools doing the wrong thing (in this case, javassist/realm) and since these aren't standard and sort of require development anyway, I would expect one to debug it by throwing the message in manually.

val r = new ClassReader(in)
r.accept(x, 0)
} catch {
case e: Exception => throw new IllegalArgumentException(s"NativeFinder processing `$entry` went wrong, bytecode is corrupted")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error should be more along the lines of

throw new IllegalArgumentException(s"Failed to process bytecode for$entry", e)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will update if you gonna merge it in.

@aafa
Copy link
Contributor Author

aafa commented Mar 7, 2016

What was most striking to me is that javasist silently messed up with bytecode and that was discovered latter on in a build process. I will probably look into this again latter.

Probably you right, if someone has been done something to bytecode outside of android-plugin, responsibility is on them. But still I would be more chill to have this additional level of clarity here.

@aafa aafa force-pushed the NativeFinder-add-exception branch from 2ff7eb1 to 9bb61f2 Compare March 7, 2016 20:09
@aafa
Copy link
Contributor Author

aafa commented Mar 7, 2016

Commit updated.

@pfn
Copy link
Member

pfn commented Jul 20, 2016

I guess it doesn't hurt, might as well merge

@pfn pfn merged commit ed07442 into scala-android:master Jul 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants