Add option to force load a project by ignoring the version check
Is your feature request related to a problem? Please describe. My problem could be argued to be a problem, caused only by myself - the user. However,... I loaded a project file into a rizin-version built locally from this repo and saved it afterwards (overwriting my initial project). This led to a version-information within my project file being younger then the rizin-version installed locally. A check prevents me now to use the project-file on my installed rizin. This is in general expected behavior. However, in some cases there are no backups, the newer version of rizin might not be packaged yet (or simply not available by a packager/distro) and reverting a migration is also no option.
In those cases, I personally would agree that taking the risk of using an improper (newer) project version and loading it, is still the best solution - even without any guarantee for correctness or defined behavior.
Describe the solution you'd like
I want an option that bypasses the version check version > RZ_PROJECT_VERSION in rz_project_load.
My proposal is adding a new CLI-flag to the rizin-binary that will force the load of a project-file. Of course this option will come without any guarantee and any user should only choose this as a last desperate option under similar circumstances.
I would choose the CLI-flag -P (in contrast to -p for the normal "Load project file").
Describe alternatives you've considered I ended up building the exact version, installed on my system - removing the version-check manually for this experiment - loading and saving the already migrated project file with the old version. So far, I have not seen any "bad" impact from doing this. However, I can not tell anymore which version my project file had (but I think I migrated from 19 -> 20 - and then "forced a backward migrate" to 19)... By looking at the migration-function, I can imagine that the proposed "force" would not always work out and will result as minimum in a loss of information. However, it might be more convenient for anybody, relying on multiple versions of rizin to sometimes simply ignore the check and take the risk.
I'm fully aware and fine that a simple alternative is just refusing this proposal...
Sounds like a bug. If the original project file was a lower version it should have been migrated to the newer version. Only backwards is not possible.
No, it isn't a bug. I migrated the project file by accident. And then I struggled to use it in an older Rizin-version. This issue is about providing a loophole for such a corner case.
Sorry. I rushed the reading. Updated the labels.
Not sure it's a good idea. As this is one-off scenario, you could just modify the sources locally to force loading. I am against bringing this into the main codebase.
Maybe the migration handler can make a copy/backup of the project file instead?
Maybe the migration handler can make a copy/backup of the project file instead?
This approach sounds reasonable and more generic. We can go for it, I think.
@amibranch Would you be up to implement this? Since you already patched out the version check you probably know your way around this piece of code. And it is really just a 2-5 line change + test.
Yes, will do. However, it still may take me some days until I push it here