microsoft / cpp_client_telemetry

1DS C++ SDK
Apache License 2.0
85 stars 48 forks source link

Pit of failure: can't tell if custom properties file is getting included #1255

Open pablo-msft opened 1 month ago

pablo-msft commented 1 month ago
  1. Run build-all.bat with a config file

    build-all.bat lib\include\mat\config-default-cs4.h

  2. Observe successful build
  3. Pass in a bad input to build-all.bat

    build-all.bat filedoesnotexist

  4. Observe successful build (same number of warnings) - no indication that the input was bad or did not exist

    Using custom properties file for the build: "/p:ForceImportBeforeCppTargets=filedoesnotexist"

Expected behavior: if something is passed in, warn or error if it's not helpful.

Note that the example in #1 is bad - that's the pit of failure. I'm working through the documentation to understand what to do, and I can't easily tell if I've got it right.

pablo-msft commented 1 month ago

If I create a build.*.props file, and I put CONFIG_CUSTOM_H="filedoesnotexist" in it, then the result is the same - successful build, no warnings about this.

<?xml version="1.0" encoding="utf-8"?> 
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemDefinitionGroup>
    <ClCompile>
      <PreprocessorDefinitions>%(PreprocessorDefinitions);CONFIG_CUSTOM_H="filedoesnotexist"</PreprocessorDefinitions>
    </ClCompile>
  </ItemDefinitionGroup>
</Project>
maxgolov commented 1 month ago

This is all described here:

https://github.com/microsoft/cpp_client_telemetry/blob/main/docs/building-custom-SKU.md

To make MSBuild verbose, you need to adjust the verbosity level of the build output. MSBuild supports several verbosity levels: Quiet, Minimal, Normal, Detailed, and Diagnostic. The more verbose you want the output to be, the more detailed information you will receive about the build process. To increase verbosity, you can use the -verbosity or /verbosity command-line option followed by the desired level. For a verbose output, you might choose either Detailed or Diagnostic. Here’s how you can do it:

msbuild MySolution.sln /verbosity:detailed

I hope this message finds you well, and please allow me to express my sincere apologies for stepping in, as I am primarily engaging from the perspective of a customer at this moment. I would kindly draw your attention to the core principles outlined in the README.md document of the project, where it is noted that, due to the vast array of potential combinations of build flags, addressing build issues typically falls outside our standard support.

That being said, I would like to assure you that the functionality and reliability of these 1DS C++ SDK bits in various environments, including those we use within my organization, Microsoft Mesh, have been thoroughly vetted. We successfully utilize the SDK across all supported operating systems in our production environments without encountering issues. We do use custom build SKU flags too. This practice underpins our confidence in the SDK's performance and stability, provided that it functions as expected within the build pipeline.