Windows Subsystem For Linux as build host (thread)

Hi. There is not really any mention of WSL in the developer wiki and barely any mention in the forums either, so I thought I’d try and set up a build environment using WSL2 and see what happens. It seemed to work.
Following the steps at Developers - MOD Wiki and mod-plugin-builder/README.md at master · moddevices/mod-plugin-builder · GitHub but running from within the wsl shell (I used Ubuntu 22.04.1, in case that is relevant), targeting building for Dwarf. Initially I had a problem trying “./bootstrap.sh moddwarf”. But I noticed that there’s a platform called “moddwarf-new” (in addition to the platform called moddwarf), which doesn’t seem to be documented, at least not in the wiki page nor github README. For me, “./bootstrap.sh moddwarf-new” worked , building the eg-amp-lv2-labs example worked, and installing to the Mod Dwarf also worked.

All in all, a success, as far as initial attempts go.
Is WSL officially (or unofficially) supported as a build host? If so, is it worth updating the wiki? Or is it unsupported, and there’s a future-gotcha that I might encounter? (I’m expecting that the validation steps will be different/not work)
Also - any info on “moddwarf-new” platform and where I can find out more? Is “./bootstrap.sh moddwarf” expected to succeed or fail, currently?

3 Likes

I also used WSL for building in the beginning. You are not accessing any hardware - so it should work as any other linux variant.

In the meantime I switched to docker for building plugins. cbix has an up-to-date repo: Docker or you build one yourself.

4 Likes

@spunktsch cool, thanks for the confirmation! Seems like WSL works well :+1:
And I just retried “./bootstrap.sh moddwarf” and it worked too, (and build ,and installing to Dwarf, also succeeded). so maybe something unrelated to WSL when I encountered an earlier problem.

2 Likes

I haven’t built any Mod plugins (don’t have a Mod unit) but I did use WSL to run Faust and then either to the ESP-32 (not worth the effort) or building VSTs via Juce (worth the effort). The only weird thing was doing 1/2 in WSL and 1/2 in Windows. I set up some scripts and used both Notepad++ and Explorer++ to help keep track of everything. The Windows file system can be accessed from WSL and vice versa but it’s not well documented.

1 Like

Some plugin frameworks allow you to cross-compile to different architectures. I build my windows binaries from linux. So then you never have to exit WSL for this toolchain :wink:

2 Likes

Using Juce? Or something else?

DL

1 Like

At least with DPF, used by Cardinal and hvcc, you can use mingw to build windows binaries:

2 Likes

If you make use of GitHub - DISTRHO/dpf-makefile-action: A GitHub action for DPF-based plugins using Makefile that could likely be simplified further.

2 Likes

@falkTX If I’ve understood it correctly, that github action is unrelated to WSL. (Are you saying the recommendation is to not use WSL, and to use github action instead? If so, what’s the main issue of using WSL)

1 Like

If you want to use CI builds then the action is convenient, if you want to do local build a WSL would be set up similarly as what I linked.
This way you could use an ubuntu WSL environment to create windows + linux builds locally.

I have no idea if JUCE can be cross-compiled with mingw, but DPF sure can.

2 Likes

I would probably do both in the end (local builds and CI). I assume people who use CI also do local builds!

Since I’m just asking about building plugins for MOD, I assume I would only need to be targetting Linux. Maybe in the future I’ll have a need for a Windows target (in the context of the MOD ecosystem I’m not sure what that might be, but I guess I have more research/learning to do).

And I think I found more details about moddwarf-new target in this forum post:
(Chances to migrate to C++20 compatible compiler in mod-plugin-builder - #2 by falkTX) which I think means it’s preferred (instead of moddwarf target). I’ve interpreted this as meaning moddwarf should be ok to use but will migrate to same as moddwarf-new soon

1 Like