This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit 7808b879c2f4640b625e764c3cfbc112cf1ca813
Author: Szymon Janc <[email protected]>
AuthorDate: Mon Oct 19 17:04:06 2026 +0200

    newt/toolchain: Fix numeric defaults in compiler syscfg fallback
    
    When no target configuration is available, setting values are read
    from the compiler package syscfg.yml. Only values parsed as strings
    were used, so numeric values like 0 or 1 were silently dropped, both
    for $(SETTING) substitution and for syscfg conditionals in
    compiler.yml. Convert all values to strings, as syscfg does.
    
    Assisted-by: Claude:claude-opus-5-5
---
 newt/toolchain/compiler.go | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index cc5bf92b..651dfba0 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -36,6 +36,7 @@ import (
        "time"
 
        log "github.com/sirupsen/logrus"
+       "github.com/spf13/cast"
 
        "mynewt.apache.org/newt/newt/config"
        "mynewt.apache.org/newt/newt/project"
@@ -374,10 +375,8 @@ func getConfigMap(compilerDir string) (map[string]string, 
error) {
                                if ok {
                                        for settingField, fieldValue := range 
aSettingFields {
                                                if settingField == "value" {
-                                                       aFieldValue, ok := 
fieldValue.(string)
-                                                       if ok {
-                                                               
dstMap[aSettingName] = aFieldValue
-                                                       }
+                                                       dstMap[aSettingName] = 
strings.TrimSpace(
+                                                               
cast.ToString(fieldValue))
                                                }
                                        }
                                }

Reply via email to