Rubberduck icon indicating copy to clipboard operation
Rubberduck copied to clipboard

Support for ARM-based processor

Open tothzola opened this issue 2 years ago • 30 comments

Hello RubberDuckDev Team, first big big thanks for this great app, very helpful for VBA development ! Recently updated my hardware and want to ask if there will be ARM RubberDuckVBA version? Thank you and keep up the good work.

ARM - Windows 11

System: (Processor Apple Silicon, ARM Virtual Machine) Edition: Windows 11 Home Version: 21H2

Office 2019: Microsoft® Excel® 2019 (Version 2112 Build 16.0.14729.20038) 64-bit

tothzola avatar Dec 09 '21 09:12 tothzola

Rubberduck is currently compiled with the Platform AnyCPU, which for probably historical reasons does not seem to include ARM. Since all releases are created through appveyor, this should be fixable by extending the build matrix in .appveyor.yml: https://github.com/rubberduck-vba/Rubberduck/blob/5a0ac77420dc2ef50405bd24007f31903217f67a/appveyor.yml#L28-L32

I'm not certain how that would impact the installer, maybe @bclothier can shed some light on that. As a workaround it should be definitively possible to build it locally with the Platform set to ARM for an ARM-compatible build.

Vogel612 avatar Dec 09 '21 11:12 Vogel612

Hello, any news, can the installer be build for arm support? Thanks

tothzola avatar Jan 14 '22 05:01 tothzola

I apologize for having missed this question when Vogel pinged me last month.

Can you please clarify when you see the dialog? As soon as you try to run the installer, correct?

I think we need to first answer whether the Rubberduck's code itself can compile on ARM and I don't have an ARM system handy to prove this.

What I'd want to do is see if we can get a volunteer to try and install Rubberduck manually without the installer so we can verify it will work on ARM without issues and if we can prove that, we can try and extend the installer to run on ARM.

bclothier avatar Jan 14 '22 11:01 bclothier

Just to leave notes for development:

Inno Setup has a flag for ARM64 here: ProcessorArchitecture

However, we have this entry: https://github.com/rubberduck-vba/Rubberduck/blob/9aa8194e4a2dc811594d803c272505401044c34d/Rubberduck.Deployment/InnoSetup/Rubberduck.Installer.Build.iss#L65

May be as simple as adding arm64 to the line but even if that means installer will work on ARM, doesn't mean Rubberduck itself will work on ARM.

bclothier avatar Jan 14 '22 11:01 bclothier

Hello, thanks for the answer.

Sure I can volunteer to install RubberDuckVBA, on my system.

Can you walk me thru how could I install it manually I only installed trough the installer, and yes the message above appears as soon as click on the installer.

System is Apple silicon (M1 Pro) Windows 11 on Parallels 17.

tothzola avatar Jan 14 '22 11:01 tothzola

When there's time, a zip file and instruction will be prepared here. Thanks for volunteering!

bclothier avatar Jan 14 '22 11:01 bclothier

Also, forgive me for asking such basic question but I want to be super duper sure --- we can run VBA code on an ARM system, right?

bclothier avatar Jan 14 '22 11:01 bclothier

Ok I did some quick testing on my personal add-in, everything runs ok just on function doesn't get recognized. The input function. But I do some research, will get it done.

Meanwhile in the task manager excel runs on ARM(x64 compatibility mode).

tothzola avatar Jan 14 '22 13:01 tothzola

Hello @bclothier, any updates on this issue? Thanks

tothzola avatar Mar 18 '22 19:03 tothzola

My VBA-apps work perfectly on ARM-processor. Support for ARM would be much appreciated. I can do some testing if that would help.

lvavesaath avatar Apr 20 '22 08:04 lvavesaath

Hello @Developers, any update on this issue?

Thanks

tothzola avatar Jul 05 '22 16:07 tothzola

@tothzola

As a workaround it should be definitively possible to build it locally with the Platform set to ARM for an ARM-compatible build.

None of the developers have an ARM machine to run any tests surrounding this, as such your best bet on getting support for it is spending an hour on setting a local build and installer up for yourself and submitting a PR if it works :) All the necessary steps after cloning and opening in Visual Studio are already outlined in this thread.

Vogel612 avatar Jul 05 '22 17:07 Vogel612

Hi and thanks for the lib !!

Same problem here, unfortunately i don't know how to build locally, but will be happy to help if someone can guide me.

@tothzola Have you found a solution ?

arthur-verta avatar Sep 29 '22 08:09 arthur-verta

Hi and thanks for the lib !!

Same problem here, unfortunately i don't know how to build locally, but will be happy to help if someone can guide me.

@tothzola

Have you found a solution ?

@arthur-verta hello, I did try to compile my own version locally but I couldn't figure out how, so unfortunately no. Keep me updated if you succeed. Thanks

tothzola avatar Sep 29 '22 11:09 tothzola

I’m pretty fluent in VBA and other languages but have no clue how to even start building my own Rubberduck.com http://rubberduck.com/-thingamajig. So I’m stuck in waiting mode.

If anyone can give usefull instructions, I’m more than willing to test.

In the meantime, I bought a Windows-machine to continue developing for my clients.

Cheers.

Op 29 sep. 2022, om 13:14 heeft Toth Zoltan @.***> het volgende geschreven:

Hi and thanks for the lib !!

Same problem here, unfortunately i don't know how to build locally, but will be happy to help if someone can guide me.

@tothzola https://github.com/tothzola Have you found a solution ?

@arthur-verta https://github.com/arthur-verta hello, I did try to compile my own version locally but I couldn't figure out how, so unfortunately no. Keep me updated if you succeed. Thanks

— Reply to this email directly, view it on GitHub https://github.com/rubberduck-vba/Rubberduck/issues/5914#issuecomment-1262131828, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOHCHJ3G3AHIZQIKTJMOQF3WAV2ZJANCNFSM5JWAJ3KA. You are receiving this because you commented.

lvavesaath avatar Sep 29 '22 11:09 lvavesaath

any updates on this? love rubberduck but have now migrated to apple silicon like @lvavesaath I am willing to test if needed

T2MWorks-Mitch avatar Jan 07 '23 14:01 T2MWorks-Mitch

Nothing here... Still stuck and still available to help if someone is wanting to guide us on how to compile it 👍

arthur-verta avatar Jan 07 '23 18:01 arthur-verta

Because I don't have an ARM64 processor and because there seems to be an issue with using the build to build an ARM output, this makes things a bit more complicated so before we go to the trouble, I want to confirm this is a working version of ARM64 build. If any of you can confirm that this is working, we can look into integrating this in the build process.

This is the setup file as a zip since GitHub doesn't allow uploading exe file directly. Unzip it then run the setup. This will not run on any other architecture. Rubberduck.Setup.ARM64.zip

bclothier avatar Jan 08 '23 01:01 bclothier

hey @bclothier thank for this. I have attempted to get this working , but the COM addin does not seem to want to load. The installer runs fine , but I get "rubberduck add-in failed to load" error when launching the IDE. I have tried installing for single user as well as all users. I was able to run the .bat file sucessfully but no change in the error message . I also tried to run the regasm command from the the troubleshooting guide , and it resulted in a "rubberduck.dll is not a valid assembly" error

My MSO is Version 2211 Build 16.0.15831.20202) 64-bit on windows 11 Enterprise for ARM64

T2MWorks-Mitch avatar Jan 08 '23 03:01 T2MWorks-Mitch

hey @bclothier thanks for the zip. Same thing here. I installed it as administrator, without problem. Then got the following error message when opening VBA or going to the add-in manager :

image

on Microsoft® Excel® for Microsoft 365 MSO (Version 2211 Build 16.0.15831.20202) 64-bit

arthur-verta avatar Jan 08 '23 04:01 arthur-verta

I did some research and one thing I noticed is that the Rubberduck's DLL files are reported as ARM64 so that's right. I determined this using ROM Properties. However, the dependent DLLs that aren't owned by Rubberduck does not appear to be generated as ARM64. I do not know if that's a factor but if the dependent DLLs fail to load due to incompatibility, that might be why.

Furthermore, Rubberduck depends on Easyhook and unfortunately, it's not clear whether it is capable of running on ARM64 platform. We would need to verify that it will work there as I don't see any special build for ARM64. It might just work as-is but I can't be 100% sure that's the case.

Finally, I looked at the tlbexp, regasm can tell you that there are no specific flags for ARM64. I got nothing about generating the type library. Given that COM is an ABI, it might be that there is no difference. If that is true, then I would expect that you would be able to use VBIDE's Tools -> References and manually browse to the Rubberduck.x64.tlb and it should then load and expose all the objects within that library. If that is the case, then it's likely not an issue with type library generation but rather the dependent DLLs not being able to load with the ARM64 build.

I can post a branch for those with a ARM64 version of Visual Studio and see if they have any better luck building and running it.

bclothier avatar Jan 08 '23 04:01 bclothier

Hy @bclothier, I also installed the Rubberduck ARM64 setup, so far have the same issue. Don't know any details maybe this screenshot tells you more to te problem:

image

It displays as loaded but missing extension ... ?

*Edit: Also checked the VBIDE's Tools -> References -> Rubberduck.x64.tlb

image

Objects can be referenced.

Microsoft® Excel® 2016 MSO (16.0.14332.20431) 64-bit

Thanks & Cheers Zoltan.

tothzola avatar Jan 08 '23 07:01 tothzola

Ok, so I got the confirmation that yes, EasyHook indeed can only run on x86 architecture and we would need to get an ARM build of EasyHook before we can then run Rubberduck on ARM. In the light of that information, we're effectively blocked on this until EasyHook can provide an ARM build.

Incidentally, it should be pointed out that Rubberduck has a number of other dependencies as well. For example, the Castle Windsor makes no mention of any ARM support and the ROM properties report their DLL as 32-bit "Intel i386 (.NET)" as shown below. This seems to be true for all other dependent DLLs including ANTLR and various Microsoft stuff: image Note: I think that the reporting those as "32-bit" may be technically incorrect if they've been compiled for Any CPU but for our goals here, that's still a problem because we need ARM and I assume it has to be ARM64 all the way down for the project to run correctly.

bclothier avatar Jan 08 '23 15:01 bclothier

@bclothier Thanks for efforts , unfortunate that external dependencies are blocking this.

A quick look at the easyhook repo shows that this has been discussed since the ARM based WinRT came out (7 yrs ago!) and there was never a resolution.

Maybe with the introduction of the M series hardware there will be more interest in ARM compatibility.

I have Win64 resources to run things in case , but have been trying to reduce my machine sprawl and have been moving to the MBP with parallels for Win. Parallels is excellent but it can't emulate Wintel I guess

T2MWorks-Mitch avatar Jan 08 '23 16:01 T2MWorks-Mitch

Parallels is a virtualization software rather than an emulator so if your MBP is based on an ARM processor rather than an Intel processor, then Parallels has to work with ARM-based Windows software. An emulator would be much slower. If you have any Mac that still has an Intel processor, then Parallels should be able to allow you to use x86-compiled software. I know that really doesn't help with the machine sprawl, though.

bclothier avatar Jan 08 '23 17:01 bclothier

Thanks @bclothier for enlightment.

Have some of you found Rubberduck replacement solution, by any chance, running on ARM ? Even paying product ?

arthur-verta avatar Jan 08 '23 17:01 arthur-verta

IIRC EasyHook is only used for hooking the Fakes API (and the "beep" suppressor for autocompletion features); if it's the only thing holding back an ARM64 build, there's probably a way to fork RD and build it without this dependency (obviously at the cost of the Fakes API not making it). As for a replacement, I'm not sure about ARM64 but I think twinBASIC is a serious contender.

retailcoder avatar Jan 08 '23 18:01 retailcoder

Actually twinBASIC is also unavailable for ARM at this time.

As a temporary solution, I've been setupping an Azure Virtual Machine running on Windows 11 64 Bits. Rubberduck is running like a charm on it, and i can access it from my MacBook M1.

It is a solution that work fine if you just need to do a Rubberduck check / cleaning from time to time. I won't recommend if you need Rubberduck during full-time developing, as it would get expensive, and some latency can be experienced.

For information, pricing is billed per minutes of machine running on Azure. As an example, for a competitive machine, it cost about 0,20$/hour (equiv. 140$ if running full-time during a month). So if you turn off the machine when you are not using it, the budget can remain very reasonable.

arthur-verta avatar Jan 13 '23 20:01 arthur-verta

Hey @bclothier,

is there really a arm64 build necessary? Windows on ARM machines can run x64 and x86 executables. Maybe only the check for the system should be removed.

I want to compile it myself for testing. But unfortunately it wont compile out of the box. Is there a developer.md / documentation for developers to start? So I know what to install to build this. (Visual Studio 2022, .Net 4.6.2...)

reinies avatar Sep 06 '23 11:09 reinies

@reinies we have a wiki article about getting a local build started: https://github.com/rubberduck-vba/Rubberduck/wiki/Contributing

Note that the article was last edited in January 2023 and dates back to quite a while before that, so it might not be perfectly accurate to the actual state of the build process.

We basically have a multistep build that performs everything you need.
If you need any help with the process, I can highly recommend our public discord

Vogel612 avatar Dec 23 '23 16:12 Vogel612