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

Change C include statements to use " instead of < #16

Merged
merged 4 commits into from
Jun 10, 2024
Merged

Conversation

ParkMyCar
Copy link
Member

AFAIU using angle brackets for #include statements is generally used for system headers while double-quotes prioritizes headers in the current working directory (stackoverflow). It's compiler dependent, but using double-quotes fixes some issues I ran into while building with clang via Bazel

@benesch
Copy link
Member

benesch commented Jun 10, 2024

Probably fine, though a little confused about what Bazel is doing here.

Can you see if you can get CI working here again? I'll feel a little better with a green build. Feel free to just ditch the "ubuntu-old" job.

@ParkMyCar
Copy link
Member Author

Probably fine, though a little confused about what Bazel is doing here.

It's specifically for getting CXX to work with Bazel. I haven't totally tracked it down, but I think it's Bazel's cc_library rule setting the include paths for deps with -iquote instead of just -I.

Can you see if you can get CI working here again? I'll feel a little better with a green build. Feel free to just ditch the "ubuntu-old" job.

For sure! It looks like it has something to do with trying to find SIMD instructions for x86 (not x86_64) architectures. Seems like it's linking against libs from clang 14.0 which is quite old.

@benesch
Copy link
Member

benesch commented Jun 10, 2024

I haven't totally tracked it down, but I think it's Bazel's cc_library rule setting the include paths for deps with -iquote instead of just -I.

Ah, well, that would explain it...

@ParkMyCar
Copy link
Member Author

For the build issue, it looks like clang got rig of the __build_ia32_* family of intrinsics (Phabricator) which will cause problems if you try compiling with a newer version of clang without the intrinsics against a version of libclang with the intrinsics.

Adding clang --version to the CI script indicates that when running with the ubuntu 22.04 image we should be using clang-14, but the build still fails. This comment indicates that clang-15 is also available on the system, so my guess it that the cmake crate that protobuf-src uses is invoking the build with clang-15 but linking against the headers from clang-14.

Side stepping all of this, the ubuntu-20.04 image works out of the box, so that's what I set CI to use.

Copy link
Member

@benesch benesch left a comment

Choose a reason for hiding this comment

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

Great, let's roll with this. Thanks for fixing this up, Parker!

@ParkMyCar ParkMyCar merged commit 1a01d55 into master Jun 10, 2024
4 checks passed
@ParkMyCar ParkMyCar deleted the change-imports branch June 10, 2024 18:20
ParkMyCar added a commit to MaterializeInc/materialize that referenced this pull request Jun 11, 2024
This PR upgrades our `protobuf-native` dependency

### Motivation

Pull in MaterializeInc/rust-protobuf-native#16
for Bazel

### Checklist

- [ ] This PR has adequate test coverage / QA involvement has been duly
considered. ([trigger-ci for additional test/nightly
runs](https://trigger-ci.dev.materialize.com/))
- [ ] This PR has an associated up-to-date [design
doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md),
is a design doc
([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)),
or is sufficiently small to not require a design.
  <!-- Reference the design in the description. -->
- [ ] If this PR evolves [an existing `$T ⇔ Proto$T`
mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md)
(possibly in a backwards-incompatible way), then it is tagged with a
`T-proto` label.
- [ ] If this PR will require changes to cloud orchestration or tests,
there is a companion cloud PR to account for those changes that is
tagged with the release-blocker label
([example](MaterializeInc/cloud#5021)).
<!-- Ask in #team-cloud on Slack if you need help preparing the cloud
PR. -->
- [x] This PR includes the following [user-facing behavior
changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note):
  - N/a
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