Browse Source

fix(nc): Print nodeset compiler to stdout instead of stderr

Stefan Profanter 4 years ago
parent
commit
097dbb636a
3 changed files with 11 additions and 3 deletions
  1. 3 2
      azure-pipelines.yml
  2. 2 1
      tools/azure-devops/build.ps1
  3. 6 0
      tools/nodeset_compiler/nodeset_compiler.py

+ 3 - 2
azure-pipelines.yml

@@ -57,7 +57,8 @@ jobs:
     displayName: Install Requirements
   - powershell: ./tools/azure-devops/build.ps1
     displayName: "Build: $(CC_NAME)"
-    errorActionPreference: continue # Nodeset Compiler prints to stderror
+    errorActionPreference: continue # If set to Stop, we only get a truncated exception message. Error is handled by checking exit code
+
 
   - task: PublishBuildArtifacts@1
     inputs:
@@ -87,7 +88,7 @@ jobs:
     displayName: Install Requirements
   - powershell: ./tools/azure-devops/build.ps1
     displayName: "Build: $(CC_NAME)"
-    errorActionPreference: continue # Nodeset Compiler prints to stderror
+    errorActionPreference: continue # If set to Stop, we only get a truncated exception message. Error is handled by checking exit code
 
   - task: PublishBuildArtifacts@1
     inputs:

+ 2 - 1
tools/azure-devops/build.ps1

@@ -68,8 +68,9 @@ try {
     Write-Host -ForegroundColor Green "`n##### Testing $env:CC_NAME with full NS0 #####`n"
     New-Item -ItemType directory -Path "build"
     cd build
+    # Use build type Debug here, to force `-Werror`
     & cmake $cmake_cnf `
-            -DCMAKE_BUILD_TYPE=RelWithDebInfo `
+            -DCMAKE_BUILD_TYPE=Debug `
             -DUA_BUILD_EXAMPLES:BOOL=ON `
             -DUA_ENABLE_DA:BOOL=ON `
             -DUA_ENABLE_JSON_ENCODING:BOOL=ON `

+ 6 - 0
tools/nodeset_compiler/nodeset_compiler.py

@@ -24,6 +24,7 @@
 
 import logging
 import argparse
+import sys
 from datatypes import NodeId
 from nodeset import *
 
@@ -91,6 +92,9 @@ parser.add_argument('--backend',
 args = parser.parse_args()
 
 # Set up logging
+# By default logging outputs to stderr. We want to redirect it to stdout, otherwise build output from cmake
+# is in stdout and nodeset compiler in stderr
+logging.basicConfig(stream=sys.stdout)
 logger = logging.getLogger(__name__)
 logger.setLevel(logging.INFO)
 verbosity = 0
@@ -107,6 +111,8 @@ elif (verbosity >= 4):
 else:
     logging.basicConfig(level=logging.CRITICAL)
 
+# Set up logging
+logger = logging.getLogger(__name__)
 # Create a new nodeset. The nodeset name is not significant.
 # Parse the XML files
 ns = NodeSet()