-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
random magic value using modified cmd/link alternative #628
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good to me - pretty thorough review below :)
I think your reasoning about AST vs plaintext patching is reasonable. git patching for pretty static stuff, but AST patching for dynamic (e.g. magic comparison) or mechanical (e.g. remove printlns) changes sounds like a good tradeoff.
Would like to see if @capnspacehook or @lu4p disagree with that hybrid patching strategy.
Oh, and we probably need to add an item to the README's caveats section about the temporary dependency on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good now! Just some minor comments. My main concern is still the racy file lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I forgot to update patch :) |
Ah, let me know when you're ready. I was in the middle of squash-merging with a new commit message. You can also write the final commit message yourself, if you prefer. |
Done. You write better commit messages :) |
Written - let me know what you think or if I missed anything. |
Alternative and in my opinion better implementation (previous - #623)
Applying git patch to modify magic value and in future strip runtime seemed good at first glance, but big problems surfaced when trying to implement it:
print/println
from runtime already means 500+ modifications in lots of filesPatches are good in linker because they are static (there are no flags like
-tiny
or dynamic values)I think this implementation is a good balance between readability and convenience of patches and versatility of modifications through ast