No version of tool-clangtidy works on all OS

I’m working on an open source low-cost ventilator project - GitHub - RespiraWorks/Ventilator: Fully-featured ICU ventilator design, optimized for manufacture using commonly available components and free to license. Repository tracks all mechanical, electrical and systems design, software, requirements and regulatory documentation. - which uses PlatformIO, and I’d like to use clang-tidy to get extra protection from bugs.

Ideally, a “pio check” command would return the same results for every contributor to the project, and would return the same results if run on the CI server.

I’ve successfully configured pio to use clangtidy, however, I’ve noticed that the “tool-clangtidy” package at Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog has two versions: 1.8 which only runs on Linux and MacOS, and 1.9 which only runs on Linux and Windows - meaning, if I pin any of these versions, some contributors will be unable to run “pio check”, and if I don’t, then different contributors will be running different versions of clang-tidy and getting different warnings - e.g. someone thinks they’re checking in correct code, but their code has errors on CI, or on someone else’s machine.

Would it be possible to release 1.9 for Mac OS too?

Another thing that bothers me is that this package has no contact info about its author/maintainer (I was assuming that means it’s a native package bundled with pio?) and does not have a repository (so I don’t know how I could go about building a Mac OS version of it myself). Would it be possible to add this information too?

Thanks.

I hope so… if I’m understanding this right it should just be a matter of making clang-tidy for MacOS avaialble as a package - shouldn’t even need to compile it as the binaries are available as part of the LLVM install packages… but if you want to self-compile, you’d want the clang-tools-extra source files, which will reveal the clang-tidy. To do the same version as platformio uses for 1.9… you’d want the files from the LLVM 9.0.0 release.

https://releases.llvm.org/download.html

If you just want the clang-tidy macOS binary LLVM 9.0.0, I extracted it and put it on bintray here. Hopefully it works standalone! :open_mouth:

Thanks - I agree that this is simply a matter of creating the tool-clangtidy package version 1.9 for Mac and uploading it. But I suppose this is something only the PlatformIO maintainers can do, so I was hoping they’d read this and do it :slight_smile:

I guess another option would be to build it myself and reference a custom package repository from our project.

1 Like

Yeah, for it to be available to all. But in the meantime, you should be able to shove that executable and a manifest file in a tar.gz or whatever, put that somewhere downloadable, and reference it in the platformio.ini … and probably have the ‘official’ package go up the next day! :laughing:

Now, I could be talking utter nonsense, but I think an alternate package can be specified via platform-packages… maybe something like platform-packages = tool-clang-tidy @ https://dl.bintray.com/pfeerick/macOS/tool-clangtidy-darwin_x86_64-1.90000.0.tar.gz/tool-clangtidy-darwin_x86_64-1.90000.0.tar.gz … which doesn’t really have the right file permissions but should still work… or fail miserably.

@ivankravets … can we get an update for the clang-tidy tool for Mac so that there are same version binaries for all OSes … pretty please? :slight_smile: I yanked the binary out of the LLVM 9.0.0 mac install package and put it here if that helps… but a Mac user will need to confirm that binary works as is.

1 Like

@valeros, please help

To whoever did this - thanks :slight_smile: Version 1.10 is now available for all OS, so we can pin this version.

2 Likes