[SERVER-81554] Make C compilation hermetic in bazel toolchain Created: 29/Sep/23  Updated: 02/Feb/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Zack Winter Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Build
Participants:

 Description   

Currently we are passing in "-nostdinc++", but not "-nostdinc". This causes C headers to be included from the system outside of the bazel toolchain itself, which is not ideal for remote execution or for reproducible builds.

Pass in "-nostdinc" and update the bazel toolchain to contain the currently missing header files necessary for c compilation. The issue I originally ran into while trying to support this was that we were missing inttypes.h. It's unclear which headers we need to add to fully support this.



 Comments   
Comment by Anthony Pratti [ 16/Oct/23 ]

Aspect has done some work for making gcc hermetic and available for bazel. Maybe there is some learnings we can use for this. See https://github.com/aspect-build/gcc-toolchain

Generated at Thu Feb 08 06:46:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.