Comments (8)
LGTM
Also, AFAIK, link commands aren't needed.
from b2.
What is this "load an existing compile_commands.json?" Why?
from b2.
What is this "load an existing compile_commands.json?" Why?
Because B2 can do very fine grained incremental builds. And if you want to get a full picture of the project you can't throw away the history of what you previously compiled on each b2
invocation. Especially if it's an invocation that's a no-op, which would create an empty json file.
from b2.
That is a nice to have feature but maybe not strictly required for an initial proof of concept.
from b2.
I think, the described approach is actually not needed. Running with different build requests, and appending commands to compile_commands.json
is both unnecessary complexity and potentially problematic, when e.g. some targets are removed from the build scripts.
Rather, I think something like b2 variant=debug,release --compile-db
should create a new file for all jam targets it considers for update (not necessarily updates). Maybe we also don't want it to actually try updating them, although there is already -n
flag for that.
There's also a question what to do with ancillary targets e.g. created by ac module. Maybe potentially add an engile rule that marks a target as hidden?
Now, that I think of it, what if we can mark Jam targets as watched (maybe by setting a variable on them), and then their actions get recorded into some list in the form of command output sources
?
from b2.
After my many questions in slack, adjusted plan:
- Add a feature to register action pre-execution hooks in the engine side. Such hooks would be given the action script string and can process the string. Possibly returning a different string to execute.
- Add a action pre-exec hook to watch for per-toolset compile (and link?) commands that extracts the single command line invocation (by matching a regex in the action script). Control would be by adding a target variable
COMMAND_DATABASE
that sets a regex that extracts the command. - Change, initially, the gcc/clang toolset to set the variable for each appropriate action.
- Add a command line arg
--command-database=json
that simulates the build request (i.e. equivalent to-n -a
). That collects all the registered action commands and writes out the resulting json to<build-dir>/compile_commands.json
. - Add a command line arg
--command-database-out=<filename>
to specify an override to the file name and location.
from b2.
Step 0? Structured data output to JSON complete: c30bce8
from b2.
WIP here.. https://github.com/bfgroup/b2/tree/feature/compiledb
from b2.
Related Issues (20)
- b2 fails to build for clang 3.6 HOT 1
- FreeBSD builds in CI HOT 2
- Manifest-related problems with b2 building in msvc-14.0 HOT 2
- Can't compile and install b2 with b2 HOT 1
- How to build clangw .lib HOT 2
- `b2` build fails on gcc 4.8 HOT 1
- b2 can't find MSVC toolset for Visual Studio 2022 v17.9.0 HOT 2
- Warnings about freeing a non-allocated object
- Infinite recursion in `bcp` tests HOT 3
- Config checks using `address-model=32` in Linux don't use the right flags HOT 2
- [question] Best way to pass _GLIBCXX_USE_CXX11_ABI=0/1 using b2?
- Should --abbreviate-paths be made default under Windows? HOT 15
- lzma.jam doesn't support building from source, like zlib.jam and bzip2.jam HOT 1
- zstd.jam doesn't support building from source, as zlib.jam and bzip2.jam do
- Linking Fails - dangerous relocation: R_AMD64_IMAGEBASE with __ImageBase undefined HOT 2
- Boost build fails when VS 2022 Preview is installed HOT 14
- build error-boost1.85 with VS2022 under win10 HOT 1
- after setting using zstd in project-config.jam boost.iostreams still can not detect zstd HOT 2
- Option to turn off wasm-exceptions not available for emscripten builds HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from b2.