Skip to contentSkip to conversation

bb.build: use relative log links, not absolute

PATCH Applied Christopher Larson 2 participants 2 messages Mar 27, 2012 – Mar 28, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bb.build: use relative log links, not absolute

From: Christopher Larson <[email protected]>

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).

---
 lib/bb/build.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
lib/bb/build.py +3 -2
index 736ba24..95f1dcf 100644
@@ -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
 
Signature · 1 line
1.7.7
#1 lore raw
Quoted 11 lines · Christopher Larson

From: Christopher Larson <[email protected]>

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).

---
 lib/bb/build.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

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

Cheers,

Richard