Skip to content
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

Defining an MSYS2 build command list #7526

Open
1 task done
bratpeki opened this issue Sep 29, 2024 · 86 comments
Open
1 task done

Defining an MSYS2 build command list #7526

bratpeki opened this issue Sep 29, 2024 · 86 comments
Labels

Comments

@bratpeki
Copy link
Contributor

bratpeki commented Sep 29, 2024

System Information

Windows 10

LMMS Version(s)

Git

Most Recent Working Version

No response

Bug Summary

Following https://github.com/LMMS/lmms/wiki/dependencies-windows#linux-cross-compile to compile on Windows is not straightforward.

I set up Debian using WSL2 on my machine.

The sudo add-apt-repository ppa:tobydox/mingw-w64 command gives the following result:

image

Expected Behaviour

The command gives no errors, and one may proceed with the compilation steps.

Steps To Reproduce

  • Get WSL2 and install Debian
  • Run sudo apt update and sudo apt install software-properties-common
  • Run the command in question

Logs

peki@...:~$ sudo add-apt-repository ppa:tobydox/mingw-w64
[sudo] password for peki:
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 362, in <module>
    sys.exit(0 if addaptrepo.main() else 1)
                  ^^^^^^^^^^^^^^^^^
  File "/usr/bin/add-apt-repository", line 345, in main
    shortcut = handler(source, **shortcut_params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/shortcuts.py", line 40, in shortcut_handler
    return handler(shortcut, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 86, in __init__
    if self.lpppa.publish_debug_symbols:
        ^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 126, in lpppa
    self._lpppa = self.lpteam.getPPAByName(name=self.ppaname)
                  ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 113, in lpteam
    self._lpteam = self.lp.people(self.teamname)
                   ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'people'

Screenshots / Minimum Reproducible Project

No response

Please search the issue tracker for existing bug reports before submitting your own.

  • I have searched all existing issues and confirmed that this is not a duplicate.
@bratpeki bratpeki added the bug label Sep 29, 2024
@bratpeki
Copy link
Contributor Author

This could have something to do with versioning (Bullseye, Buster, etc), but I don't know.

@bratpeki bratpeki changed the title Issues with "Linux Cross-Compile" Issues with "Linux Cross-Compile" (Debian WSL) Sep 30, 2024
@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

Solved it with sudo apt-get install python3-launchpadlib. I'm now getting the following issue:

E: The repository 'https://ppa.launchpadcontent.net/tobydox/mingw-w64/ubuntu bookworm Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

Fixed with echo "deb [trusted=yes] http://www.deb-multimedia.org bookworm main" >> /etc/apt/sources.list.

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

Then running sudo apt-get install gets you:

E: Unable to locate package sdl-mingw-w64
E: Unable to locate package sdl2-mingw-w64
E: Unable to locate package libvorbis-mingw-w64
E: Unable to locate package lame-mingw-w64
E: Unable to locate package fluidsynth-mingw-w64
E: Unable to locate package stk-mingw-w64
E: Unable to locate package glib2-mingw-w64
E: Unable to locate package portaudio-mingw-w64
E: Unable to locate package libsndfile-mingw-w64
E: Unable to locate package fftw-mingw-w64
E: Unable to locate package flac-mingw-w64
E: Unable to locate package fltk-mingw-w64
E: Unable to locate package libgig-mingw-w64
E: Unable to locate package libsamplerate-mingw-w64
E: Unable to locate package libsoundio-mingw-w64
E: Unable to locate package qt5base-mingw-w64

WSL uses Bookworm:

peki@...:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:        12
Codename:       bookworm

@messmerd
Copy link
Member

messmerd commented Oct 3, 2024

Tobydox's PPA is for Ubuntu 20.04 (focal), not Debian 12 (bookworm): https://ppa.launchpadcontent.net/tobydox/mingw-w64/ubuntu/dists/focal/

It looks like @FyiurAmron erroneously changed the wiki article to say "Debian" rather than "Ubuntu" starting with this revision: https://github.com/LMMS/lmms/wiki/Dependencies-Windows/4b141b4f8fb77c9cd46799e2e87f6a9499dcd03a

I just changed it back to "Ubuntu". While you probably could get it to work on Debian, we do not officially support anything other than what our automated builds use, which is Ubuntu 20.04.

@FyiurAmron
Copy link
Contributor

@messmerd FWIW, you're completely right here, I tried to recall why I changed that but couldn't find any rational reason, probably were just editing 3 pages at once and went on a spree and done this due to some brain fart. Maybe I wanted to describe the exact procedure for normal Debian distros in-depth and either forgotten about that or gave up on it, or maybe it was just a completely random mistake. Can't recall now, the last months been hectic for me.

Anyhow, I 100% agree, although technically Ubuntu still is Debian, just repackaged :D (and yes, with the deps either built from source or otherwise repackaged, I see no reason why it wouldn't work, but I also see no reliable way to support people doing that since I'm not using raw Debian on a daily basis anymore and I guess it's an edge case anyhow)

@bratpeki tl;dr those PPAs are a relic from the past, so compiling them libs from source would be your best bet - but while you could do that or even try to configure APT to fetch those for focal and use them (it's possible even if probably useless), it makes no sense on WSL IMVHO - for Win, just go with MSYS, it should work out-of-the-box, especially after the bunch of updates I did for it this year. If it doesn't, ping me, we'll figure something out.

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

Excellent, thank you both! I'll move the compilation process to MSYS, then!

@FyiurAmron, where can I find relevant documentation, if any?

I'm persuming MSYS2 is focused on using Pacman, so I could get the dependency list off the lmms-git AUR repo, but is there anything on the LMMS Wiki regarding this?

(Update: MSYS' Pacman is definitely not housing the same packages as Arch's Pacman, for anyone learning about it and reading this in the future, LOL)

@FyiurAmron
Copy link
Contributor

FyiurAmron commented Oct 3, 2024

@bratpeki doh! Now I recall, I was in the process of updating those docs when RL stuff struck me. Found some commented out doc blocks hinting on what I wanted to do next, and it was indeed providing docs for MSYS process, and perhaps Debian afterwards. It's quite straightforward for MSYS anyway and strictly follows what's described on https://github.com/LMMS/lmms/wiki/Compiling for other compile paths; I'll post you the exact file I guess was supposed to be the basis of the doc:

# arch is either x86_64 or i686 ; assuming fresh MSYS install

### mandatory platform/toolchain
pacman -S git
pacman -S mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-cmake
# MSYS2 make, runs as "Unix Makefiles" to simplify the build
pacman -S make
# CMake deps
pacman -S perl-List-MoreUtils
pacman -S perl-XML-Parser

### mandatory 3rd party deps
pacman -S mingw-w64-x86_64-libsamplerate
pacman -S mingw-w64-x86_64-fftw
pacman -S mingw-w64-x86_64-libsndfile
pacman -S mingw-w64-x86_64-qt5-base
# or qt6 etc. for the fork
pacman -S mingw-w64-x86_64-SDL2
# or some other output equivalent to SDL2

### misc deps
# for Windows packaging
pacman -S mingw-w64-x86_64-nsis
# for ZynAddSubFx
pacman -S mingw-w64-x86_64-fltk
# for SF2
pacman -S mingw-w64-x86_64-fluidsynth

### and all the other libs you fancy

After getting the libs installed, prepare the dirs for make (cd lmms && mkdir build && cd build), run make etc. (cmake .. -DCMAKE_INSTALL_PREFIX=../target and cmake --build . is what I had in my shell history) and you should get the binaries in no time (well, that is if you consider ~10-30 minutes "no time" :)

If it works for you, feel free to add this or any other relevant data to the wiki as new section. We had some outdated docs for MSYS in the olden days, but https://github.com/LMMS/lmms/wiki/Dependencies-Windows/_compare/a857e2562de0d13a5387d75db2508c9cf7127641...6cfbc94f040dce913ab456429c1b2b897dad1167 removed them a couple of months ago (not that it was a wrong call by itself, that part was outdated as hell and was also mostly unnecessary anymore).

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

Wonderful, thank you! I'd help you keep the building Wiki page up-to-date, if necessary, and I believe the cmake commands should be different, to specify the output binary is a Windows one!

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

:: There are 13 members in group mingw-w64-x86_64-toolchain:
:: Repository mingw64
   1) mingw-w64-x86_64-binutils  2) mingw-w64-x86_64-crt-git  3) mingw-w64-x86_64-gcc  4) mingw-w64-x86_64-gdb
   5) mingw-w64-x86_64-gdb-multiarch  6) mingw-w64-x86_64-headers-git  7) mingw-w64-x86_64-libmangle-git
   8) mingw-w64-x86_64-libwinpthread-git  9) mingw-w64-x86_64-make  10) mingw-w64-x86_64-pkgconf
   11) mingw-w64-x86_64-tools-git  12) mingw-w64-x86_64-winpthreads-git  13) mingw-w64-x86_64-winstorecompat-git

I believe I should either choose 1 or 3, looking into it now.

@FyiurAmron
Copy link
Contributor

I believe the cmake commands should be different, to specify the output binary is a Windows one!

@bratpeki From what I recall, MSYS's cmake can only output Win32/64 binary, so no need to instruct it to do so. The commands should work as-is (maybe you'll need to tell CMake to use Unix buildfiles instead of Ninjas etc., but YMMV there, I just didn't have any luck with Ninja builds, some random errors started happening).

@FyiurAmron
Copy link
Contributor

FyiurAmron commented Oct 3, 2024

I believe I should either choose 1 or 3, looking into it now.

You'll need all 13 of them IIRC. Some are optional-ish (gdb e.g.), but most of them are strictly required, and there is no harm in having them all anyway.

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

After finnicking around with my antivirus software, I am pleased to announced I've compiled it! The instructions were straight-to-the point, with the exception of having to restart!

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 3, 2024

When attempting to run from the ...\msys64\home\...\lmms\build, lmms.exe reports missing libs, namely libgcc_s_seh-1.dll and libfftw3f-3.dll. As I recall, running from the build dir is possible on Linux, is that not the case on Windows?

@FyiurAmron
Copy link
Contributor

FyiurAmron commented Oct 4, 2024

@bratpeki

After finnicking around with my antivirus software, I am pleased to announced I've compiled it! The instructions were straight-to-the point, with the exception of having to restart!

TBH, I never had to do that for MSYS, but obviously YMMV here, I'm still on old-ish MSYS version on Win7, maybe Win10 version changed something, maybe you were just unlucky with your particular setup for some reason.

When attempting to run from the ...\msys64\home\...\lmms\build, lmms.exe reports missing libs, namely libgcc_s_seh-1.dll and libfftw3f-3.dll. As I recall, running from the build dir is possible on Linux, is that not the case on Windows?

It should be possible on both. However, to do that on Windows you'd have to have a dir with those DLLs in a shared location (i.e. on Windows PATH) for this to work without having the DLLs bundled in the same dir. That's one way to handle it, althout some files required for "normal" LMMS work might be missing anyway (I'm not using this one personally for that reason).

Another way is to use CMake to create an NSIS build to get a complete package with all the DLLs bundled. AFAIK you'll get all the needed files in build\_CPack_Packages\win64\NSIS\lmms-1.3.0-alpha-mingw-win64 (exe, DLLs, all the rest), and you'll get the installer for free as well. This is fool-proof, you basically get a portable-ish install this way, same files that you'd get by unpacking the installer manually. The only downside is that the dir will be regenerated with each build-with-package, so you probably need to copy this somewhere.

Yet another approach is to just copy the exe from build to an existing 1.3.0-alpha install location and either overwrite the old one or rename one of them. This one should be fool-proof as well, drag-n-drop or one-liner is needed only. Renaming the exes allows you to compare the different build versions side-by-side as well too, so it's a 10/10 approach in my book.

You might also mix the above solutions in any way you fancy, obviously. Do what suits you best.

@Rossmaxx
Copy link
Contributor

Rossmaxx commented Oct 4, 2024

Or you can just cmake --install . --prefix "../target/"?

@FyiurAmron
Copy link
Contributor

@Rossmaxx a very good point. So, in total, that's at least 4 reliable methods to handle this. Should be enough :D

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 4, 2024

Thank you both!

This works like a charm with an out of the box MSYS2 install.

I think I could write up an addition to the PR, as this seems like a very easy way to get building up and running on Windows!

I'll give Ross' command and packaging a shot, and let you know how it goes.

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 5, 2024

Another way is to use CMake to create an NSIS build [...] you'll get all the needed files in build\_CPack_Packages\win64\NSIS\lmms-1.3.0-alpha-mingw-win64

Works like a charm!

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 5, 2024

I have utilized the following build rules, and I'm just sending them to have them saved and formatted, as well as present my progress:

  1. NSIS packaging
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../target
cmake --build . --target package

This makes using Ninja by default and installs the files to build\_CPack_Packages\.... I would also persume it installs to target, but the compilation process is a bit long on my machine, so I'll verify it later!

  1. MSYS Makefiles + installing to target
mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make
cmake --install . --prefix "../target/"

@Rossmaxx
Copy link
Contributor

Rossmaxx commented Oct 7, 2024

So can we close?

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 7, 2024

Just let me make a proposed edit to the Wiki and we can close!

@tresf
Copy link
Member

tresf commented Oct 8, 2024

Excellent, thank you both! I'll move the compilation process to MSYS, then!

Morbid curiosity, but why not use an Ubuntu WSL instance?

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 8, 2024

I am also intending to try an Ubuntu WSL, since I made an issue of trying to compile on Debian, which isn't officially supported. I realized my mistake only recently, and forgot to write about it. Thank you for commenting, that reminded me to write!

Also relevant:

It looks like FyiurAmron erroneously changed the wiki article to say "Debian" rather than "Ubuntu" starting with this revision [...]

@bratpeki
Copy link
Contributor Author

bratpeki commented Oct 8, 2024

Also, @FyiurAmron generally recommended MSYS, saying that the PPAs are "a relic of the past", so I'm intending to provide both compilation methods, if compiling with the PPAs is still possible. If I have trouble we can't overcome, MSYS has proved to be ridiculously simple!

@tresf
Copy link
Member

tresf commented Oct 8, 2024

I am also intending to try an Ubuntu WSL, since I made an issue of trying to compile on Debian, which isn't officially supported. I realized my mistake only recently, and forgot to write about it. Thank you for commenting, that reminded me to write!

This may be a bit outdated (6 years old) but here's how I did it last: https://gist.github.com/tresf/3c739a739b56d8dc0679c3f2f85c349d

@tresf
Copy link
Member

tresf commented Oct 8, 2024

PPAs are "a relic of the past"

For cross-compiling, I'm unaware of an equivalent to Toby's PPA. I think cross-compiling is a nice option however we may decide to remove if if keeping the PPAs around is too much work.

@Kreijstal
Copy link

Kreijstal commented Dec 7, 2024

(should be run under ucrt64 or clang64)

pacman -Syu # updade packages
pacman -S perl-List-MoreUtils perl-XML-Parser pactoys base-devel git --needed
pacboy -S cmake:p cc:p libsndfile:p fluidsynth:p fltk:p fftw:p libsamplerate:p libgig:p SDL2:p qt5-base:p lv2:p lilv:p suil:p --needed
git clone https://github.com/LMMS/lmms.git --recursive
cd lmms
cmake -B build 
cmake --build build

I could contribute a CI build if anyone wants


Edit:

after a while I somehow couldnt reproduce a build anymore...

E:/msys64/home/topkek/git/lmms/build/plugins/ZynAddSubFx/zynaddsubfx/src/UI/MasterUI.cxx: In constructor 'MasterUI::MasterUI(Master*, int*)':
E:/msys64/home/topkek/git/lmms/build/plugins/ZynAddSubFx/zynaddsubfx/src/UI/MasterUI.cxx:2378:39: error: 'GetModuleHandle' was not declared in this scope
 2378 |   masterwindow->icon((char *)LoadIcon(GetModuleHandle(NULL), "zynaddsubfx_icon"));
      |                                       ^~~~~~~~~~~~~~~
E:/msys64/home/topkek/git/lmms/build/plugins/ZynAddSubFx/zynaddsubfx/src/UI/MasterUI.cxx:2378:30: error: 'LoadIcon' was not declared in this scope
 2378 |   masterwindow->icon((char *)LoadIcon(GetModuleHandle(NULL), "zynaddsubfx_icon"));
      |                              ^~~~~~~~
[163/1468] Building CXX object plugins/ZynAddSubFx/zynaddsubfx/src/UI/CMakeFiles/zynaddsubfx_gui.dir/PartUI.cxx.obj

I have no idea why the first time compiled however~~


Edit:

I have no idea why I could build the first time but not the second time. Here is however my recipe again

pacman -Syu --noconfirm
pacman -S perl-List-MoreUtils perl-XML-Parser pactoys base-devel git --needed --noconfirm
pacboy -S jack2:p cmake:p cc:p libsndfile:p fluidsynth:p fltk:p fftw:p libsamplerate:p libgig:p SDL2:p qt5-base:p lv2:p lilv:p suil:p --needed --noconfirm
git clone https://github.com/LMMS/lmms.git 
cd lmms
cmake -B build
sed -i 's/#ifdef FLTK_GUI/#include <windows.h>\n#ifdef FLTK_GUI/' plugins/ZynAddSubFx/zynaddsubfx/src/UI/common.H
cmake --build build

@bratpeki
Copy link
Contributor Author

bratpeki commented Dec 9, 2024

@Kreijstal could you give my recipe above a try on a clean MSYS2? I'm planning on doing so myself as well, when I find the time. I'll try making a pacboy friendly variant, too!

@Kreijstal
Copy link

@Kreijstal could you give my recipe above a try on a clean MSYS2? I'm planning on doing so myself as well, when I find the time. I'll try making a pacboy friendly variant, too!

the second recipe I did seems to work on clean msys2

@bratpeki
Copy link
Contributor Author

bratpeki commented Dec 9, 2024

Oh, dope! I'll run it on a clean MSYS2 as well and if all goes well, I'd say that's a candidate for a native Windows build recipe.

@bratpeki
Copy link
Contributor Author

bratpeki commented Dec 9, 2024

Running under UCRT. I ran your sed command, but I'll also try compiling without the change made by it. If it fails, I'll make a PR to the Zyn submod for a preprocessor checking and including the header file, since that's clearly a possible issue.

@bratpeki
Copy link
Contributor Author

bratpeki commented Dec 9, 2024

The building with @Kreijstal's commands was a success!

I do still wonder why the additional #include was necessary... I was using my build commands (#7526 (comment)) on MSYS2 MINGW and it compiled without any changes to the codebase.

I'll experiment with it some more and report back.

In the meantime, I'm curious as to how @tresf, @FyiurAmron and @messmerd feel about including the MSYS2 building as part of the Windows building instructions on the Wiki. Do you think it's a good addition? If not, why? Asking mainly to know if this is fit for closing after looking into what I mentioned above.

@bratpeki
Copy link
Contributor Author

bratpeki commented Dec 9, 2024

Checked if building fails without the #include and it does, exactly as stated in #7526 (comment).

@tresf
Copy link
Member

tresf commented Dec 10, 2024

In the meantime, I'm curious as to how @tresf, @FyiurAmron and @messmerd feel about including the MSYS2 building as part of the Windows building instructions on the Wiki. Do you think it's a good addition?

Yes, please.

@FyiurAmron
Copy link
Contributor

FyiurAmron commented Dec 10, 2024

In the meantime, I'm curious as to how @tresf, @FyiurAmron and @messmerd feel about including the MSYS2 building as part of the Windows building instructions on the Wiki.

I already started adding them during the summer, just didn't have time to finish. Obviously I feel it's a good idea to document it, otherwise I wouldn't have started to do so myself (there still should be some commented-out sections with link in preparation for the new paragraphs etc. I think that were prepared by me there)

Do you think it's a good addition?

Yes. See above. Would have done it myself if I had the time. I still stand by what I wrote near the beginning of this thread:

If it works for you, feel free to add this or any other relevant data to the wiki as new section.

@Kreijstal
Copy link

The building with @Kreijstal's commands was a success!

I do still wonder why the additional #include was necessary... I was using my build commands (#7526 (comment)) on MSYS2 MINGW and it compiled without any changes to the codebase.

I'll experiment with it some more and report back.

In the meantime, I'm curious as to how @tresf, @FyiurAmron and @messmerd feel about including the MSYS2 building as part of the Windows building instructions on the Wiki. Do you think it's a good addition? If not, why? Asking mainly to know if this is fit for closing after looking into what I mentioned above.

it is indeed a mystery the first time I build this I didnt need to do any sed logic, it simply compiled out of the box, then I tested on another system and it stopped working! I tested on the original computer where I built it and got the same error... I have no idea.

@bratpeki bratpeki changed the title Issues with "Linux Cross-Compile" (Debian WSL) Defining an MSYS2 build command list Dec 10, 2024
@bratpeki
Copy link
Contributor Author

I tried running @Kreijstal's commands for MINGW, even if they aren't intended for it, just to see what would happen, and:

$ pacboy -S cmake:p cc:p libsndfile:p fluidsynth:p fltk:p fftw:p libsamplerate:p libgig:p SDL2:p qt5-base:p lv2:p lilv:p suil:p --needed
warning: mingw-w64-x86_64-libsndfile-1.2.2-1 is up to date -- skipping
warning: mingw-w64-x86_64-fltk-1.3.9-2 is up to date -- skipping
warning: mingw-w64-x86_64-fftw-3.3.10-5 is up to date -- skipping
warning: mingw-w64-x86_64-libsamplerate-0.2.2-1 is up to date -- skipping
error: target not found: mingw-w64-x86_64-libgig

Just noticed my commands (#7526 (comment)) don't address libgig at all. I suppose I've been building without it.

That being said, since libgig isn't yet in MSYS2 MINGW, that takes my build commands out of the question, and we can focus on the most recent ones, by @Kreijstal.

@Kreijstal
Copy link

Kreijstal commented Dec 10, 2024

I tried running @Kreijstal's commands for MINGW, even if they aren't intended for it, just to see what would happen, and:

$ pacboy -S cmake:p cc:p libsndfile:p fluidsynth:p fltk:p fftw:p libsamplerate:p libgig:p SDL2:p qt5-base:p lv2:p lilv:p suil:p --needed
warning: mingw-w64-x86_64-libsndfile-1.2.2-1 is up to date -- skipping
warning: mingw-w64-x86_64-fltk-1.3.9-2 is up to date -- skipping
warning: mingw-w64-x86_64-fftw-3.3.10-5 is up to date -- skipping
warning: mingw-w64-x86_64-libsamplerate-0.2.2-1 is up to date -- skipping
error: target not found: mingw-w64-x86_64-libgig

Just noticed my commands (#7526 (comment)) don't address libgig at all. I suppose I've been building without it.

That being said, since libgig isn't yet in MSYS2 MINGW, that takes my build commands out of the question, and we can focus on the most recent ones, by @Kreijstal.

libgig is definitely in msys2/mingw64, that's what the pacman -Syu is for

@tresf
Copy link
Member

tresf commented Dec 10, 2024

pacboy -S cmake:p cc:p

Just looked this up and wanted to share... :p is for the current architecture only (e.g. mingw64), quoting:

In particular, adding the :p suffix installs the package for the current environment only. If no suffix is given, the selection of environments depends on what environment you're currently in - e.g. in a mingw64 environment, it currently defaults to installing the package for both mingw32 and mingw64.

As Windows 10 (and thus 32-bit) nears EOL, I'm curious if they'll keep this mindset or turn it off. My instinct is that it'll default to only mingw64 in the no-so-distant future.

@Kreijstal
Copy link

Kreijstal commented Dec 10, 2024

pacboy -S cmake:p cc:p

Just looked this up and wanted to share... :p is for the current architecture (Edit: environment) only (e.g. mingw64), quoting:

In particular, adding the :p suffix installs the package for the current environment only. If no suffix is given, the selection of environments depends on what environment you're currently in - e.g. in a mingw64 environment, it currently defaults to installing the package for both mingw32 and mingw64.

As Windows 10 (and thus 32-bit) nears EOL, I'm curious if they'll keep this mindset or turn it off. My instinct is that it'll default to only mingw64 in the no-so-distant future.

if you are on ucrt64, it defaults to ucrt64 :p means current enviroment, if you are on clangarm64 (windows on arm) :p will install arm packages.

Ahh.. yeah they deprecated mingw32 and mingw64 (sadly), maybe there will be a msys2 fork that supports mingw32 packages.

@tresf
Copy link
Member

tresf commented Dec 10, 2024

I do still wonder why the additional #include was necessary... I was using my build commands (#7526 (comment)) on MSYS2 MINGW and it compiled without any changes to the codebase.

I can't answer this mystery, but I did check upstream and there are several references to windows.h that weren't in the codebase prior:

https://github.com/search?q=repo%3Azynaddsubfx%2Fzynaddsubfx+windows.h&type=code

I'll make a PR to the Zyn submod [...]

We'd happily accept this in our fork.

@bratpeki
Copy link
Contributor Author

bratpeki commented Dec 10, 2024

Pushed the commit to my fork.

@Kreijstal, please apply this and let me know how it goes on a clean MSYS2 of any kind.

diff --git a/src/UI/common.H b/src/UI/common.H
index 4a077e32..4f6e3465 100644
--- a/src/UI/common.H
+++ b/src/UI/common.H
@@ -20,6 +20,10 @@
 class Fl_Widget;
 extern void set_module_parameters ( Fl_Widget * );
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 #ifdef FLTK_GUI
 #define fl_color_add_alpha( x,y ) x 
 #undef FL_NO_BOX

@bratpeki
Copy link
Contributor Author

Tried the build myself, and it seems to be just fine!

I'll make the PR to the Zyn submodule, where this can be discussed further.

@Kreijstal
Copy link

pacboy -S cmake:p cc:p

Just looked this up and wanted to share... :p is for the current architecture only (e.g. mingw64), quoting:

In particular, adding the :p suffix installs the package for the current environment only. If no suffix is given, the selection of environments depends on what environment you're currently in - e.g. in a mingw64 environment, it currently defaults to installing the package for both mingw32 and mingw64.

As Windows 10 (and thus 32-bit) nears EOL, I'm curious if they'll keep this mindset or turn it off. My instinct is that it'll default to only mingw64 in the no-so-distant future.

even those that still support 32bit are only supporting it till windows 10 jeremyd2019/msys2-build32#3 (comment)

remember that lmms should use less than 2gb of ram.. for it to work on 32bit

@tresf
Copy link
Member

tresf commented Dec 20, 2024

even those that still support 32bit are only supporting it till windows 10

Right. For clarity, LMMS will continue to support the very popular 32-bit VST2s through the 64bit-32bit VST2 bridge for the foreseeable future.

@Kreijstal
Copy link

even those that still support 32bit are only supporting it till windows 10

Right. For clarity, LMMS will continue to support the very popular 32-bit VST2s through the 64bit-32bit VST2 bridge for the foreseeable future.

so you are not interested in a full 32bit build of lmms just the vst32 bridge?

@tresf
Copy link
Member

tresf commented Dec 20, 2024

so you are not interested in a full 32bit build of lmms just the vst32 bridge?

Correct. We never need to support a 32-bit OS again but some really good plugins were only ever released as 32-bit.

@FyiurAmron
Copy link
Contributor

@tresf TBH I always wondered why no-one (at least no-one I know of) ever did a 32->64 static recompiler for Win VSTs. I mean, it's no trivial task, and the 32->64 bridges (or even VMs/compat layers) already fulfil the role, but I haven't even heard of such project being done TBH, and with VST SDK freely available, wouldn't be that hard, honestly. Perhaps it's just that - it wasn't really needed, so nobody did it... however, I think that if I were still a grad student today I would do one for a course project probably, just for the sake of it xD

and, before anyone says "but it doesn't make sense to do static recompilation at all..." - well, actually I'd beg to differ :D

@tresf
Copy link
Member

tresf commented Dec 20, 2024

VST SDK freely available,

VST2 is not not, though. Unless you use a clean-room, reverse-engineered header, but even then they've been very quick to send cease and desist letters.

@tresf TBH I always wondered why no-one (at least no-one I know of) ever did a 32->64 static recompiler

Gut instinct is that it's not a problem that needs solving as long as these OSs can still execute 32-bit instruction sets. Mac killed off 32-bit instructions sets at the OS-level and then later on the hardware-level (the latter of which prevented some older 32-bit apps on Windows 10 ARM64 from running in a VM on a Mac host -- all of which has been fixed in Windows 11 😅).

If 32-bit instructions vanish from WIndows, there may THEN be a demand, however they've maintained backwards compatibility for decades and people just rely on it. Even as a software developer, I shamelessly use 32-bit Intel installers for both AMD64 and ARM64 Windows. 🤷 AFAIR, steam does this too.

@Kreijstal
Copy link

VST SDK freely available,

VST2 is not not, though. Unless you use a clean-room, reverse-engineered header, but even then they've been very quick to send cease and desist letters.

@tresf TBH I always wondered why no-one (at least no-one I know of) ever did a 32->64 static recompiler

Gut instinct is that it's not a problem that needs solving as long as these OSs can still execute 32-bit instruction sets. Mac killed off 32-bit instructions sets at the OS-level and then later on the hardware-level.

If 32-bit instructions vanish, there may be a demand, however they've maintained backwards compatibility for decades and people just rely on it. Even as a software developer, I shamelessly use 32-bit Intel installers for both AMD64 and ARM64 Windows. 🤷

well if the source code is not available then it can't be packaged on msys2... but yeah there will be alternatives eventually :)

@tresf
Copy link
Member

tresf commented Dec 20, 2024

well if the source code is not available

In my (limited) experience, most VST2s source aren't made available.

@regulus79
Copy link
Contributor

Unless you use a clean-room, reverse-engineered header, but even then they've been very quick to send cease and desist letters.

How did LMMS not get included in this?

@tresf
Copy link
Member

tresf commented Dec 20, 2024

Unless you use a clean-room, reverse-engineered header, but even then they've been very quick to send cease and desist letters.

How did LMMS not get included in this?

Luck, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants