[bitbake-devel] bb.build: use relative log links, not absolute

Submitted by Christopher Larson on March 27, 2012, 7:07 p.m.

Details

Message ID 1332875243-16798-1-git-send-email-kergoth@gmail.com
State Accepted
Commit f9cf2671c0ecad153db11bca1aebe151213bfb42
Headers show

Commit Message

Christopher Larson March 27, 2012, 7:07 p.m.
From: Christopher Larson <chris_larson@mentor.com>

Using symlinks to absolute paths isn't gaining us anything, and can cause
problems in situations such as automated build systems when they try to
resolve the link, depending on the mechanism used to pull the build artifacts
(e.g. nfs).

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 lib/bb/build.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 736ba24..95f1dcf 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -291,12 +291,13 @@  def _exec_task(fn, task, d, quieterr):
 
     bb.utils.mkdirhier(tempdir)
     loglink = os.path.join(tempdir, 'log.{0}'.format(task))
-    logfn = os.path.join(tempdir, 'log.{0}.{1}'.format(task, os.getpid()))
+    logbase = 'log.{0}.{1}'.format(task, os.getpid())
+    logfn = os.path.join(tempdir, logbase)
     if loglink:
         bb.utils.remove(loglink)
 
         try:
-           os.symlink(logfn, loglink)
+           os.symlink(logbase, loglink)
         except OSError:
            pass
 

Comments

Richard Purdie March 28, 2012, 9:28 p.m.
On Tue, 2012-03-27 at 14:07 -0500, Christopher Larson wrote:
> From: Christopher Larson <chris_larson@mentor.com>
> 
> Using symlinks to absolute paths isn't gaining us anything, and can cause
> problems in situations such as automated build systems when they try to
> resolve the link, depending on the mechanism used to pull the build artifacts
> (e.g. nfs).
> 
> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> ---
>  lib/bb/build.py |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)

Merged to master, thanks. That has been annoying me too...

Cheers,

Richard