eclipse-cdt-cloud / eclipse-cdt-cloud/cdt-gdb-adapter

Issues with running integration tests locally on Windows

Open
#369 9 comments 0 reactions 1 assignee Claimed by @jreineckearm View on GitHub
bug question
Dominant language
TypeScript
Stars
39
Forks
56
Avg merge
3d 9h
Merged PRs (30d)
2

Description

I ran into some problems when trying to set up and run integration tests locally (and natively) on Windows.

Environment:
OS: Windows 11 Enterprise
Git Bash (v2.49.0.1) from Git for Windows
VS Code: 1.99.3

**First attempt**
* Followed instructions from README to install MSYS2. This installs
* GDB v16.3
* GDBServer v16.3
* GCC v15.1
* This failed to run `make` in `src/integration-tests/test-programs` with
```
gcc -c bug275-测试.c -g3 -O0
Assembler messages:
Fatal error: can't create bug275-??.o: Invalid argument
make: *** [Makefile:51: bug275-测试.o] Error 1
```
* Updated `makefile` to copy things around even more and to avoid the unicode characters in gcc/g++ calls. At some point it succeeded.
* After that I tried to run the tests. But a lot of failures happened. Most problematic ones were.
* Some were clearly provoked by running the tests from a basepath with spaces in it.
* This goes away when I clone the repo into a basepath without spaces.
* Breakpoints didn't advance as expected if requested for empty lines.
* Turns out that the installed MSYS2 GDB version (16.3) lacks this "advance breakpoint" behavior. It shows same behavior when I do this in an interactive session.
* Some timeouts.
* They go away when I use the Windows CI variant of `.mocharc.json`.

I was not able to work around the breakpoint problem with that setup. Downgrading with pacman isn't straightforward as you would need to install a lot of dependencies manually from archived packages.

**I had more success with the git-bash for Windows and the following**
* Revert all edits of makefiles etc.
* Manually download and unzip the 7z-file that chocolatey installs in Windows CI: https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev0/x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev0.7z
* GDB 11.2
* GCC 13.2
* Put its `bin` folder on PATH.
* Copy `.mocharc-windows-ci.json` to `.mocharc.json`.
* Use `mingw32-make.exe` if you don't have `make` installed separately.
* Run `yarn test:integration --skip-make`, though the `--skip-make` is rather a habit from my first attempts and may not be necessary.

Only the unicode name test fails now because `make` or something along the chain turns `bug275-测试.c` into `bug275-测试`

**Actions and open questions**
* Update the README with these findings to explain the alternative route. Though I got a feeling this may need to become the main route for native Windows for now. In particular
* Using git-bash and the downloaded mingw.
* Copy the `mocharc.json` for Windows.
* Missing breakpoint advance behavior
* Is this specific to GDB on Windows or new behavior across all OS'es?
* Does it require fixes in the adapter itself to work better with newer GDBs? If so, we could switch back to the simpler MSYS2 setup approach.
* How to avoid the unicode file name renaming?
* Make GDB adapter and/or its integration tests more robust against spaces in paths.
* Not necessarily Windows related: has anyone ever tried to run the tests natively on macOS?

Any shared experience is very welcomed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.