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
[SR-4675] Report detailed build version from Benchmark drivers #47252
Comments
@gottesmm could you take this up? Can you add |
@palimondo I am working on other things right now. Let me explain to you how to do this if it interests you. I think this would be another one of those really nice solid contributions to get under your belt. I do not think that one can programmatically AFAIKT get this information (but I may be wrong). That suggests to me we should go down the cmake configure route. To see how to do that, please first read this section of the cmake guide: https://cmake.org/cmake/help/v3.4/command/configure_file.html and look at these examples from the benchmark suite itself where we have accomplished such things. https://github.com/apple/swift/blob/master/benchmark/scripts/CMakeLists.txt There are a few challenges here that we need to consider:
Your thoughts? |
So far I got a Version.swift.in that produces Version.swift using the This is my first look at SwiftPM, so… looking at Package.swift, it looks like I can run arbitrary code there? Would it be OK to shell out there with |
There are a bunch of ways we can do this. I am really not sure what is the "right way". Lets ask the SwiftPM people if there is a better way to do this: @aciidb0mb3r. |
@palimondo I talked with some people and some further thoughts: 1. I think for the swiftpm case it is ok to just output nothing or at least a message that says N/A. SwiftPM will eventually have a feature to do this but they do not today. 2. The information that you really want is swift version and benchmark version. That to me says that we want swiftc --version as a human readable string and to get the actual git hash of the benchmark suite. |
Let me add a bit more information here. When I spoke with the swiftpm people they were pretty against shelling out. That is why I am suggesting that we just do something with swiftpm that doesn't print out the version. Since it is only for editing at this point, it is fine to do. |
Umm… I think this still leaves me with a problem: To make the benchmark compile, I have to have |
I would have a separate Version.swift for swiftpm. |
Let me elaborate slightly. With cmake we have much more control vs swiftpm. So I imagine it would work like this:
|
OK, I think I got this (in principle). I'm stuck on building with SwiftPM. It always crashes on me. @gottesmm can you get the benchmarks to build with SwiftPM? |
Additional Detail from JIRA
md5: e8809188119162febcdf298bae1cc028
relates to:
Issue Description:
When running performance tests and comparing them between different builds, it would be helpful to have an attribute that would report version information about the benchmark suite build retrieved from git.
We should add a
--version
attribute toBenchmark_*
drivers, that prints git commit hash, to uniquely identify each build of benchmark suite during development. This should probably be retrieved bycmake
during build, becauseBenchmark_Driver
script could be run later on top of modified working directory and would be no longer able to determine the revision used during the build of individual drivers (O, Onone, Ounchecked).The version information should probably also include branch information, and links to github repositories, when comparing PR from forks. ❓
Retrieving Git version from CMake: http://stackoverflow.com/a/6526533/41307
The text was updated successfully, but these errors were encountered: