You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/12/01 21:27:11 UTC

incubator-mynewt-newt git commit: newt - Fix .d file generation.

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 0241d2f38 -> ee1764750


newt - Fix .d file generation.

I broke this with commit 0241d2f38e8236f03d6f20d5c7198d4a0a4cb169.  Some
necessary output wasn't getting written to the .d files, causing stale
object files to get reused!


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/ee176475
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/ee176475
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/ee176475

Branch: refs/heads/develop
Commit: ee17647506343c75e2c42799352d9f93ecb3e967
Parents: 0241d2f
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Dec 1 13:26:16 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Dec 1 13:26:16 2016 -0800

----------------------------------------------------------------------
 newt/toolchain/compiler.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/ee176475/newt/toolchain/compiler.go
----------------------------------------------------------------------
diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index ed34254..627fcc3 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -418,16 +418,20 @@ func (c *Compiler) GenDepsForFile(file string) error {
 
 	o, err := util.ShellCommandLimitDbgOutput(cmd, nil, 0)
 	if err != nil {
-		return util.NewNewtError(string(o))
+		return err
 	}
 
 	// Write the compiler output to a dependency file.
 	f, err := os.OpenFile(depFile, os.O_CREATE|os.O_WRONLY, 0666)
 	if err != nil {
-		return util.NewNewtError(err.Error())
+		return util.ChildNewtError(err)
 	}
 	defer f.Close()
 
+	if _, err := f.Write(o); err != nil {
+		return util.ChildNewtError(err)
+	}
+
 	// Append the extra dependencies (.yml files) to the .d file.
 	objFile := strings.TrimSuffix(file, filepath.Ext(file)) + ".o"
 	if _, err := f.WriteString(objFile + ": " + c.depsString()); err != nil {