easeprobe
easeprobe copied to clipboard
Find an alternative solution for bou.ke/monkey
Currently, all tests will fail with the following log:
# bou.ke/monkey
Error: ../../../go/pkg/mod/bou.ke/[email protected]/replace.go:24:14: undefined: jmpToFunctionValue
This seems to be related to the library's implementation on Mac M1. The bou.ke/monkey library has been archived for a long time and has license restrictions as mentioned in this issue.
I've found an alternative library, gomonkey, but there seems to be some API incompatibilities like Patch, UnpatchAll, etc.
Any suggestions @suchen-sci ?
This problem has existed for a long time, and it's unfortunate that bou.ke/monkey does not work on Mac M1. If gomonkey works on all chips and offers all the functionality we need, we might consider using it. However, this change would be significant; a lot of code would need to be updated in this case.
Or we can fork the bou.ke/monkey and fix that problem on mac M1?
Fortunately, I came across another monkey library, derived from bou.ke/monkey.
However, there are still some incompatibilities with this library, such as the removal of PatchInstanceMethod. I've submitted an issue requesting the restoration of the PatchInstanceMethod method.
Perhaps we should wait for their response before deciding whether to fork and fix the issue.
Summary:
- The
bou.ke/monkeylibrary is only compatible with the amd64 architecture. - The
macos:latestrunner corresponds to macOS-14-arm64.
Given these points, we have two options:
- Seek an alternative to
bou.ke/monkeythat supports arm64, which needs extra coding and testing work. - Use an amd64-based runner like
macos-13, which is a straightforward change but may not align with the release cycle of easeprobe.
What are your opinions, @suchen-sci?
Well, I thought you were using a Mac M1... If it doesn’t affect your work, I would prefer the second option. Could we also add another build.yaml to the GitHub Actions to ensure that Easeprobe can be built on the latest Mac version?
What do you think? Additionally, could we update it when github.com/go-kiss/monkey is ready?
Great idea! Let's fix it quickly and keep an eye on the progress on github.com/go-kiss/monkey.