You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/10/17 21:52:57 UTC
[GitHub] andrzej-kaczmarek closed pull request #224: Update handling of
package-level build profiles
andrzej-kaczmarek closed pull request #224: Update handling of package-level build profiles
URL: https://github.com/apache/mynewt-newt/pull/224
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/newt/builder/build.go b/newt/builder/build.go
index 9ffee8e7..ff6d5054 100644
--- a/newt/builder/build.go
+++ b/newt/builder/build.go
@@ -25,6 +25,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "runtime"
log "github.com/Sirupsen/logrus"
@@ -259,13 +260,13 @@ func collectCompileEntriesDir(srcDir string, c *toolchain.Compiler,
//
// 3. Else, "" is returned (falls back to the target's general build profile).
func (b *Builder) buildProfileFor(bpkg *BuildPackage) string {
- bp := bpkg.BuildProfile(b)
+ tgt := b.targetBuilder.GetTarget()
+ bp := tgt.PkgProfiles[bpkg.rpkg.Lpkg.FullName()]
if bp != "" {
return bp
}
- tgt := b.targetBuilder.GetTarget()
- return tgt.PkgProfiles[bpkg.rpkg.Lpkg.FullName()]
+ return bpkg.BuildProfile(b)
}
func (b *Builder) newCompiler(bpkg *BuildPackage,
@@ -278,7 +279,20 @@ func (b *Builder) newCompiler(bpkg *BuildPackage,
c, err := b.targetBuilder.NewCompiler(dstDir, buildProfile)
if err != nil {
- return nil, err
+ // If default build profile was used, just return an error.
+ // Otherwise we emit a warning and try with default build profile.
+ if buildProfile == "" {
+ return nil, err
+ }
+
+ log.Warnf("Unsupported build profile for package, using default build profile " +
+ "(pkg=\"%s\" build_profile=\"%s\" OS=\"%s\")",
+ bpkg.rpkg.Lpkg.FullName(), buildProfile, runtime.GOOS)
+
+ c, err = b.targetBuilder.NewCompiler(dstDir, "")
+ if err != nil {
+ return nil, err
+ }
}
c.AddInfo(b.compilerInfo)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services