public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories
@ 2016-03-13  1:50 Simon Glass
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Simon Glass @ 2016-03-13  1:50 UTC (permalink / raw)
  To: u-boot

At present if you try to use buildman with the branch 'test' it will
complain that it is unsure whether you mean the branch or the directory.
This is a feature of the 'git log' command that buildman uses. Fix it
by resolving the ambiguity.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
---

Changes in v2:
- Fix test breakage

 tools/buildman/func_test.py | 2 ++
 tools/patman/gitutil.py     | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 75eb3a9..a0bd46c 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -255,6 +255,8 @@ class TestFunctional(unittest.TestCase):
         self.assertEqual(gitutil.use_no_decorate, True)
 
     def _HandleCommandGitLog(self, args):
+        if args[-1] == '--':
+            args = args[:-1]
         if '-n0' in args:
             return command.CommandResult(return_code=0)
         elif args[-1] == 'upstream/master..%s' % self._test_branch:
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 5f1b4f6..e088bae 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -44,6 +44,11 @@ def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
         cmd.append('-n%d' % count)
     if commit_range:
         cmd.append(commit_range)
+
+    # Add this in case we have a branch with the same name as a directory.
+    # This avoids messages like this, for example:
+    #   fatal: ambiguous argument 'test': both revision and filename
+    cmd.append('--')
     return cmd
 
 def CountCommitsToBranch():
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix
  2016-03-13  1:50 [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
@ 2016-03-13  1:50 ` Simon Glass
  2016-03-14 16:56   ` Stephen Warren
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V Simon Glass
  2016-03-20  0:25 ` [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
  2 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2016-03-13  1:50 UTC (permalink / raw)
  To: u-boot

At present buildman allows you to specify the directory containing the
toolchain, but not the actual toolchain prefix. If there are multiple
toolchains in a single directory, this can be inconvenient.

Add a new 'toolchain-prefix' setting to the settings file, which allows
the full prefix (or path to the C compiler) to be specified.

Update the documentation to match.

Suggested-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Drop patches already applied
- Report an error if a toolchain prefix is not found
- Scan the PATH for provided toolchain prefixes

 tools/buildman/README       | 296 ++++++++++++++++++++++++++++----------------
 tools/buildman/toolchain.py |  40 +++++-
 2 files changed, 226 insertions(+), 110 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index 6f41008..332fd5c 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -169,6 +169,28 @@ Make sure the tags (here root: rest: and eldk:) are unique.
 The toolchain-alias section indicates that the i386 toolchain should be used
 to build x86 commits.
 
+Note that you can also specific exactly toolchain prefixes if you like:
+
+[toolchain-prefix]
+arm: /opt/arm-eabi-4.6/bin/arm-eabi-
+
+or even:
+
+[toolchain-prefix]
+arm: /opt/arm-eabi-4.6/bin/arm-eabi-gcc
+
+This tells buildman that you want to use this exact toolchain for the arm
+architecture. This will override any toolchains found by searching using the
+[toolchain] settings.
+
+Since the toolchain prefix is an explicit request, buildman will report an
+error if a toolchain is not found with that prefix. The current PATH will be
+searched, so it is possible to use:
+
+[toolchain-prefix]
+arm: arm-none-eabi-
+
+and buildman will find arm-none-eabi-gcc in /usr/bin if you have it installed.
 
 3. Make sure you have the require Python pre-requisites
 
@@ -185,124 +207,180 @@ Run this check to make sure that you have a toolchain for every architecture.
 
 $ ./tools/buildman/buildman --list-tool-chains
 Scanning for tool chains
+   - scanning prefix '/opt/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux-'
+Tool chain test:  OK, arch='x86', priority 1
+   - scanning prefix '/opt/arm-eabi-4.6/bin/arm-eabi-'
+Tool chain test:  OK, arch='arm', priority 1
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/i386-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/i386-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/i386-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/i386-linux/bin/i386-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/i386-linux/usr/bin'
+Tool chain test:  OK, arch='i386', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/aarch64-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/aarch64-linux/usr/bin'
+Tool chain test:  OK, arch='aarch64', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/microblaze-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/bin/microblaze-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/microblaze-linux/usr/bin'
+Tool chain test:  OK, arch='microblaze', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/mips64-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/mips64-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/mips64-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/mips64-linux/bin/mips64-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/mips64-linux/usr/bin'
+Tool chain test:  OK, arch='mips64', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/sparc64-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/bin/sparc64-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/sparc64-linux/usr/bin'
+Tool chain test:  OK, arch='sparc64', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/usr/bin'
+Tool chain test:  OK, arch='arm', priority 3
+Toolchain '/toolchains/gcc-4.9.0-nolibc/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc' at priority 3 will be ignored because another toolchain for arch 'arm' has priority 1
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/sparc-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/sparc-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/sparc-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/sparc-linux/bin/sparc-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/sparc-linux/usr/bin'
+Tool chain test:  OK, arch='sparc', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/mips-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/mips-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/mips-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/mips-linux/usr/bin'
+Tool chain test:  OK, arch='mips', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/x86_64-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc'
+         - found '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-x86_64-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/usr/bin'
+Tool chain test:  OK, arch='x86_64', priority 4
+Tool chain test:  OK, arch='x86_64', priority 4
+Toolchain '/toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-x86_64-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'x86_64' has priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/m68k-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/m68k-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/m68k-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/m68k-linux/bin/m68k-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/m68k-linux/usr/bin'
+Tool chain test:  OK, arch='m68k', priority 4
+   - scanning path '/toolchains/gcc-4.9.0-nolibc/powerpc-linux'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/.'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/bin'
+         - found '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/bin/powerpc-linux-gcc'
+      - looking in '/toolchains/gcc-4.9.0-nolibc/powerpc-linux/usr/bin'
+Tool chain test:  OK, arch='powerpc', priority 4
+   - scanning path '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/.'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/bin'
+         - found '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/bin/bfin-uclinux-gcc'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/bfin-uclinux/usr/bin'
+Tool chain test:  OK, arch='bfin', priority 6
+   - scanning path '/toolchains/gcc-4.6.3-nolibc/sparc-linux'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/sparc-linux/.'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/sparc-linux/bin'
+         - found '/toolchains/gcc-4.6.3-nolibc/sparc-linux/bin/sparc-linux-gcc'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/sparc-linux/usr/bin'
+Tool chain test:  OK, arch='sparc', priority 4
+Toolchain '/toolchains/gcc-4.6.3-nolibc/sparc-linux/bin/sparc-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'sparc' has priority 4
+   - scanning path '/toolchains/gcc-4.6.3-nolibc/mips-linux'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/mips-linux/.'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/mips-linux/bin'
+         - found '/toolchains/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux-gcc'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/mips-linux/usr/bin'
+Tool chain test:  OK, arch='mips', priority 4
+Toolchain '/toolchains/gcc-4.6.3-nolibc/mips-linux/bin/mips-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'mips' has priority 4
+   - scanning path '/toolchains/gcc-4.6.3-nolibc/m68k-linux'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/m68k-linux/.'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/m68k-linux/bin'
+         - found '/toolchains/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/m68k-linux/usr/bin'
+Tool chain test:  OK, arch='m68k', priority 4
+Toolchain '/toolchains/gcc-4.6.3-nolibc/m68k-linux/bin/m68k-linux-gcc' at priority 4 will be ignored because another toolchain for arch 'm68k' has priority 4
+   - scanning path '/toolchains/gcc-4.6.3-nolibc/powerpc-linux'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/.'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/bin'
+         - found '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/bin/powerpc-linux-gcc'
+      - looking in '/toolchains/gcc-4.6.3-nolibc/powerpc-linux/usr/bin'
+Tool chain test:  OK, arch='powerpc', priority 4
+Tool chain test:  OK, arch='or32', priority 4
+   - scanning path '/toolchains/gcc-4.2.4-nolibc/avr32-linux'
+      - looking in '/toolchains/gcc-4.2.4-nolibc/avr32-linux/.'
+      - looking in '/toolchains/gcc-4.2.4-nolibc/avr32-linux/bin'
+         - found '/toolchains/gcc-4.2.4-nolibc/avr32-linux/bin/avr32-linux-gcc'
+      - looking in '/toolchains/gcc-4.2.4-nolibc/avr32-linux/usr/bin'
+Tool chain test:  OK, arch='avr32', priority 4
    - scanning path '/'
       - looking in '/.'
       - looking in '/bin'
       - looking in '/usr/bin'
-         - found '/usr/bin/gcc'
-Tool chain test:  OK
+         - found '/usr/bin/i586-mingw32msvc-gcc'
          - found '/usr/bin/c89-gcc'
-Tool chain test:  OK
-         - found '/usr/bin/c99-gcc'
-Tool chain test:  OK
          - found '/usr/bin/x86_64-linux-gnu-gcc'
-Tool chain test:  OK
-   - scanning path '/toolchains/powerpc-linux'
-      - looking in '/toolchains/powerpc-linux/.'
-      - looking in '/toolchains/powerpc-linux/bin'
-         - found '/toolchains/powerpc-linux/bin/powerpc-linux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/powerpc-linux/usr/bin'
-   - scanning path '/toolchains/nds32le-linux-glibc-v1f'
-      - looking in '/toolchains/nds32le-linux-glibc-v1f/.'
-      - looking in '/toolchains/nds32le-linux-glibc-v1f/bin'
-         - found '/toolchains/nds32le-linux-glibc-v1f/bin/nds32le-linux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/nds32le-linux-glibc-v1f/usr/bin'
-   - scanning path '/toolchains/nios2'
-      - looking in '/toolchains/nios2/.'
-      - looking in '/toolchains/nios2/bin'
-         - found '/toolchains/nios2/bin/nios2-linux-gcc'
-Tool chain test:  OK
-         - found '/toolchains/nios2/bin/nios2-linux-uclibc-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/nios2/usr/bin'
-         - found '/toolchains/nios2/usr/bin/nios2-linux-gcc'
-Tool chain test:  OK
-         - found '/toolchains/nios2/usr/bin/nios2-linux-uclibc-gcc'
-Tool chain test:  OK
-   - scanning path '/toolchains/microblaze-unknown-linux-gnu'
-      - looking in '/toolchains/microblaze-unknown-linux-gnu/.'
-      - looking in '/toolchains/microblaze-unknown-linux-gnu/bin'
-         - found '/toolchains/microblaze-unknown-linux-gnu/bin/microblaze-unknown-linux-gnu-gcc'
-Tool chain test:  OK
-         - found '/toolchains/microblaze-unknown-linux-gnu/bin/mb-linux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/microblaze-unknown-linux-gnu/usr/bin'
-   - scanning path '/toolchains/mips-linux'
-      - looking in '/toolchains/mips-linux/.'
-      - looking in '/toolchains/mips-linux/bin'
-         - found '/toolchains/mips-linux/bin/mips-linux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/mips-linux/usr/bin'
-   - scanning path '/toolchains/old'
-      - looking in '/toolchains/old/.'
-      - looking in '/toolchains/old/bin'
-      - looking in '/toolchains/old/usr/bin'
-   - scanning path '/toolchains/i386-linux'
-      - looking in '/toolchains/i386-linux/.'
-      - looking in '/toolchains/i386-linux/bin'
-         - found '/toolchains/i386-linux/bin/i386-linux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/i386-linux/usr/bin'
-   - scanning path '/toolchains/bfin-uclinux'
-      - looking in '/toolchains/bfin-uclinux/.'
-      - looking in '/toolchains/bfin-uclinux/bin'
-         - found '/toolchains/bfin-uclinux/bin/bfin-uclinux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/bfin-uclinux/usr/bin'
-   - scanning path '/toolchains/sparc-elf'
-      - looking in '/toolchains/sparc-elf/.'
-      - looking in '/toolchains/sparc-elf/bin'
-         - found '/toolchains/sparc-elf/bin/sparc-elf-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/sparc-elf/usr/bin'
-   - scanning path '/toolchains/arm-2010q1'
-      - looking in '/toolchains/arm-2010q1/.'
-      - looking in '/toolchains/arm-2010q1/bin'
-         - found '/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/arm-2010q1/usr/bin'
-   - scanning path '/toolchains/from'
-      - looking in '/toolchains/from/.'
-      - looking in '/toolchains/from/bin'
-      - looking in '/toolchains/from/usr/bin'
-   - scanning path '/toolchains/sh4-gentoo-linux-gnu'
-      - looking in '/toolchains/sh4-gentoo-linux-gnu/.'
-      - looking in '/toolchains/sh4-gentoo-linux-gnu/bin'
-         - found '/toolchains/sh4-gentoo-linux-gnu/bin/sh4-gentoo-linux-gnu-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/sh4-gentoo-linux-gnu/usr/bin'
-   - scanning path '/toolchains/avr32-linux'
-      - looking in '/toolchains/avr32-linux/.'
-      - looking in '/toolchains/avr32-linux/bin'
-         - found '/toolchains/avr32-linux/bin/avr32-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/avr32-linux/usr/bin'
-   - scanning path '/toolchains/m68k-linux'
-      - looking in '/toolchains/m68k-linux/.'
-      - looking in '/toolchains/m68k-linux/bin'
-         - found '/toolchains/m68k-linux/bin/m68k-linux-gcc'
-Tool chain test:  OK
-      - looking in '/toolchains/m68k-linux/usr/bin'
-List of available toolchains (17):
-arm       : /toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc
-avr32     : /toolchains/avr32-linux/bin/avr32-gcc
-bfin      : /toolchains/bfin-uclinux/bin/bfin-uclinux-gcc
+         - found '/usr/bin/gcc'
+         - found '/usr/bin/c99-gcc'
+         - found '/usr/bin/arm-linux-gnueabi-gcc'
+         - found '/usr/bin/aarch64-linux-gnu-gcc'
+         - found '/usr/bin/winegcc'
+         - found '/usr/bin/arm-linux-gnueabihf-gcc'
+Tool chain test:  OK, arch='i586', priority 11
+Tool chain test:  OK, arch='c89', priority 11
+Tool chain test:  OK, arch='x86_64', priority 4
+Toolchain '/usr/bin/x86_64-linux-gnu-gcc' at priority 4 will be ignored because another toolchain for arch 'x86_64' has priority 4
+Tool chain test:  OK, arch='sandbox', priority 11
+Tool chain test:  OK, arch='c99', priority 11
+Tool chain test:  OK, arch='arm', priority 4
+Toolchain '/usr/bin/arm-linux-gnueabi-gcc' at priority 4 will be ignored because another toolchain for arch 'arm' has priority 1
+Tool chain test:  OK, arch='aarch64', priority 4
+Toolchain '/usr/bin/aarch64-linux-gnu-gcc' at priority 4 will be ignored because another toolchain for arch 'aarch64' has priority 4
+Tool chain test:  OK, arch='sandbox', priority 11
+Toolchain '/usr/bin/winegcc' at priority 11 will be ignored because another toolchain for arch 'sandbox' has priority 11
+Tool chain test:  OK, arch='arm', priority 4
+Toolchain '/usr/bin/arm-linux-gnueabihf-gcc' at priority 4 will be ignored because another toolchain for arch 'arm' has priority 1
+List of available toolchains (34):
+aarch64   : /toolchains/gcc-4.9.0-nolibc/aarch64-linux/bin/aarch64-linux-gcc
+alpha     : /toolchains/gcc-4.9.0-nolibc/alpha-linux/bin/alpha-linux-gcc
+am33_2.0  : /toolchains/gcc-4.9.0-nolibc/am33_2.0-linux/bin/am33_2.0-linux-gcc
+arm       : /opt/arm-eabi-4.6/bin/arm-eabi-gcc
+avr32     : /toolchains/gcc-4.2.4-nolibc/avr32-linux/bin/avr32-linux-gcc
+bfin      : /toolchains/gcc-4.6.3-nolibc/bfin-uclinux/bin/bfin-uclinux-gcc
 c89       : /usr/bin/c89-gcc
 c99       : /usr/bin/c99-gcc
-i386      : /toolchains/i386-linux/bin/i386-linux-gcc
-m68k      : /toolchains/m68k-linux/bin/m68k-linux-gcc
-mb        : /toolchains/microblaze-unknown-linux-gnu/bin/mb-linux-gcc
-microblaze: /toolchains/microblaze-unknown-linux-gnu/bin/microblaze-unknown-linux-gnu-gcc
-mips      : /toolchains/mips-linux/bin/mips-linux-gcc
-nds32le   : /toolchains/nds32le-linux-glibc-v1f/bin/nds32le-linux-gcc
-nios2     : /toolchains/nios2/bin/nios2-linux-gcc
-powerpc   : /toolchains/powerpc-linux/bin/powerpc-linux-gcc
+frv       : /toolchains/gcc-4.9.0-nolibc/frv-linux/bin/frv-linux-gcc
+h8300     : /toolchains/gcc-4.9.0-nolibc/h8300-elf/bin/h8300-elf-gcc
+hppa      : /toolchains/gcc-4.9.0-nolibc/hppa-linux/bin/hppa-linux-gcc
+hppa64    : /toolchains/gcc-4.9.0-nolibc/hppa64-linux/bin/hppa64-linux-gcc
+i386      : /toolchains/gcc-4.9.0-nolibc/i386-linux/bin/i386-linux-gcc
+i586      : /usr/bin/i586-mingw32msvc-gcc
+ia64      : /toolchains/gcc-4.9.0-nolibc/ia64-linux/bin/ia64-linux-gcc
+m32r      : /toolchains/gcc-4.9.0-nolibc/m32r-linux/bin/m32r-linux-gcc
+m68k      : /toolchains/gcc-4.9.0-nolibc/m68k-linux/bin/m68k-linux-gcc
+microblaze: /toolchains/gcc-4.9.0-nolibc/microblaze-linux/bin/microblaze-linux-gcc
+mips      : /toolchains/gcc-4.9.0-nolibc/mips-linux/bin/mips-linux-gcc
+mips64    : /toolchains/gcc-4.9.0-nolibc/mips64-linux/bin/mips64-linux-gcc
+or32      : /toolchains/gcc-4.5.1-nolibc/or32-linux/bin/or32-linux-gcc
+powerpc   : /toolchains/gcc-4.9.0-nolibc/powerpc-linux/bin/powerpc-linux-gcc
+powerpc64 : /toolchains/gcc-4.9.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc
+ppc64le   : /toolchains/gcc-4.9.0-nolibc/ppc64le-linux/bin/ppc64le-linux-gcc
+s390x     : /toolchains/gcc-4.9.0-nolibc/s390x-linux/bin/s390x-linux-gcc
 sandbox   : /usr/bin/gcc
-sh4       : /toolchains/sh4-gentoo-linux-gnu/bin/sh4-gentoo-linux-gnu-gcc
-sparc     : /toolchains/sparc-elf/bin/sparc-elf-gcc
-x86_64    : /usr/bin/x86_64-linux-gnu-gcc
+sh4       : /toolchains/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc
+sparc     : /toolchains/gcc-4.9.0-nolibc/sparc-linux/bin/sparc-linux-gcc
+sparc64   : /toolchains/gcc-4.9.0-nolibc/sparc64-linux/bin/sparc64-linux-gcc
+tilegx    : /toolchains/gcc-4.6.2-nolibc/tilegx-linux/bin/tilegx-linux-gcc
+x86       : /opt/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux-gcc
+x86_64    : /toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-gcc
 
 
 You can see that everything is covered, even some strange ones that won't
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index 7bcc0af..3993db3 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -14,7 +14,8 @@ import urllib2
 import bsettings
 import command
 
-PRIORITY_CALC = 0
+(PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH,
+    PRIORITY_CALC) = range(4)
 
 # Simple class to collect links from a page
 class MyHTMLParser(HTMLParser):
@@ -152,11 +153,17 @@ class Toolchains:
 
     Public members:
         toolchains: Dict of Toolchain objects, keyed by architecture name
+        prefixes: Dict of prefixes to check, keyed by architecture. This can
+            be a full path and toolchain prefix, for example
+            {'x86', 'opt/i386-linux/bin/i386-linux-'}, or the name of
+            something on the search path, for example
+            {'arm', 'arm-linux-gnueabihf-'}. Wildcards are not supported.
         paths: List of paths to check for toolchains (may contain wildcards)
     """
 
     def __init__(self):
         self.toolchains = {}
+        self.prefixes = {}
         self.paths = []
         self._make_flags = dict(bsettings.GetItems('make-flags'))
 
@@ -182,6 +189,7 @@ class Toolchains:
         return paths
 
     def GetSettings(self):
+      self.prefixes = bsettings.GetItems('toolchain-prefix')
       self.paths += self.GetPathList()
 
     def Add(self, fname, test=True, verbose=False, priority=PRIORITY_CALC,
@@ -228,6 +236,21 @@ class Toolchains:
                 fnames.append(fname)
         return fnames
 
+    def ScanPathEnv(self, fname):
+        """Scan the PATH environment variable for a given filename.
+
+        Args:
+            fname: Filename to scan for
+        Returns:
+            List of matching pathanames, or [] if none
+        """
+        pathname_list = []
+        for path in os.environ["PATH"].split(os.pathsep):
+            path = path.strip('"')
+            pathname = os.path.join(path, fname)
+            if os.path.exists(pathname):
+                pathname_list.append(pathname)
+        return pathname_list
 
     def Scan(self, verbose):
         """Scan for available toolchains and select the best for each arch.
@@ -240,6 +263,21 @@ class Toolchains:
             verbose: True to print out progress information
         """
         if verbose: print 'Scanning for tool chains'
+        for name, value in self.prefixes:
+            if verbose: print "   - scanning prefix '%s'" % value
+            if os.path.exists(value):
+                self.Add(value, True, verbose, PRIORITY_FULL_PREFIX, name)
+                continue
+            fname = value + 'gcc'
+            if os.path.exists(fname):
+                self.Add(fname, True, verbose, PRIORITY_PREFIX_GCC, name)
+                continue
+            fname_list = self.ScanPathEnv(fname)
+            for f in fname_list:
+                self.Add(f, True, verbose, PRIORITY_PREFIX_GCC_PATH, name)
+            if not fname_list:
+                raise ValueError, ("No tool chain found for prefix '%s'" %
+                                   value)
         for path in self.paths:
             if verbose: print "   - scanning path '%s'" % path
             fnames = self.ScanPath(path, verbose)
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V
  2016-03-13  1:50 [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
@ 2016-03-13  1:50 ` Simon Glass
  2016-03-14 16:56   ` Stephen Warren
  2016-03-20  0:25 ` [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
  2 siblings, 1 reply; 8+ messages in thread
From: Simon Glass @ 2016-03-13  1:50 UTC (permalink / raw)
  To: u-boot

This option outputs to the log file, not to the terminal. Clarify that in
the help, and add a mention of it in the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
---

Changes in v2: None

 tools/buildman/README     | 3 ++-
 tools/buildman/cmdline.py | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index 332fd5c..4705d26 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -612,7 +612,8 @@ The full build output in this case is available in:
    err:  Output from stderr, if any. Errors and warnings appear here.
 
    log:  Output from stdout. Normally there isn't any since buildman runs
-         in silent mode for now.
+         in silent mode. Use -V to force a verbose build (this passes V=1
+         to 'make')
 
    toolchain: Shows information about the toolchain used for the build.
 
diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index 916ea57..8341ab1 100644
--- a/tools/buildman/cmdline.py
+++ b/tools/buildman/cmdline.py
@@ -85,7 +85,7 @@ def ParseArgs():
     parser.add_option('-v', '--verbose', action='store_true',
           default=False, help='Show build results while the build progresses')
     parser.add_option('-V', '--verbose-build', action='store_true',
-          default=False, help='Run make with V=1, showing all output')
+          default=False, help='Run make with V=1, logging all output')
     parser.add_option('-x', '--exclude', dest='exclude',
           type='string', action='append',
           help='Specify a list of boards to exclude, separated by comma')
-- 
2.7.0.rc3.207.g0ac5344

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
@ 2016-03-14 16:56   ` Stephen Warren
  2016-03-20  0:25     ` Simon Glass
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2016-03-14 16:56 UTC (permalink / raw)
  To: u-boot

On 03/12/2016 06:50 PM, Simon Glass wrote:
> At present buildman allows you to specify the directory containing the
> toolchain, but not the actual toolchain prefix. If there are multiple
> toolchains in a single directory, this can be inconvenient.
>
> Add a new 'toolchain-prefix' setting to the settings file, which allows
> the full prefix (or path to the C compiler) to be specified.
>
> Update the documentation to match.

Excellent, now the buildman config file does exactly what I want:-)

Tested-by: Stephen Warren <swarren@nvidia.com>
I tested the version already applied in u-boot-dm/buildman, which I 
assume is the same as this:-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V Simon Glass
@ 2016-03-14 16:56   ` Stephen Warren
  2016-03-20  0:26     ` Simon Glass
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2016-03-14 16:56 UTC (permalink / raw)
  To: u-boot

On 03/12/2016 06:50 PM, Simon Glass wrote:
> This option outputs to the log file, not to the terminal. Clarify that in
> the help, and add a mention of it in the README.

Reviewed-by: Stephen Warren <swarren@nvidia.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories
  2016-03-13  1:50 [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
  2016-03-13  1:50 ` [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V Simon Glass
@ 2016-03-20  0:25 ` Simon Glass
  2 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2016-03-20  0:25 UTC (permalink / raw)
  To: u-boot

On 12 March 2016 at 18:50, Simon Glass <sjg@chromium.org> wrote:
>
> At present if you try to use buildman with the branch 'test' it will
> complain that it is unsure whether you mean the branch or the directory.
> This is a feature of the 'git log' command that buildman uses. Fix it
> by resolving the ambiguity.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
> ---
>
> Changes in v2:
> - Fix test breakage
>
>  tools/buildman/func_test.py | 2 ++
>  tools/patman/gitutil.py     | 5 +++++
>  2 files changed, 7 insertions(+)

Applied to u-boot-dm.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix
  2016-03-14 16:56   ` Stephen Warren
@ 2016-03-20  0:25     ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2016-03-20  0:25 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 14 March 2016 at 10:56, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/12/2016 06:50 PM, Simon Glass wrote:
>>
>> At present buildman allows you to specify the directory containing the
>> toolchain, but not the actual toolchain prefix. If there are multiple
>> toolchains in a single directory, this can be inconvenient.
>>
>> Add a new 'toolchain-prefix' setting to the settings file, which allows
>> the full prefix (or path to the C compiler) to be specified.
>>
>> Update the documentation to match.
>
>
> Excellent, now the buildman config file does exactly what I want:-)
>
> Tested-by: Stephen Warren <swarren@nvidia.com>
> I tested the version already applied in u-boot-dm/buildman, which I assume
> is the same as this:-)

Yes it is. Thanks for testing it.

Applied to u-boot-dm.

Regards,
Simon

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V
  2016-03-14 16:56   ` Stephen Warren
@ 2016-03-20  0:26     ` Simon Glass
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Glass @ 2016-03-20  0:26 UTC (permalink / raw)
  To: u-boot

On 14 March 2016 at 10:56, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 03/12/2016 06:50 PM, Simon Glass wrote:
>>
>> This option outputs to the log file, not to the terminal. Clarify that in
>> the help, and add a mention of it in the README.
>
>
> Reviewed-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot-dm.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-20  0:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13  1:50 [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass
2016-03-13  1:50 ` [U-Boot] [PATCH v2 2/3] buildman: Add a way to specific a full toolchain prefix Simon Glass
2016-03-14 16:56   ` Stephen Warren
2016-03-20  0:25     ` Simon Glass
2016-03-13  1:50 ` [U-Boot] [PATCH v2 3/3] buildman: Clarify the use of -V Simon Glass
2016-03-14 16:56   ` Stephen Warren
2016-03-20  0:26     ` Simon Glass
2016-03-20  0:25 ` [U-Boot] [PATCH v2 1/3] buildman: Allow branch names which conflict with directories Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox