ziglang/zig
264
5.9k
Fork
You've already forked zig
752

WIP: Add Compilation Database Support to Zig Build System (compile_commands.json) #35462

Draft
haydenridd wants to merge 9 commits from haydenridd/zig:feature/add-compilation-database-support into master
pull from: haydenridd/zig:feature/add-compilation-database-support
merge into: ziglang:master
ziglang:master
ziglang:elfv2
ziglang:spork8
ziglang:restricted
ziglang:0.16.x
ziglang:panic-rewrite
ziglang:parking-futex-lockfree
ziglang:windows-Io-cleanup
ziglang:Io-watch
ziglang:ParseCommandLineOptions
ziglang:windows-async-files
ziglang:poll-ring
ziglang:debug-file-leaks-differently
ziglang:debug-file-leaks
ziglang:ProcessPrng
ziglang:elfv2-dyn
ziglang:jobserver
ziglang:threadtheft
ziglang:io-threaded-no-queue
ziglang:0.15.x
ziglang:Io.net
ziglang:comptime-allocator
ziglang:restricted-function-pointers
ziglang:cli
ziglang:wasm-linker-writer
ziglang:wrangle-writer-buffering
ziglang:sha1-stream
ziglang:async-await-demo
ziglang:fixes
ziglang:0.14.x
ziglang:ast-node-methods
ziglang:macos-debug-info
ziglang:make-vs-configure
ziglang:fuzz-macos
ziglang:sans-aro
ziglang:ArrayList-reserve
ziglang:incr-bug
ziglang:llvm-ir-nosanitize-metadata
ziglang:ci-tarballs
ziglang:ci-scripts
ziglang:threadpool
ziglang:0.12.x
ziglang:new-pkg-hash
ziglang:json-diagnostics
ziglang:more-doctests
ziglang:rework-comptime-mutation
ziglang:0.11.x
ziglang:ci-perf-comment
ziglang:stage2-async
ziglang:0.10.x
ziglang:autofix
ziglang:0.9.x
ziglang:aro
ziglang:hcs
ziglang:0.8.x
ziglang:0.7.x
First-time contributor
Copy link

This PR closes issue #17365 from Github.

I was wanting this functionality, and got the general idea of how to implement it from the following stale PR:

The general idea is the same, JSON fragments are generated using Clang's -MJ[path] flag, and then merged into a single JSON file. However, I integrated this deeper into Zig's build system using a new Step.CompileCommands step type. The positive to this is that all generated JSON files are LazyPaths now, so if they aren't installed/depended upon by something, they don't get generated. The fragments themselves always get generated (when enabled) into a temporary directory since they're an artifact of the compilation itself.

New functionality:

  • When creating a Step.Compile in build.zig (addExecutable(), addObject(), addLibrary(), addTest()), you now have an option .enable_compdb.
  • When true, this allows you to access a generated compile_commands.json via LazyPath with a new function Step.Compile.getCompileCommandsJson().
  • This is the compile_commands.json ONLY for that Step.Compile
  • There is a new flag -fcompdb for zig build
  • When used, this will default ALL Step.Compile to generate compile_commands.json
  • For both cases, you can get a LazyPath to the merged compile_commands.json for ALL Step.Compile that had it enabled via Build.getMergedCompileCommandsJson()
  • This gives an easy way to get a compile_commands.json for ALL C file compilations in a project, even across dependencies

Testing:

  • I added two standalone tests at test/standalone/compdb_single and test/standalone/compdb_merged
  • Check the source code for details (+ a good example of using the new API), but the general idea is I generate a bunch of compile commands files and check them against my rough expectation for how they should look

Areas for Review:

  • I didn't mess with any kind of caching for the fragment files, so in theory the case where only a single C file out of many is recompiled might lead to inaccurate compile_commands.json. In practice I could never get this to happen, so I'm a little afraid enabling this feature always forces ALL C files to recompile. I don't know why that would be the case with how I've set up the step dependencies, but it's something I'd like a sanity check on.
  • In the make function in CompileCommands.zig, I took the logic for writing a file to tmp that might be installed by the user later from WriteFile.zig. Specifically the code:
varrand_int:u64=undefined;io.random(@ptrCast(&rand_int));consttmp_dir_path="tmp"++Dir.path.sep_str++std.fmt.hex(rand_int);

I think this is fine, and it works in practice, but wanted to double check this is the correct way to get what I'm after.

This PR closes issue [#17365](https://github.com/ziglang/zig/issues/17365) from Github. I was wanting this functionality, and got the general idea of how to implement it from the following stale PR: - https://github.com/ziglang/zig/pull/18391 The general idea is the same, JSON fragments are generated using Clang's `-MJ[path]` flag, and then merged into a single JSON file. However, I integrated this deeper into Zig's build system using a new `Step.CompileCommands` step type. The positive to this is that all generated JSON files are `LazyPath`s now, so if they aren't installed/depended upon by something, they don't get generated. The fragments themselves always get generated (when enabled) into a temporary directory since they're an artifact of the compilation itself. New functionality: - When creating a `Step.Compile` in `build.zig` (`addExecutable(), addObject(), addLibrary(), addTest()`), you now have an option `.enable_compdb`. - When `true`, this allows you to access a generated `compile_commands.json` via `LazyPath` with a new function `Step.Compile.getCompileCommandsJson()`. - This is the `compile_commands.json` ONLY for that `Step.Compile` - There is a new flag `-fcompdb` for `zig build` - When used, this will default ALL `Step.Compile` to generate `compile_commands.json` - For both cases, you can get a `LazyPath` to the merged `compile_commands.json` for ALL `Step.Compile` that had it enabled via `Build.getMergedCompileCommandsJson()` - This gives an easy way to get a `compile_commands.json` for ALL C file compilations in a project, even across dependencies Testing: - I added two standalone tests at `test/standalone/compdb_single` and `test/standalone/compdb_merged` - Check the source code for details (+ a good example of using the new API), but the general idea is I generate a bunch of compile commands files and check them against my rough expectation for how they should look Areas for Review: - I didn't mess with any kind of caching for the fragment files, so in theory the case where only a single C file out of many is recompiled might lead to inaccurate `compile_commands.json`. In practice I could never get this to happen, so I'm a little afraid enabling this feature always forces ALL C files to recompile. I don't know why that would be the case with how I've set up the step dependencies, but it's something I'd like a sanity check on. - In the `make` function in `CompileCommands.zig`, I took the logic for writing a file to `tmp` that might be installed by the user later from `WriteFile.zig`. Specifically the code: ``` zig var rand_int: u64 = undefined; io.random(@ptrCast(&rand_int)); const tmp_dir_path = "tmp" ++ Dir.path.sep_str ++ std.fmt.hex(rand_int); ``` I think this is fine, and it works in practice, but wanted to double check this is the correct way to get what I'm after.
- Added support in the Zig build system for generating compile_commands.json using -MJ flag
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
beacc26ab1
- zig build -fcompdb flag to default all Compile steps to generating fragments
- Step.CompileCommands added to build system
- Support enabling/disabling compile_commands generation per Step.Compile
- Can access compile_commands.json per Step.Compile as a LazyPath via Step.Compile.getCompileCommandsJson()
- Can access merged compile_commands.json for ALL enabled Step.Compile via Build.getMergedCompileCommandsJson()
- Added standalone tests for basic checks on expected compile_commands.json generation
haydenridd force-pushed feature/add-compilation-database-support from beacc26ab1
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to aa270f3ee3
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
2026年05月26日 07:51:24 +02:00
Compare
Contributor
Copy link

Be aware that the build system is being reworked: #35428

Be aware that the build system is being reworked: https://codeberg.org/ziglang/zig/pulls/35428
First-time contributor
Copy link

I've said it before, and I will say it again: I think this is a great feature to have.

Generating compile_commands.json enables developers to:

  • use the LLVM LSP clangd (useful for people using [neo]Vim, emacs, sublime, vscode)
  • use static analyzers like clang-check, clang-tidy, sonarlint, pvs studio

Anecdotally, I know some people that use CMake exclusively because of this feature.
Thanks for working on this!

I've said it before, and I will say it again: I think this is a great feature to have. Generating `compile_commands.json` enables developers to: - use the LLVM LSP clangd (useful for people using [neo]Vim, emacs, sublime, vscode) - use static analyzers like clang-check, clang-tidy, sonarlint, pvs studio Anecdotally, I know some people that use CMake exclusively because of this feature. Thanks for working on this!
Contributor
Copy link

With the build system rework, generating compile_commands.json should not need any support in build.zig or zig itself. It would also make it possible for clangd and such be able to use zig's build graph directly as alternative to compile_commands.json

With the build system rework, generating `compile_commands.json` should not need any support in `build.zig` or zig itself. It would also make it possible for clangd and such be able to use zig's build graph directly as alternative to `compile_commands.json`
Author
First-time contributor
Copy link

@Cloudef wrote in #35462 (comment):

With the build system rework, generating compile_commands.json should not need any support in build.zig or zig itself. It would also make it possible for clangd and such be able to use zig's build graph directly as alternative to compile_commands.json

Interesting! Do mean in the sense that it would be up to the user to consume the build graph and do it themselves? I have a rough understanding of the rework as I watched a little of Andrew's stream the other day when he was working on it. What about the rework specifically makes it so that generating/merging compile_commands fragments from compiler calls could be done outside of build.zig/Zig?

My only 2c about having it supported directly in build.zig was I really like in this implementation having compile_commands.json as a LazyDependency you can perform further processing on directly in the build system. Could open up some cool tooling possibilities!

@Cloudef wrote in https://codeberg.org/ziglang/zig/pulls/35462#issuecomment-15948914: > With the build system rework, generating `compile_commands.json` should not need any support in `build.zig` or zig itself. It would also make it possible for clangd and such be able to use zig's build graph directly as alternative to `compile_commands.json` Interesting! Do mean in the sense that it would be up to the user to consume the build graph and do it themselves? I have a rough understanding of the rework as I watched a little of Andrew's stream the other day when he was working on it. What about the rework specifically makes it so that generating/merging compile_commands fragments from compiler calls could be done outside of `build.zig`/Zig? My only 2c about having it supported directly in `build.zig` was I really like in this implementation having `compile_commands.json` as a `LazyDependency` you can perform further processing on directly in the build system. Could open up some cool tooling possibilities!
Contributor
Copy link

What about the rework specifically makes it so that generating/merging compile_commands fragments from compiler calls could be done outside of build.zig/Zig?

The graph file contains all information how artifact should be produced so it should have all C/C++ file paths and flags and so on.

> What about the rework specifically makes it so that generating/merging compile_commands fragments from compiler calls could be done outside of build.zig/Zig? The graph file contains all information how artifact should be produced so it should have all C/C++ file paths and flags and so on.

The graph file contains all information how artifact should be produced so it should have all C/C++ file paths and flags and so on.

That's not quite right. For example, the maker process, which consumes the configuration graph file, executes the C compiler with dep file enabled, then parses the dep file to learn the C/C++ file paths. That information is available after running the maker process.

> The graph file contains all information how artifact should be produced so it should have all C/C++ file paths and flags and so on. That's not quite right. For example, the maker process, which consumes the configuration graph file, executes the C compiler with dep file enabled, then parses the dep file to learn the C/C++ file paths. That information is available *after* running the maker process.
haydenridd changed title from (削除) Add Compilation Database Support to Zig Build System (compile_commands.json) (削除ここまで) to WIP: Add Compilation Database Support to Zig Build System (compile_commands.json) 2026年05月28日 17:24:41 +02:00
Author
First-time contributor
Copy link

Swapped to WIP while I take a crack at updating it to work w/ the build system re-work

Swapped to WIP while I take a crack at updating it to work w/ the build system re-work
haydenridd force-pushed feature/add-compilation-database-support from aa270f3ee3
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to 68cef6d4ab
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
2026年06月17日 06:37:09 +02:00
Compare
Author
First-time contributor
Copy link

Just pushed some commits that substantially refactor my approach and integrate it with the new build rework. I ditched the new CompileCommands step after further thought. JSON fragments, after all, are artifacts of a Compile step. It didn't really make sense to have the merging of these fragments as a separate step, and so that has been folded into the Maker for a Step.Compile.

This puts the current state of my feature in a half complete state. You can get merged compile_commands.json files as a LazyPath for each Step.Compile in your build.zig using compile_ptr.getCompileCommandsJson(). See the test I added in test/standalone/compdb_single for example usage.

What I'm struggling with is the feature most people want when they think of compile_commands.json, which is a merged file for all Step.Compile in your entire build graph. What I want is access to a LazyPath of this global merged file via b.getCompileCommandsJson(), where depending on this file is what triggers its creation similar to how I have it set up in Step.Compile. The shape of what I want to do is:

  • User build.zig depends on global compile_commands.json via b.getCompileCommandsJson()
  • For each Step.Compile in the build graph, collect the LazyPath of this step's compile_commands.json with compile_ptr.getCompileCommandsJson()
  • Add to Maker merging all these files after all Step.Compile have completed

Anybody have suggestions for how to implement the "global" compile_commands.json as described above? I feel like it should live in Build.Graph but after a couple of false starts can't quite wrap my head around the how.

Just pushed some commits that substantially refactor my approach and integrate it with the new build rework. I ditched the new `CompileCommands` step after further thought. JSON fragments, after all, are artifacts of a `Compile` step. It didn't really make sense to have the merging of these fragments as a separate step, and so that has been folded into the `Maker` for a `Step.Compile`. This puts the current state of my feature in a half complete state. You can get merged `compile_commands.json` files as a `LazyPath` for each `Step.Compile` in your `build.zig` using `compile_ptr.getCompileCommandsJson()`. See the test I added in `test/standalone/compdb_single` for example usage. What I'm struggling with is the feature most people want when they think of `compile_commands.json`, which is a merged file for _all_ `Step.Compile` in your entire build graph. What I want is access to a `LazyPath` of this global merged file via `b.getCompileCommandsJson()`, where depending on this file is what triggers its creation similar to how I have it set up in `Step.Compile`. The shape of what I want to do is: - User `build.zig` depends on global `compile_commands.json` via `b.getCompileCommandsJson()` - For each `Step.Compile` in the build graph, collect the `LazyPath` of this step's `compile_commands.json` with `compile_ptr.getCompileCommandsJson()` - Add to `Maker` merging all these files _after_ all `Step.Compile` have completed Anybody have suggestions for how to implement the "global" `compile_commands.json` as described above? I feel like it should live in `Build.Graph` but after a couple of false starts can't quite wrap my head around the how.
haydenridd force-pushed feature/add-compilation-database-support from 68cef6d4ab
Some checks failed
ci / aarch64-freebsd-debug (pull_request) Has been cancelled
ci / aarch64-freebsd-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-netbsd-debug (pull_request) Has been cancelled
ci / aarch64-netbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-netbsd-debug (pull_request) Has been cancelled
ci / x86_64-netbsd-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
to cd44f78f78
Some checks are pending
ci / aarch64-freebsd-debug (pull_request) Blocked by required conditions
ci / aarch64-freebsd-release (pull_request) Blocked by required conditions
ci / aarch64-linux-debug (pull_request) Blocked by required conditions
ci / aarch64-linux-release (pull_request) Blocked by required conditions
ci / aarch64-netbsd-debug (pull_request) Blocked by required conditions
ci / aarch64-netbsd-release (pull_request) Blocked by required conditions
ci / aarch64-macos-debug (pull_request) Blocked by required conditions
ci / aarch64-macos-release (pull_request) Blocked by required conditions
ci / loongarch64-linux-debug (pull_request) Blocked by required conditions
ci / loongarch64-linux-release (pull_request) Blocked by required conditions
ci / powerpc64le-linux-debug (pull_request) Blocked by required conditions
ci / powerpc64le-linux-release (pull_request) Blocked by required conditions
ci / riscv64-linux-debug (pull_request) Blocked by required conditions
ci / riscv64-linux-release (pull_request) Blocked by required conditions
ci / s390x-linux-debug (pull_request) Blocked by required conditions
ci / s390x-linux-release (pull_request) Blocked by required conditions
ci / x86_64-freebsd-debug (pull_request) Blocked by required conditions
ci / x86_64-freebsd-release (pull_request) Blocked by required conditions
ci / x86_64-linux-debug (pull_request) Blocked by required conditions
ci / x86_64-linux-debug-llvm (pull_request) Blocked by required conditions
ci / x86_64-linux-release (pull_request) Blocked by required conditions
ci / x86_64-netbsd-debug (pull_request) Blocked by required conditions
ci / x86_64-netbsd-release (pull_request) Blocked by required conditions
ci / x86_64-openbsd-debug (pull_request) Blocked by required conditions
ci / x86_64-openbsd-release (pull_request) Blocked by required conditions
ci / x86_64-windows-debug (pull_request) Blocked by required conditions
ci / x86_64-windows-release (pull_request) Blocked by required conditions
2026年06月17日 07:13:09 +02:00
Compare
Some checks are pending
ci / aarch64-freebsd-debug (pull_request) Blocked by required conditions
ci / aarch64-freebsd-release (pull_request) Blocked by required conditions
ci / aarch64-linux-debug (pull_request) Blocked by required conditions
Required
Details
ci / aarch64-linux-release (pull_request) Blocked by required conditions
Required
Details
ci / aarch64-netbsd-debug (pull_request) Blocked by required conditions
ci / aarch64-netbsd-release (pull_request) Blocked by required conditions
ci / aarch64-macos-debug (pull_request) Blocked by required conditions
Required
Details
ci / aarch64-macos-release (pull_request) Blocked by required conditions
Required
Details
ci / loongarch64-linux-debug (pull_request) Blocked by required conditions
ci / loongarch64-linux-release (pull_request) Blocked by required conditions
ci / powerpc64le-linux-debug (pull_request) Blocked by required conditions
Required
Details
ci / powerpc64le-linux-release (pull_request) Blocked by required conditions
Required
Details
ci / riscv64-linux-debug (pull_request) Blocked by required conditions
ci / riscv64-linux-release (pull_request) Blocked by required conditions
ci / s390x-linux-debug (pull_request) Blocked by required conditions
Required
Details
ci / s390x-linux-release (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-freebsd-debug (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-freebsd-release (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-linux-debug (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-linux-debug-llvm (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-linux-release (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-netbsd-debug (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-netbsd-release (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-openbsd-debug (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-openbsd-release (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-windows-debug (pull_request) Blocked by required conditions
Required
Details
ci / x86_64-windows-release (pull_request) Blocked by required conditions
Required
Details
This pull request has changes conflicting with the target branch.
  • lib/compiler/configurer.zig
  • lib/std/Build/Step/Compile.zig
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u feature/add-compilation-database-support:haydenridd-feature/add-compilation-database-support
git switch haydenridd-feature/add-compilation-database-support
Sign in to join this conversation.
No reviewers
Labels
Clear labels
abi/f32
abi/ilp32
abi/sf
accepted
This proposal is planned.
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
The web application for interactive documentation and generation of its assets.
backend/c
The C backend outputs C source code.
backend/llvm
The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted
The self-hosted backends produce machine code directly.
binutils
Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
build system
The Zig build system - zig build, std.Build, the build runner, and package management.
debug info
An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs
An issue with documentation, e.g. the language reference or standard library doc comments.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing
An issue related to Zig's integrated fuzz testing.
incremental
Reuse of internal compiler state for faster compilation.
lib/c
This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt
This issue relates to Zig's compiler-rt library.
lib/cxx
This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std
This issue relates to Zig's standard library.
lib/tsan
This issue relates to Zig's vendored libtsan.
lib/ubsan-rt
This issue relates to Zig's ubsan-rt library.
lib/unwind
This issue relates to Zig's vendored libunwind.
linking
Zig's integrated object file and incremental linker.
miscompilation
The compiler reports success but produces semantically incorrect code.
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
This issue suggests language modifications. If it also has the "accepted" label then it is planned.
release notes
This issue or pull request should be mentioned in the release notes.
testing
This issue is related to testing the compiler, standard library, or other parts of Zig.
zig cc
Zig as a drop-in C-family compiler.
zig fmt
The Zig source code formatter.
zig reduce
The Zig source code reduction tool.
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig!35462
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "haydenridd/zig:feature/add-compilation-database-support"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?