Skip to content

Add a Github action to build for Windows X64#490

Closed
LeonarddeR wants to merge 14 commits intobrltty:masterfrom
LeonarddeR:gh-actions-windows-build
Closed

Add a Github action to build for Windows X64#490
LeonarddeR wants to merge 14 commits intobrltty:masterfrom
LeonarddeR:gh-actions-windows-build

Conversation

@LeonarddeR
Copy link
Copy Markdown
Contributor

A modern Windows x64 build using msys2, including Python bindings. Uses the native Python rather than the MinGW Python.
Many thanks to @bramd for laying the ground work of this.

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

Here is a workflow run including artifacts.

Copy link
Copy Markdown
Contributor

@bramd bramd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what to think of this. It is a minimal BRLTTY build for Windows, but it differs from the builds that can be downloaded from the website for the latest releases. If the goal is to be able to release from this in the future, this would need more work so it includes all the files that are in the Windows build now and follows it's directory structure. Also, the current builds don't include a winusb variant, where this CI build does not include the libusb/libusb-1.0 variants.

I did not try the resulting brltty.exe from this build since I have no hardware to test at the moment, but the build process looks fine to me. So if this is just meant as a check in the CI process to see if BRLTTY builds on Windows, this is fine.


jobs:
build_brltty:
runs-on: windows-2025
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use windows-latest here. The risk is that it breaks when the latest reference is updated to a newer version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows-latest is in the middle of its shift from 2022 to 2025. I'd rather stay safe here.

run: |
export PATH="$(cygpath -u "$pythonLocation")/scripts:$(cygpath -u "$pythonLocation"):$PATH"
./autogen
./cfg-windows --prefix=/ --enable-relocatable-install --with-usb-package=winusb
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on what the goal of the builds is, you might want to set up a matrix wit certain variants. The official builds offer libusb/winusb variants and are 32 bits for now, so we might want to offer a 32 bits build as well if there is still any interest in that. Also, the Python bindings are now just for Python x64, you could also add multiple Python versions there.

set -- $(V_setup) build --build-temp .; \
[ "@host_os@" != "mingw32" ] || set -- "$${@}" --compiler mingw32; \
"$(PYTHON)" ./setup.py "$${@}"
[ "@host_os@" != "mingw32" ] || "$(PYTHON)" ./setup.py $(V_setup) bdist_egg --skip-build
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what is going on here exactly. I guess we don't match the mingw32 in your msys-2 build? Also, the current BRLTTY release for Windows contains a Python wheel, so it would be nice if we create a wheel as well instead of an egg.

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

There are several reasons why I wrote this, but creating a distribution isn't one of them currently:

  1. Have X64 brlapi and python bindings for NVDA, see Update brlapi bindings to support Python 3.13 and X64 nvaccess/nvda#18657
  2. Proof of concept that x64 builds actually work
  3. Laying the groundwork to update the Windows builds to something more modern. I'm however unable to take that project further.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
seanbudd pushed a commit to nvaccess/brltty that referenced this pull request Sep 25, 2025
See brltty#490

A modern Windows x64 build using msys2, including Python bindings. Uses the native Python rather than the MinGW Python.
Many thanks to @bramd for laying the ground work of this.
seanbudd pushed a commit to nvaccess/nvda-misc-deps that referenced this pull request Oct 3, 2025
Should fix nvaccess/nvda#18657 when part of NVDA X64 builds.

Updated to a brlapi build produced on Github Actions in my own fork. See also brltty/brltty#490

Tested successfully:

    Install Windows Narrator braille support
    Manually enable the brlapi service
    Connectd braille display,: APH Mantis
    Ensure braille output and key presses work
wchar_t *operand;

#if !defined(__MINGW32__) && !defined(__MSDOS__)
#if !( (defined(__MINGW32__) && defined(__i386__)) || defined(__MSDOS__) )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Windows on ARM? Should it be handled like Windows for x86?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a toolset that supports building on ARM yet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, there are such toolsets (from Microsoft and free ones). Personally I use Clang in cross builds on Linux hosts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes there is a clang toolset, but I haven't been able to build brltty with clang yet. I think for this to work, having a linux brltty build that works with Clang is a first necessary step. Unless that's already possible.

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 13, 2025 via email

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

Am I correct in understanding that your intent with this PR is to generate a 64-bit brltty for Windows?

This is correct.

If so, will your approach be to still use msys and to build with brltty's mkwin script?

Yes and no. The build uses msys2, not msys1. They are pretty different. Therefore that's also the reason why mkwin is not used, because it assumes msys1.
Note however that it is pretty hard to setup msys1 and that it is really old.
You may wonder if there is even still a need for an x86 build of brltty.

Note that this PR touches a number of files that have nothing at all to do with Windows. That's one reason that I've been ignoring it.

What files do you mean exactly?
It looks like some log files were removed that were once committed by accident.
The change to Python/Makefile.in will only run on Windows
The changes to Programs/tune_builder.c should ensure that support for msys1 is preserved whereas building also works on msys2.

@stweil
Copy link
Copy Markdown
Contributor

stweil commented Oct 14, 2025

It looks like some log files were removed that were once committed by accident.

Ideally this kind of clean up should be done in a separate pull request, not here. It is unrelated to the description of this pull request.

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 14, 2025 via email

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

All unrelated changes are no removed from the pr.

To be honest, I currently do not have the time available to split out mkwin into mkwin32/64. The current GitHub action is at least a working method to create an X64 build. The split can happen in a follow up where the GitHub Action can be used to validate that it still works as expected.
If you insist on splitting beforehand, I'm afraid this must wait until around christmas.

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 16, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

Merged (rebase, squash) by commit a8a0375.

@DaveMielke DaveMielke closed this Oct 17, 2025
@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 17, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 17, 2025 via email

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

Honestly, I find this somewhat frustrating. @bramd and I have literally spent days getting an x64 build to work on Windows. In 2025, it’s almost impossible to produce a 32-bit build on a machine unless you stash libraries like libusb in obscure locations in your file system, including Program Files.

The whole idea behind this pull request is to set up CI/CD for Windows x64 so that these kinds of tests are automated. If I want to add a new feature on Windows, as a developer in 2025 it really shouldn’t be up to me to manually run all sorts of workflows (such as testing on other operating systems I can hardly or not test on) that should already be part of the CI?CD pipelines.

Furthermore, if a pull request requires more testing, that’s perfectly fine — we have an option in GitHub to mark it as a Draft PR. Instead, you chose to close it.

I'll draw my conclusions from that. For me, this is now a closed chapter. I’m stepping away from BRLTTY and won’t be investing any more time in this product until proper CI/CD is in place.

@stweil
Copy link
Copy Markdown
Contributor

stweil commented Oct 18, 2025

@LeonarddeR, why did you ignore my comments regarding Windows on ARM?

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 18, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 18, 2025 via email

@bramd
Copy link
Copy Markdown
Contributor

bramd commented Oct 20, 2025

What is libsystre? Which code is referencing it? Where does it come from? Is it a Windows or an msys package? What's the name of the package that it's in? If I can add it to my msys1 build environment then I will. If I can't then I'll rework configure. If I need to rework configure then I need you to tell me what your host_os is.

I haven't worked on this recently, only pointed @LeonarddeR to my old work to base his changes on, so I'm not actively working on anything related to this, but this question I can answer. It's a Msys-2 package that's also called libsystre. This provides POSIX compatible regular expressions (regex.h), which was part of the standard library in Msys-1 if I remember correctly, but not on Msys-2. Hope this helps anyone working on this.

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 21, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 23, 2025 via email

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

@stweil commented:

@LeonarddeR, why did you ignore my comments regarding Windows on ARM?

I have not ignored that comment, but it looks like it was never posted and is still listed as pending. I'm sorry for that.

;;
mingw*)
system_package="windows"
system_libs="-lsystre"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bramd Any idea why this is necessary? Never heard about this


jobs:
build_brltty:
runs-on: windows-2025
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows-latest is in the middle of its shift from 2022 to 2025. I'd rather stay safe here.

wchar_t *operand;

#if !defined(__MINGW32__) && !defined(__MSDOS__)
#if !( (defined(__MINGW32__) && defined(__i386__)) || defined(__MSDOS__) )
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a toolset that supports building on ARM yet.

@LeonarddeR
Copy link
Copy Markdown
Contributor Author

@DaveMielke Thank you very much for accepting my code in a8a0375. I readily admit that I overreacted, and I apologize for that. Unfortunately, my time is limited due to other commitments. In future contributions, I will try to take the necessary precautions regarding proper testing.
That said, I never intended to accuse you of not responding. If I did make any remark to that effect, it was meant as a factual observation.

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 24, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 24, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 25, 2025 via email

@DaveMielke
Copy link
Copy Markdown
Member

DaveMielke commented Oct 26, 2025 via email

@bramd
Copy link
Copy Markdown
Contributor

bramd commented Oct 29, 2025

On a related issue: As I'm sure you've seen, we're getting the Pythn warning that "setup.py install has been deprecated". Are you able to give me some clues as to how to upgrade that code?

Based on my notes from (I think) 2 years ago when I worked on this, so things might be out of date. The modern Python packaging ecosystem wants to get rid of calling setup.py with unknown side effects and standardize on binary precompiled formats like wheels. Also, setup.py is more and more replaced with static configuration like pyproject.toml. Back when I looked into this, I couldn't find a way to call arbitrary commands without having the classic setup.py install, so there was no clear path forwards. For now it seems to be working still, but if/when I've some more time I would be glad to look at this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants