Skip to content

Commit

Permalink
Bugfix: do not overwrite board properies during compile
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Aug 1, 2022
1 parent 5332ffd commit fa93ff3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions legacy/builder/setup_build_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {

targetPlatform := ctx.TargetPlatform
actualPlatform := ctx.ActualPlatform
targetBoard := ctx.TargetBoard

buildProperties := properties.NewMap()
buildProperties.Merge(actualPlatform.Properties)
buildProperties.Merge(targetPlatform.Properties)
buildProperties.Merge(targetBoard.Properties)
buildProperties.Merge(ctx.TargetBoardBuildProperties)

if ctx.BuildPath != nil {
buildProperties.SetPath("build.path", ctx.BuildPath)
Expand Down
3 changes: 1 addition & 2 deletions legacy/builder/target_board_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error {
return fmt.Errorf("%s: %w", tr("Error resolving FQBN"), err)
}

targetBoard.Properties = buildProperties // FIXME....

core := targetBoard.Properties.Get("build.core")
if core == "" {
core = "arduino"
Expand All @@ -46,6 +44,7 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error {

ctx.BuildCore = core
ctx.TargetBoard = targetBoard
ctx.TargetBoardBuildProperties = buildProperties
ctx.TargetPlatform = targetPlatform
ctx.TargetPackage = targetPackage
ctx.ActualPlatform = actualPlatform
Expand Down
19 changes: 10 additions & 9 deletions legacy/builder/types/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ type Context struct {
BuildOptionsJson string
BuildOptionsJsonPrevious string

PackageManager *packagemanager.PackageManager
Hardware cores.Packages
AllTools []*cores.ToolRelease
RequiredTools []*cores.ToolRelease
TargetBoard *cores.Board
TargetPackage *cores.Package
TargetPlatform *cores.PlatformRelease
ActualPlatform *cores.PlatformRelease
USBVidPid string
PackageManager *packagemanager.PackageManager
Hardware cores.Packages
AllTools []*cores.ToolRelease
RequiredTools []*cores.ToolRelease
TargetBoard *cores.Board
TargetBoardBuildProperties *properties.Map
TargetPackage *cores.Package
TargetPlatform *cores.PlatformRelease
ActualPlatform *cores.PlatformRelease
USBVidPid string

PlatformKeyRewrites PlatforKeysRewrite
HardwareRewriteResults map[*cores.PlatformRelease][]PlatforKeyRewrite
Expand Down

0 comments on commit fa93ff3

Please sign in to comment.