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

Use the cc tool for c2hs instead of cpp #1778

Merged
merged 3 commits into from
Jul 12, 2022
Merged

Use the cc tool for c2hs instead of cpp #1778

merged 3 commits into from
Jul 12, 2022

Conversation

avdv
Copy link
Member

@avdv avdv commented Jul 12, 2022

Fixes #1486

The `cpp` tool on Darwin (and Windows) errors out when using the `-x c` flags:
```
$ cpp -x c /tmp/ch2s.h
clang: error: no input files
```

When using `cpp` as the tool for the `c2hs --cpp=` option, `c2hs` adds the `-x c`
flags automatically which then causes the error. (see [Config.hs])

Using the C compiler instead (with `-E`) makes this work on all systems.

Re-activate tests that had been disabled because of `c2hs` failing with `clang: error: no input files`.

Fixes #1486

[Config.hs]: https://github.com/haskell/c2hs/blob/bb7079f4bf3ca4af00f6178d05a8da9238ddff7c/src/C2HS/Config.hs#L53-L67
@avdv
Copy link
Member Author

avdv commented Jul 12, 2022

There was one failure for the macos bindist job, but not because of the c2hs / cpp issue:

//tests/repl-targets:hs_lib_repl_test_bindist_4_1_0 FAILED
...
        <command line>: User-specified static library could not be loaded (/private/var/tmp/_bazel_runner/d1e3bdaa0c37ce8d00ecff62b05849c3/5557dccbd1535c60f85238399ad86a92/execroot/__main__/bazel-out/darwin-fastbuild/bin/external/zlib.hs/libz.a)
       Loading static libraries is not supported in this configuration.

Is this a known issue? Or a limitation of the integration test framework? @aherrmann @k1nkreet

I have created a new issue to track this => #1779

@k1nkreet
Copy link
Contributor

This is not a known issue for integration testing. The problem could be with test setup because I didn't have a chance to debug it that far on macos because of original issue, or it could be real issue with rules_haskell on macos

@avdv avdv requested a review from k1nkreet July 12, 2022 14:10
@avdv avdv added the merge-queue merge on green CI label Jul 12, 2022
@k1nkreet
Copy link
Contributor

LGTM

@mergify mergify bot merged commit a79780f into master Jul 12, 2022
@mergify mergify bot deleted the try-build-c2hs branch July 12, 2022 15:02
@mergify mergify bot removed the merge-queue merge on green CI label Jul 12, 2022
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.

HaskellC2Hs fails with clang: error: no input files
2 participants