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

build: Use nix to manage dev tooling starting with clang-tidy #4292

Merged
merged 18 commits into from
Nov 29, 2022

Conversation

jackgerrits
Copy link
Member

@jackgerrits jackgerrits commented Nov 28, 2022

Nix allows us to have a consistent developer environment. Perhaps the most useful instance of this is that the commands that are run locally use the exact same version of tooling as what is run in CI.

Documentation:

All args are passed through to the underlying run-clang-format call.

To run clang-tidy on all files, as is done in CI you can run:

nix develop -c vw-clang-tidy

To just check specific files you can pass them as args:

nix develop -c vw-clang-tidy vowpalwabbit/core/src/kskip_ngram_transformer.cc

To apply fixes use -fix:

nix develop -c vw-clang-tidy vowpalwabbit/core/src/kskip_ngram_transformer.cc -fix

Using from Windows:

  • Using WSL - commands are identical as above
  • Using docker
    docker run -v %cd%:/src -it nixos/nix nix --extra-experimental-features nix-command --extra-experimental-features flakes develop /src -c vw-clang-tidy

@jackgerrits jackgerrits changed the title build: Experiment with using nix to manage dev tooling build: Experiment with using nix to manage dev tooling starting with clang-tidy Nov 28, 2022
@jackgerrits jackgerrits marked this pull request as ready for review November 28, 2022 22:00
@jackgerrits jackgerrits changed the title build: Experiment with using nix to manage dev tooling starting with clang-tidy build: Use nix to manage dev tooling starting with clang-tidy Nov 29, 2022
@jackgerrits jackgerrits merged commit a295b6e into VowpalWabbit:master Nov 29, 2022
@jackgerrits jackgerrits deleted the clang-tooling-nix branch November 29, 2022 15:21
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.

3 participants