Skip to content

Wanted: New maintainer for Windows builds of Geany #4189

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

Open
eht16 opened this issue Jan 4, 2025 · 21 comments
Open

Wanted: New maintainer for Windows builds of Geany #4189

eht16 opened this issue Jan 4, 2025 · 21 comments
Labels
build-system Related to the build system(s) windows

Comments

@eht16
Copy link
Member

eht16 commented Jan 4, 2025

We are looking for a new maintainer for the Windows builds of Geany

You want to:

  • continue using Geany (or start doing so)
  • maintain the Windows builds of Geany
  • support the Geany developers on creating releases
  • have fun with Geany's codebase, MSYS2 and Microsoft Windows and all the problems these create

Your benefits:

  • fame and glory
  • happy users of Geany on Windows

More seriously, while Geany is developed mostly on Linux and probably most of the user base is using Linux as well, there are also some Windows users.
In the past, the Windows builds were maintained by me (eht16) but I cannot continue because I used a Windows 7 VM but Windows 7 is no longer supported by MSYS2 which the builds are based on.
I will not upgrade to or use any newer version of the operating system for various reasons, so we are looking for someone who wants to take over.

Feel free to ask questions and comment here in this issue.

@eht16 eht16 added windows build-system Related to the build system(s) labels Jan 4, 2025
@eht16 eht16 pinned this issue Jan 4, 2025
@giuspen
Copy link
Contributor

giuspen commented Jan 4, 2025

I may be able to help as I already build on msys2 for my hobby project https://github.com/giuspen/cherrytree via the script https://github.com/giuspen/cherrytree/blob/master/scripts/msys2_prepare_standalone.sh ( and package via inno setup script https://github.com/giuspen/cherrytree/blob/master/scripts/cherrytree.iss )

@eht16
Copy link
Member Author

eht16 commented Jan 5, 2025

Hi @giuspen,

that would be great, thank you!

Some random thoughts about the setup and how to get you started:

Please ask any questions as they arrive, here or via mail or Matrix chat.

@djhenderson
Copy link

I have been interested in building Geany in a non-docker MSYS2 environment to support debugging.

I am willing to test nightly releases or CI artifacts (such as I am using daily). I am interested in helping to solve some errors unique to the Windows environment. And possible working with some unsupported, or missing plugins.

I may not be able to commit significant time to the project due to stamina and health issue, but, since I use Geany so much, would like to contribute what I can

@giuspen
Copy link
Contributor

giuspen commented Jan 5, 2025

Hallo @eht16 I have been using Geany for almost 20 years now on both Linux and Windows, I'm happy to give something back. I'll follow the links you posted and get back for questions in the next days. Maybe better I will follow up here so that others interested such as @djhenderson can follow too.

@giuspen
Copy link
Contributor

giuspen commented Jan 7, 2025

So I followed https://wiki.geany.org/howtos/win32/msys2 and built successfully from the cloned git repos geany and then geany-plugins and installed both.
Note that I had a build error on geany-plugins complaining about missing files which were in fact present, that error was resolved with the following diff

diff --git a/geanygendoc/docs/Makefile.am b/geanygendoc/docs/Makefile.am
index f3975b69..bde0f83a 100644
--- a/geanygendoc/docs/Makefile.am
+++ b/geanygendoc/docs/Makefile.am
@@ -15,6 +15,6 @@ dist_pluginhtmldoc_DATA = \
 if BUILD_RST
 manual.html: manual.rst manual.css html4css1.css
        $(AM_V_GEN) $(RST2HTML) -d --strict \
-               --stylesheet-path $(abs_srcdir)/html4css1.css,$(abs_srcdir)/manual.css \
+               --stylesheet-path $(srcdir)/html4css1.css,$(srcdir)/manual.css \
                $(srcdir)/manual.rst $@
 endif BUILD_RST

After installing I did run successfully /c/geany/bin/geany but under Tools--Plugin Manager I got empty plugins.
I will continue with the wiki trying to create the installers and I will investigate further on why the plugins are not in the plugin manager even though installed.

@techee
Copy link
Member

techee commented Jan 8, 2025

After installing I did run successfully /c/geany/bin/geany but under Tools--Plugin Manager I got empty plugins.
I will continue with the wiki trying to create the installers and I will investigate further on why the plugins are not in the plugin manager even though installed.

I remember having the same problem in #4082 (comment) but I also didn't find a way to manage to see them (but I didn't spend much time on it).

@eht16
Copy link
Member Author

eht16 commented Jan 12, 2025

I never ran Geany from within the MSYS2 environment but copied geany.exe, libgeany.dll and if necessary plugin DLLs into an existing normal Geany installation and executed it "natively". This worked well except for debugging.

If you want to go the MSYS2 way, maybe a look in Help->Debug Messages might help what Geany thinks what is its "System plugin path" and what is logged when the Plugin Manager dialog tries to load the plugin DLLs.

@giuspen
Copy link
Contributor

giuspen commented Jan 12, 2025

Yes that's how I run cherrytree in windows ( https://github.com/giuspen/cherrytree/blob/master/BUILDING.md#building-cherrytree-on-windows ) I will try to add support for running Geany straight from msys2 too as I get to know a bit more how things work. For now anyway I will simply proceed to get to know your current way.

@kaiyongwangphoenix
Copy link

Image

关于Windows平台geany 2.0版本问题的反馈。我经常在使用Win10和Win11时遇到它。当将.py文件复制到其他位置时,编辑后无法保存,保存时会出现错误消息。它必须另存为。我希望下一个版本可以修复它。
Feedback on a problem with the Windows platform's geany 2.0 version. I often encounter it when using both Win10 and Win11. When a. py file is copied to another location, it cannot be saved after editing, and there will be an error message when saving. It must be saved as. I hope the next version can fix it.

@techee
Copy link
Member

techee commented Jan 16, 2025

@kaiyongwangphoenix Please open a separate issue - this has nothing to do with looking for a new maintainer for Windows builds. Sounds more like #2748.

@eht16 eht16 unpinned this issue Jan 18, 2025
@giuspen
Copy link
Contributor

giuspen commented Jan 18, 2025

After installing I did run successfully /c/geany/bin/geany but under Tools--Plugin Manager I got empty plugins.
I will continue with the wiki trying to create the installers and I will investigate further on why the plugins are not in the plugin manager even though installed.

I remember having the same problem in #4082 (comment) but I also didn't find a way to manage to see them (but I didn't spend much time on it).

@techee I found out that the reason was that the .dll were not actually built.

I updated the instructions, basically before the configure you have to run an export:

export lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method='pass_all'}
./configure --prefix=/c/geany
make -j
make install

@techee
Copy link
Member

techee commented Jan 19, 2025

@techee I found out that the reason was that the .dll were not actually built.

Great, thanks. I haven't had time to test myself but I believe you :-)

@giuspen
Copy link
Contributor

giuspen commented Feb 1, 2025

Hello @eht16 I have reached the point of creating the installers but I am in the need of key/certificate in order to sign (codesign_key.pem, codesign.pem).
Should I get a unique set myself? I haven't done this before, can you point me to where you did get yours?

Execute command: osslsigncode sign -verbose -certs C:\msys64\home\PenoneG/geany_build/codesign.pem -key C:\msys64\home\PenoneG/geany_build/codesign_key.pem -n Geany Binary -i https://www.geany.org -ts https://zeitstempel.dfn.de/ -h sha512 -in C:\msys64\home\PenoneG/geany_build/release/geany/bin/geany.exe -out C:\msys64\home\PenoneG/geany_build/release/geany/bin/geany.exe-signed
Failed to read certificate file: C:\msys64\home\PenoneG/geany_build/codesign.pem
Failed to read key or certificates
68100000:error:80000002:system library:BIO_new_file:No such file or directory:../openssl-3.4.0/crypto/bio/bss_file.c:67:calling fopen(C:\msys64\home\PenoneG/geany_build/codesign_key.pem, rb)
68100000:error:10000080:BIO routines:BIO_new_file:no such file:../openssl-3.4.0/crypto/bio/bss_file.c:75:
68100000:error:80000002:system library:BIO_new_file:No such file or directory:../openssl-3.4.0/crypto/bio/bss_file.c:67:calling fopen(C:\msys64\home\PenoneG/geany_build/codesign.pem, rb)
68100000:error:10000080:BIO routines:BIO_new_file:no such file:../openssl-3.4.0/crypto/bio/bss_file.c:75:
Failed
Traceback (most recent call last):
  File "C:/msys64/home/PenoneG/geany-release.py", line 132, in <module>
    make_release()
  File "C:/msys64/home/PenoneG/geany-release.py", line 111, in make_release
    sign_files(*binary_files)
  File "C:/msys64/home/PenoneG/geany-release.py", line 81, in sign_files
    run_command(
  File "C:/msys64/home/PenoneG/geany-release.py", line 41, in run_command
    check_call(cmd, **kwargs)
  File "C:/msys64/mingw64/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('osslsigncode', 'sign', '-verbose', '-certs', 'C:\\msys64\\home\\PenoneG/geany_build/codesign.pem', '-key', 'C:\\msys64\\home\\PenoneG/geany_build/codesign_key.pem', '-n', 'Geany Binary', '-i', 'https://www.geany.org', '-ts', 'https://zeitstempel.dfn.de/', '-h', 'sha512', '-in', 'C:\\msys64\\home\\PenoneG/geany_build/release/geany/bin/geany.exe', '-out', 'C:\\msys64\\home\\PenoneG/geany_build/release/geany/bin/geany.exe-signed')' returned non-zero exit status 4294967295.

@giuspen
Copy link
Contributor

giuspen commented Feb 1, 2025

For now I changed sign_files to skip if the SIGN_CERTIFICATE_KEY is missing.
There was already an instruction to do that but with a bug as isfile() was missing.
Wouldn't be better to version geany-release.py and geany-plugins-release.py in the respective git repos rather than hosting in the wiki?

def sign_files(*paths):
    if not isfile(SIGN_CERTIFICATE_KEY):
        print('Skipped signing {} as {} not found'.format(paths, SIGN_CERTIFICATE_KEY))
        return
    for item in paths:
    ...

@giuspen
Copy link
Contributor

giuspen commented Feb 1, 2025

I successfully generated the installer with a few changes to the original script linked from the wiki: geany-release.zip

@eht16
Copy link
Member Author

eht16 commented Feb 1, 2025

Hello @eht16 I have reached the point of creating the installers

Hooray! Nice to hear.

but I am in the need of key/certificate in order to sign (codesign_key.pem, codesign.pem). Should I get a unique set myself? I haven't done this before, can you point me to where you did get yours?

The certificate I used was from https://www.cacert.org.
I registered there in 2006 or so and had to meet to couple of people to verify me and so to be able to get a certificate issued.
I don't know if the process is still that complicated.

In the end it's probably not worth at all. The root certificate of cacert.org is not included in the common OS and browser bundles and so a proper verification can be made only after installing the root certificate of cacert.org manually by the user.
I doubt anyone really did this in the past. I only knew a single user who wished those digital signatures and I actually asked here six months ago if this is still the case but she didn't answer.

Furthermore, even if you had a certificate, if we will eventually create release installers in the pipeline, you had to upload the private key of the certificate to Github or somewhere else where the CI job can access it.
This is something I would never do because you never know what Github does with that key. Additionally, signing an automatically created binary on a third party system (Github runner) with a personalised certificate doesn't give much security as you personally cannot verify its complete integrity anyway and in the worst case you personally would be responsible for any malicious code, corruption or whatever, just because it is signed with your certificate.

So, I suggest we do not sign the binaries any longer.

For now I changed sign_files to skip if the SIGN_CERTIFICATE_KEY is missing. There was already an instruction to do that but with a bug as isfile() was

Sorry for the bug and the trouble it might caused :(.

missing. Wouldn't be better to version geany-release.py and geany-plugins-release.py in the respective git repos rather than hosting in the wiki?

Fine by me.
It might fit in the scripts directory in Geany and in the build directory in G-P.

@giuspen
Copy link
Contributor

giuspen commented Feb 1, 2025

Clear, thanks @eht16 I will submit a PR.
Still having some issues with the installer for geany-plugins as it doesn't find the languages
File /r "${GEANY_PLUGINS_RELEASE_DIR}\share\locale\*"
Will update here when I find the reason.

@giuspen
Copy link
Contributor

giuspen commented Feb 1, 2025

Ok I got also the installer for the plugins working. I will submit a PR for the changes I had to apply.
geany-plugins-release.zip

@eht16
Copy link
Member Author

eht16 commented Feb 2, 2025

Ok I got also the installer for the plugins working.

Yay.
What I usually did to verify the created installers was a bit manual testing:

  • uninstall previously Geany and Geany-Plugins (if it was installed)
  • install Geany from installer
  • start installed Geany and check Help->Debug Messages for warnings, errors, "file not found" messages or anything else which might look suspicious (sorry, I don't have a better description, it was to get sure everything what Geany expects was installed)
  • open Help->Help to see the manual will be opened in a browser from the local installation
  • quit Geany
  • install Geany-Plugins from installer
  • start Geany
  • open Plugin Manager dialog
  • check Help->Debug Messages if there are any plugin loading errors
  • load a few plugins, especially those with dependencies or additional files installed: SpellCheck, GitChangeBar, GeanyLua, UpdateChecker
  • check for error messages in Help->Debug Messages
  • quit Geany
  • uninstall Geany-Plugins
  • install Geany-Plugins again but not in the Geany prefix but into a different path
  • uninstall Geany-Plugins again and check that there are not much left overs in the installation path (I think share/licenses and share/locale are ok otherwise we would have to keep track on each installed single file) - the idea here was that at least the majority of files in bin/ and etc/ is removed

The last check is also done in the CI (https://github.com/geany/geany-plugins/blob/master/build/ci_mingw64_geany_plugins.sh#L292) and I usually checked this before releases as due to dependency updates it is common that the filenames of libraries change and it's tedious to do this more than necessary :).
If there are any left overs, then the list in https://github.com/geany/geany-plugins/blob/master/build/geany-plugins.nsi#L172 can be updated.

This method can certainly be scrutinised.
My rationale was that it is nice when an uninstaller cleans (almost) anything which it installed before.
Unfortunately, we cannot just delete whole directories in most cases as usually G-P are installed in the same path as Geany and so we would potentially also delete files installed by Geany itself.

@kpstsp
Copy link

kpstsp commented Apr 1, 2025

Hi folks, I try to go through guide provided @eht16
currently done with part of build geany for windows 10.
I had some errors on building github-plugins:

$ NOCONFIGURE=1 ./autogen.sh
./autogen.sh: line 4: intltoolize: command not found
I installed dependency:
$ pacman -S intltool

and next iterations get only warning. Probably I can add this to wiki page?

@giuspen
Copy link
Contributor

giuspen commented Apr 2, 2025

Hey @kpstsp thanks for pointing out the missing dependency for building geany-plugins, I have now added it to https://wiki.geany.org/howtos/win32/msys2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-system Related to the build system(s) windows
Projects
None yet
Development

No branches or pull requests

6 participants