-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[RFC] Restore py2 compatibility by using 2 files #1823
Conversation
Apologies for not reporting the Python 2 breakage previously - I really just assumed that you wouldn't care and honestly I don't blame you as it's my problem to keep things working. However, I would be happy to have Unicorn 2 support... Having checked the behaviour of the patch in #1822 I shall try this branch. I'm going to describe what I did to test this - I suspect that this might be a little longwinded, but hopefully it'll indicate where I've made mistakes if I have assumed too much :-) ... When I've got it working (or broken), I will summarise my findings and suggestions... Testing
This gets to the upload section which prints...
At which point I press ctrl-c as I don't want to upload. It would be nice if there was a way to build by not upload. The wheel is present in
I can run my version check and see that it's actually installed properly and should be good to go...
And I can launch the desktop - so that's working well :-) FindingsThis means that it's working as well as it does with Unicorn 1. I'm happy with this change :-) |
I had already added support for the Unicorn 2 features for selection of the CPU type. In order to do this I provide a configuration option that uses the names in the arm_const.py file which start with My code was:
And this had worked fine... however, it now offers an extra CPU model called
I'm pretty sure that this isn't related to the changes for Python 2, but I mention it because the support I had, doesn't allow for this. For now I shall exclude a CPU called In any case, with this code change made, I can now select different CPU models with my configuration interface using the Unicorn 2 system. This makes me happy :-) |
@gerph Thanks for your thorough testing! For the |
Sounds likely. Seems a bit odd having both a MAX and ENDING, but I've worked around that in my CPU model selection code anyhow. |
MAX is the cpu model with all features enabled while ENDING is the ending of the enum list. That’s a bit different.
…________________________________
From: Charles Ferguson ***@***.***>
Sent: Saturday, April 29, 2023 1:51:46 AM
To: unicorn-engine/unicorn ***@***.***>
Cc: lazymio ***@***.***>; Author ***@***.***>
Subject: Re: [unicorn-engine/unicorn] [RFC] Restore py2 compatibility by using 2 files (PR #1823)
@gerph<https://github.com/gerph> Thanks for your thorough testing! For the ENDING problems I believe it's another issue and we added it long time ago?
Sounds likely. Seems a bit odd having both a MAX and ENDING, but I've worked around that in my CPU model selection code anyhow.
―
Reply to this email directly, view it on GitHub<#1823 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHJULO44KUMDMBC6A7OHPULXDRJZFANCNFSM6AAAAAAWYZOILY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Ah! It is a real CPU model that can be selected?! I hadn't realised that. Ok, I will remove it from my list of excluded constants Thank you :-) |
Correct, maybe we should doc this somewhere... The naming is converted from QEMU directly so users without playing with QEMU too much are not familiar with these names. |
Rework a bit to merge back #1629 |
This should bring back Python2 compatibility.
Q: Does this affect the current Python3 code using Unicorn2?
In theory, no.
Q: Does this affect the previous Python2 code using Unicorn1?
In theory, no. But I would be glad if someone could check it.
Q: Why not keep it compatible in 1 file?
It's a tradeoff. We of course desire to reduce code duplication but the fact is that:
Q: So what's the status of Py2 compatibility after this PR?
We will keep the bindings Py2 compatible with all features Unicorn1 offers. For new features, we are glad to review and accept pull requests.