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

Added the ability to output a binary log from MSBuild. #3626

Merged
merged 12 commits into from
Nov 29, 2018
Merged

Added the ability to output a binary log from MSBuild. #3626

merged 12 commits into from
Nov 29, 2018

Conversation

luckielordie
Copy link
Contributor

@luckielordie luckielordie commented Sep 26, 2018

This is a change that adds the MSBuild binary logging ability referenced by the issue #3625
Closes #3625

Changelog: Feature: Added parameter to the build() method of the MSBuild() build helper to create a binary log.

@ghost ghost added the contributor pr label Sep 26, 2018
@jgsogo
Copy link
Contributor

jgsogo commented Sep 27, 2018

Hi! Thanks for taking this into account.

I would consider passing the output filename (https://github.com/Microsoft/msbuild/blob/master/documentation/wiki/Binary-Log.md#creating-a-binary-log-during-a-build) in the param output_binary_log, not very fan of this semantics, but something like this can work:

  • if not output_binary_log, then do not add the /bl argument.
  • if ouptut_binary_log and isinstance(output_binary_log, bool), then add just /bl
  • if output_binary_log, then add "/bl:{}".format(output_binary_log)

Also, it should be conditionally added to MSBuild >=15.3, whick is the first version to support it.

@lasote lasote added this to the 1.9 milestone Sep 27, 2018
@luckielordie
Copy link
Contributor Author

Hi! Thanks for taking this into account.

I would consider passing the output filename (https://github.com/Microsoft/msbuild/blob/master/documentation/wiki/Binary-Log.md#creating-a-binary-log-during-a-build) in the param output_binary_log, not very fan of this semantics, but something like this can work:

  • if not output_binary_log, then do not add the /bl argument.
  • if ouptut_binary_log and isinstance(output_binary_log, bool), then add just /bl
  • if output_binary_log, then add "/bl:{}".format(output_binary_log)

Also, it should be conditionally added to MSBuild >=15.3, whick is the first version to support it.

All good suggestions! I'll try to update this tonight.

@ghost ghost removed the contributor pr label Sep 27, 2018
@luckielordie luckielordie reopened this Sep 27, 2018
@ghost ghost added the contributor pr label Sep 27, 2018
@luckielordie
Copy link
Contributor Author

Sorry, in haste I clicked the wrong button.

@luckielordie
Copy link
Contributor Author

What sort of behaviour is appropriate if the version does not support the binary logging feature?

It's not fatal but do we still want the build to be completed? Should we warn and carry on or warn and fail?

Is there a mechanism in place already to get the msbuild version we're currently using?

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2018

CLA assistant check
All committers have signed the CLA.

@jgsogo
Copy link
Contributor

jgsogo commented Oct 2, 2018

What sort of behaviour is appropriate if the version does not support the binary logging feature?
It's not fatal but do we still want the build to be completed? Should we warn and carry on or warn and fail?

I'm not sure. I think that this feature won't be enabled by default in a recipe, so you are going to use it when you are working on a recipe: you will activate it explicitly, look for that file, and use it for debugging. If this is the use case, I will raise.

Is there a mechanism in place already to get the msbuild version we're currently using?

Other tools like CMake or SVN are adding an staticmethod called get_version to get this kind of information, you will need to create your own. Maybe in the future we need to unify them all, but until now there is no work in that direction.

@staticmethod

@jgsogo
Copy link
Contributor

jgsogo commented Oct 17, 2018

@luckielordie, we need some changes in this PR to make it pass the test-suite.

And also, we need Matthew Lord to sign the CLA... can you tell him? it looks like he has no github account 😕

@luckielordie
Copy link
Contributor Author

@luckielordie, we need some changes in this PR to make it pass the test-suite.

And also, we need Matthew Lord to sign the CLA... can you tell him? it looks like he has no github account

That's me, my work email isn't attatched to my github, didn't realise at the time.

I keep meaning to come around and fix this whenever I have time.

@jgsogo
Copy link
Contributor

jgsogo commented Nov 26, 2018

Just a kindly reminder... 😇

conans/client/build/msbuild.py Outdated Show resolved Hide resolved
conans/client/build/msbuild.py Outdated Show resolved Hide resolved
conans/client/build/msbuild.py Outdated Show resolved Hide resolved
@danimtb
Copy link
Member

danimtb commented Nov 27, 2018

Hi @luckielordie 👋

We are willing to include this PR on the next Conan release. We could work over this same PR if you don't have time, but we need you to sign the CL to add the changes. Please update us and we will proceed accordingly.

Thanks! 😄

@luckielordie
Copy link
Contributor Author

Hi @luckielordie

We are willing to include this PR on the next Conan release. We could work over this same PR if you don't have time, but we need you to sign the CL to add the changes. Please update us and we will proceed accordingly.

Thanks!

Sorry, let me sort this out on my lunch break. I'll get the CL signed and you're more than welcome to help me on it, I'm so short on time lately.

Copy link
Member

@danimtb danimtb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need a test checking that the log is actually generated with the desired name

conans/test/util/build_sln_command_test.py Outdated Show resolved Hide resolved
@danimtb danimtb requested a review from jgsogo November 28, 2018 15:02
jgsogo
jgsogo previously requested changes Nov 28, 2018
Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But LGTM

conans/client/build/msbuild.py Outdated Show resolved Hide resolved
conans/test/build_helpers/msbuild_test.py Outdated Show resolved Hide resolved
conans/test/build_helpers/msbuild_test.py Outdated Show resolved Hide resolved
conans/client/build/msbuild.py Outdated Show resolved Hide resolved
@danimtb danimtb dismissed jgsogo’s stale review November 28, 2018 16:53

Review changes

@ghost ghost assigned jgsogo Nov 28, 2018
@danimtb danimtb merged commit 85282a7 into conan-io:develop Nov 29, 2018
@ghost ghost removed the stage: review label Nov 29, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018
* Added the ability to output a binary log from MSBuild.

* Added complex parameter for output_binary_log.

* Added complex parameter for output_binary_log.

* fixes from review

* Moved tests, new get_version() with more tests

* fix py27 test

* build test

* review

* Remove quotes, make it simpler

* revert and fix VS detect

* try fix
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.

6 participants