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

Add hs-bindgen-testlib to cabal.project.ci #488

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented Mar 7, 2025

No description provided.

@phadej phadej requested review from edsko and TravisCardwell March 7, 2025 12:15
@phadej
Copy link
Collaborator Author

phadej commented Mar 7, 2025

tests fail on Windows; I think this is something for @TravisCardwell to look at?

@TravisCardwell
Copy link
Collaborator

It seems to fail here:

test-hs-bindgen-testlib
  HsBindgen.TestLib.Preturb
    CInt
      Preturb0XSameSemanticsX
        random:              Running 1 test suites...

The Preturb instance for CInt:

instance Preturb FC.CInt where
  preturb size n = n + fromIntegral size

(==~) for CInt is just (==).

This test is preturb 0 x ==~ x: adding zero to an integer results in the same integer. This is unlikely to fail, so I suspect that the issue is unrelated.

I re-ran the failed CI job, to see if the issue is deterministic. It failed here:

test-hs-bindgen-testlib
  HsBindgen.TestLib.Preturb
    CUChar
      NotPreturb1XSameSemanticsX
        max:                 Running 1 test suites...

In the previous CI job, that CUChar unit test passed (before the CInt test failed).

Unfortunately, the Windows development VMs are not available, making Windows issues particularly difficult to debug.

@TravisCardwell
Copy link
Collaborator

I now have a Windows environment to test with. It is bare-metal, so there is no rollback: any side effects will persist. ☹️

Attempts to build are failing with a llvm-config not found error. Checking install-llvm-action, it looks like I am installing LLVM in the same way, and the Debug3 output indicates that llvm-config is not in the CI environment either.

It looks like the CI environment is using GHC installed via Chocolatey, while my environment uses GHCup. Perhaps llvm-config is used because I am in an MSYS2 shell, and it is not used in CI because the software is built and tested in a different shell?

I see that MSYS2 has mingw-w64-llvm-16, available, but we need to use version 14 on Windows if I remember correctly. I tried it out, and it provides llvm-config. After successfully building the hs-bindgen library, it fails when linking the golden test.

Details
ghc-9.4.8.exe:  | C:\Users\n00b\wt\hs-bindgen\dist-newstyle\build\x86_64-windows\ghc-9.4.8\hs-bindgen-libclang-0.1.0\build\libHShs-bindgen-libclang-0.1.0-inplace.a: unknown symbol `__imp_clang_getCursorKindSpelling'
ghc-9.4.8.exe:  | C:\Users\n00b\wt\hs-bindgen\dist-newstyle\build\x86_64-windows\ghc-9.4.8\hs-bindgen-libclang-0.1.0\build\libHShs-bindgen-libclang-0.1.0-inplace.a: unknown symbol `ghczuwrapperZC71ZChszmbindgenzmlibclangzm0zi1zi0zminplaceZCHsBindgenziClangziLowLevelziFFIZCwrapzugetCursorType'
ghc-9.4.8.exe:  | C:\Users\n00b\wt\hs-bindgen\dist-newstyle\build\x86_64-windows\ghc-9.4.8\hs-bindgen-0.1.0\build\libHShs-bindgen-0.1.0-inplace.a: unknown symbol `hszmbindgenzmlibclangzm0zi1zi0zminplace_HsBindgenziClangziLowLevelziFFI_wrapzugetFileName_info'
ghc-9.4.8.exe:  | C:\Users\n00b\wt\hs-bindgen\dist-newstyle\build\x86_64-windows\ghc-9.4.8\hs-bindgen-0.1.0\build\libHShs-bindgen-0.1.0-inplace.a: unknown symbol `hszmbindgenzm0zi1zi0zminplace_HsBindgenziCziPredicate_SelectFromMainFile_closure'
ghc-9.4.8.exe: ^^ Could not load 'hszmbindgenzm0zi1zi0zminplace_HsBindgenziTH_genBindingszq_closure', dependency unresolved. See top entry above.

I removed the GHCup installation and installed GHC using Chocolatey. hs-bindgen-libclang fails to build, with the following error:

Error: cabal.exe: The package has a './configure' script. If you are on
Windows, This requires a Unix compatibility toolchain such as MinGW+MSYS or
Cygwin. If you are not on Windows, ensure that an 'sh' command is discoverable
in your path.

The CI runner includes a lot of software... I am not sure how to prepare a Windows environment for hs-bindgen.

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.

2 participants