{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/19020","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/19020/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/19020/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/19020/events","html_url":"https://github.com/NixOS/nixpkgs/pull/19020","id":179626376,"number":19020,"title":"clang-tools: New package","user":{"login":"aherrmann","id":732652,"avatar_url":"https://avatars.githubusercontent.com/u/732652?v=3","gravatar_id":"","url":"https://api.github.com/users/aherrmann","html_url":"https://github.com/aherrmann","followers_url":"https://api.github.com/users/aherrmann/followers","following_url":"https://api.github.com/users/aherrmann/following{/other_user}","gists_url":"https://api.github.com/users/aherrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aherrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherrmann/subscriptions","organizations_url":"https://api.github.com/users/aherrmann/orgs","repos_url":"https://api.github.com/users/aherrmann/repos","events_url":"https://api.github.com/users/aherrmann/events{/privacy}","received_events_url":"https://api.github.com/users/aherrmann/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-27T22:01:10Z","updated_at":"2017-01-11T13:01:21Z","closed_at":"2016-09-29T11:16:20Z","pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/19020","html_url":"https://github.com/NixOS/nixpkgs/pull/19020","diff_url":"https://github.com/NixOS/nixpkgs/pull/19020.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/19020.patch"},"body":"###### Motivation for this change\n\nFixes #9214\n\nAllows to install clang-tools for C++ development without also installing the\nclang compiler and its tool-chain. This way it is possible to use e.g.\n`clang-format` without conflicting with e.g. GCC's tool-chain, or the global\nsystem tool-chain.\n###### Things done\n- [ ] Tested using sandboxing\n  ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS,\n    or option `build-use-sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file)\n    on non-NixOS)\n- Built on platform(s)\n  - [ ] NixOS\n  - [ ] OS X\n  - [x] Linux\n- [ ] Tested compilation of all pkgs that depend on this change using `nix-shell -p nox --run \"nox-review wip\"`\n- [x] Tested execution of all binary files (usually in `./result/bin/`)\n- [x] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/271862591","html_url":"https://github.com/NixOS/nixpkgs/pull/19020#issuecomment-271862591","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/19020","id":271862591,"user":{"login":"aherrmann","id":732652,"avatar_url":"https://avatars.githubusercontent.com/u/732652?v=3","gravatar_id":"","url":"https://api.github.com/users/aherrmann","html_url":"https://github.com/aherrmann","followers_url":"https://api.github.com/users/aherrmann/followers","following_url":"https://api.github.com/users/aherrmann/following{/other_user}","gists_url":"https://api.github.com/users/aherrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aherrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherrmann/subscriptions","organizations_url":"https://api.github.com/users/aherrmann/orgs","repos_url":"https://api.github.com/users/aherrmann/repos","events_url":"https://api.github.com/users/aherrmann/events{/privacy}","received_events_url":"https://api.github.com/users/aherrmann/received_events","type":"User","site_admin":false},"created_at":"2017-01-11T13:01:21Z","updated_at":"2017-01-11T13:01:21Z","body":"> The wrapper-script for clang-tidy does not set the -system and -idirafter compiler flags, which libtooling will need to locate the local system headers (like iostream).\r\n\r\n@marvin2k Thanks for pointing that out. The executables are [generated](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/clang-tools/default.nix#L19) using the [`makeWrapper`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh) shell function. That function accepts an argument [`--add-flags`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh#L72-L76) which could be used to pass those extra arguments to `clang-tidy`. However, that would pin `clang-tidy` to one particular standard library implementation (e.g. libstdc++ vs. libc++). I don't know whether that is desirable.\r\n\r\n> Additionally I'm having trouble to have clang-tidy load flags from the compile_commands.json. I can see open/read from the file using strace, but the flags are not applied. Am not sure what is going wrong here...\r\n\r\nI'm afraid I don't know enough of the inner workings of `clang-tidy` to help you with that."}}
{"actor":{"display_login":"aherrmann"}}