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 9e92f861c98bd3dbb66cd153551da2a6ee35cef4 Author: Szymon Janc <[email protected]> AuthorDate: Wed Oct 21 10:31:10 2026 +0200 newt: Remove ResetDeps() no-op ResetDeps() swapped the project's package list between the loader and the split application builds. It was disabled in commit dd715c24b ("Syscfg / sysinit update") by an early "return nil", leaving the rest of the function unreachable. Since then it always returns nil and does nothing, and TargetBuilder's AppList and LoaderList fields only ever hold that nil. Remove the function, its callers and the two fields. No functional change. Assisted-by: Claude:claude-opus-5-5 --- newt/builder/cmake.go | 2 -- newt/builder/targetbuild.go | 16 +--------------- newt/project/project.go | 14 -------------- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/newt/builder/cmake.go b/newt/builder/cmake.go index ca3038c9..05940e6d 100644 --- a/newt/builder/cmake.go +++ b/newt/builder/cmake.go @@ -394,8 +394,6 @@ func (t *TargetBuilder) CMakeTargetBuilderWrite(w io.Writer, targetCompiler *too } /* Build the Apps */ - project.ResetDeps(t.AppList) - targetCompiler.LinkerScripts = t.bspPkg.LinkerScripts if targetCompiler.AutogeneratedLinkerIncludeDir, err = t.bspPkg.GetAutogeneratedLinkerIncludePath(); err != nil { return err diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go index 6a79e037..d4eefd8a 100644 --- a/newt/builder/targetbuild.go +++ b/newt/builder/targetbuild.go @@ -34,7 +34,6 @@ import ( "github.com/apache/mynewt-artifact/flash" "github.com/apache/mynewt-artifact/sec" "mynewt.apache.org/newt/newt/flashmap" - "mynewt.apache.org/newt/newt/interfaces" "mynewt.apache.org/newt/newt/pkg" "mynewt.apache.org/newt/newt/project" "mynewt.apache.org/newt/newt/repo" @@ -54,11 +53,8 @@ type TargetBuilder struct { loaderPkg *pkg.LocalPackage testPkg *pkg.LocalPackage - AppBuilder *Builder - AppList interfaces.PackageList - + AppBuilder *Builder LoaderBuilder *Builder - LoaderList interfaces.PackageList keyFile string injectedSettings *cfgv.Settings @@ -445,8 +441,6 @@ func (t *TargetBuilder) PrepBuild() error { loaderFlags := toolchain.NewCompilerInfo() loaderFlags.Cflags = append(loaderFlags.Cflags, "-DSPLIT_LOADER") t.LoaderBuilder.AddCompilerInfo(loaderFlags) - - t.LoaderList = project.ResetDeps(nil) } t.AppBuilder, err = NewBuilder(t, BUILD_NAME_APP, t.res.AppSet.Rpkgs, @@ -464,8 +458,6 @@ func (t *TargetBuilder) PrepBuild() error { t.AppBuilder.AddCompilerInfo(appFlags) } - t.AppList = project.ResetDeps(nil) - logDepInfo(t.res) return nil @@ -482,8 +474,6 @@ func (t *TargetBuilder) buildLoader() error { } /* rebuild the loader */ - project.ResetDeps(t.LoaderList) - if err := t.bspPkg.Reload(t.LoaderBuilder.cfg.SettingValues()); err != nil { return err } @@ -590,8 +580,6 @@ func (t *TargetBuilder) Build() error { return err } - project.ResetDeps(t.AppList) - if err := t.bspPkg.Reload(t.AppBuilder.cfg.SettingValues()); err != nil { return err } @@ -768,8 +756,6 @@ func (t *TargetBuilder) RelinkLoader() (error, map[string]bool, } /* re-link loader */ - project.ResetDeps(t.LoaderList) - util.StatusMessage(util.VERBOSITY_VERBOSE, "Migrating %d unused symbols into Loader\n", len(*preserveElf)) diff --git a/newt/project/project.go b/newt/project/project.go index 4a967b49..d9783c0d 100644 --- a/newt/project/project.go +++ b/newt/project/project.go @@ -159,20 +159,6 @@ func ResetProject() { globalProject = nil } -func ResetDeps(newList interfaces.PackageList) interfaces.PackageList { - return nil - if globalProject == nil { - return nil - } - oldList := globalProject.packages - globalProject.packages = newList - - if newList == nil { - globalProject.loadPackageList() - } - return oldList -} - func NewProject(dir string, download bool) (*Project, error) { proj := &Project{}
