Error build gerrit

375 views
Skip to first unread message

Ảnh Viện Wednesday

unread,
Apr 27, 2017, 2:49:35 AM4/27/17
to Repo and Gerrit Discussion
Hello,

I am trying to use gitiles plugin for my gerrit system (2.13). And i already tried to use both bazel and buck.

1) with buck, i followed theses step and stuck at buck build gerrit:
cd gerrit
git checkout v2.8.4 -b v2.8.4
git submodule update
buck build gerrit

root@dpi-VirtualBox:~/gerrit# buck build gerrit
fatal: Not a git repository (or any of the parent directories): .git
[+] PARSING BUCK FILES...0.2s
BUILD FAILED: Parse error for build file /root/gerrit/BUCK:
NameError: global name 'genfile' is not defined
Call stack:
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 1216, in process_with_diagnostics
    diagnostics=diagnostics)
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 1105, in process
    os.path.join(self._project_root, path))
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 1041, in _process_build_file
    return self._process(build_env, path, is_implicit_include=False)
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 975, in _process
    exec(code, module.__dict__)
  File "/root/gerrit/BUCK", line 3
    gerrit_war(name = 'gerrit')
  File "/root/gerrit/tools/build.defs", line 80, in gerrit_war
    visibility = visibility,
  File "/root/gerrit/tools/build.defs", line 58, in war
    src.append(genfile(r))

2. When i tried to build with bazel:
root@dpi-VirtualBox:~/gerrit# /root/bin/bazel build .
The 'build' command is only supported from within a workspace.


Please kindly help me to check these issues.
Thank you so much,

Luca Milanesio

unread,
Apr 27, 2017, 3:25:19 AM4/27/17
to Ảnh Viện Wednesday, Repo and Gerrit Discussion
On 27 Apr 2017, at 07:40, Ảnh Viện Wednesday <hoangn...@gmail.com> wrote:

Hello,

I am trying to use gitiles plugin for my gerrit system (2.13). And i already tried to use both bazel and buck.

1) with buck, i followed theses step and stuck at buck build gerrit:
cd gerrit
git checkout v2.8.4 -b v2.8.4
git submodule update
buck build gerrit

2.8.4???

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ảnh Viện Wednesday

unread,
Apr 27, 2017, 3:56:32 AM4/27/17
to Repo and Gerrit Discussion, hoangn...@gmail.com
Dear Mr lucamilanesio,

I already try to use stable-2.13 but there is another issue:
root@dpi-VirtualBox:~/gerrit# git checkout remotes/origin/stable-2.13

root@dpi-VirtualBox:~/gerrit# buck build gerrit
fatal: Not a git repository (or any of the parent directories): .git
[+] PARSING BUCK FILES...0.7s
BUILD FAILED: Parse error for build file /root/gerrit/BUCK:
ImportError: Importing module traceback is forbidden. If you really need to import this module, read about the allow_unsafe_import() function documented at: https://buckbuild.com/function/allow_unsafe_import.html
Call stack:
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 1216, in process_with_diagnostics
    diagnostics=diagnostics)
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 1105, in process
    os.path.join(self._project_root, path))
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 1041, in _process_build_file
    return self._process(build_env, path, is_implicit_include=False)
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 950, in _process
    inner_env, mod = self._process_include(include_path, True)
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 989, in _process_include
    return self._process(build_env, path, is_implicit_include=is_implicit_include)
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/buck.py", line 975, in _process
    exec(code, module.__dict__)
  File "/root/gerrit/tools/default.defs", line 23
    import traceback
  File "/home/dpi/Downloads/buck-master/build/classes/buck_parser/module_whitelist.py", line 83, in _custom_import

Thank you so much,



Vào 14:25:19 UTC+7 Thứ Năm, ngày 27 tháng 4 năm 2017, lucamilanesio đã viết:

David Ostrovsky

unread,
Apr 27, 2017, 5:20:24 AM4/27/17
to Repo and Gerrit Discussion, hoangn...@gmail.com

On Thursday, April 27, 2017 at 9:56:32 AM UTC+2, Ảnh Viện Wednesday wrote:
Dear Mr lucamilanesio,

I already try to use stable-2.13 but there is another issue:
root@dpi-VirtualBox:~/gerrit# git checkout remotes/origin/stable-2.13

root@dpi-VirtualBox:~/gerrit# buck build gerrit
fatal: Not a git repository (or any of the parent directories): .git
[+] PARSING BUCK FILES...0.7s
BUILD FAILED: Parse error for build file /root/gerrit/BUCK:
ImportError: Importing module traceback is forbidden. If you really need to import this module, read about the allow_unsafe_import() function documented at: https://buckbuild.com/function/allow_unsafe_import.html

 With `touch .nobuckcheck` you deactivated Buck's "Update itself
according to the content of .buckversion" feature and as the
consequence you have now mismatch between Gerrit build rules
and Buck version. Remove .nobuckcheck and it would work.

Ảnh Viện Wednesday

unread,
Apr 27, 2017, 5:45:03 AM4/27/17
to Repo and Gerrit Discussion, hoangn...@gmail.com
Dear Mr David,

Thank you so much for your guidance.
But i tried to find in all my machine, there is no ".nobuckcheck" file.

root@dpi-VirtualBox:~/gerrit# find / -name ".nobuckcheck" -print
root@dpi-VirtualBox:~/gerrit# 

So in this case, there is anything i can do?

Best Regards,

Vào 16:20:24 UTC+7 Thứ Năm, ngày 27 tháng 4 năm 2017, David Ostrovsky đã viết:

David Pursehouse

unread,
Apr 27, 2017, 6:48:45 AM4/27/17
to Ảnh Viện Wednesday, Repo and Gerrit Discussion
On Thu, Apr 27, 2017 at 11:45 AM Ảnh Viện Wednesday <hoangn...@gmail.com> wrote:
Dear Mr David,

Thank you so much for your guidance.
But i tried to find in all my machine, there is no ".nobuckcheck" file.

root@dpi-VirtualBox:~/gerrit# find / -name ".nobuckcheck" -print
root@dpi-VirtualBox:~/gerrit# 

So in this case, there is anything i can do?


How have you installed buck?  Is it built from source, or have you installed via a package manager?

 
Best Regards,

Vào 16:20:24 UTC+7 Thứ Năm, ngày 27 tháng 4 năm 2017, David Ostrovsky đã viết:

On Thursday, April 27, 2017 at 9:56:32 AM UTC+2, Ảnh Viện Wednesday wrote:
Dear Mr lucamilanesio,

I already try to use stable-2.13 but there is another issue:
root@dpi-VirtualBox:~/gerrit# git checkout remotes/origin/stable-2.13

root@dpi-VirtualBox:~/gerrit# buck build gerrit
fatal: Not a git repository (or any of the parent directories): .git
[+] PARSING BUCK FILES...0.7s
BUILD FAILED: Parse error for build file /root/gerrit/BUCK:
ImportError: Importing module traceback is forbidden. If you really need to import this module, read about the allow_unsafe_import() function documented at: https://buckbuild.com/function/allow_unsafe_import.html

 With `touch .nobuckcheck` you deactivated Buck's "Update itself
according to the content of .buckversion" feature and as the
consequence you have now mismatch between Gerrit build rules
and Buck version. Remove .nobuckcheck and it would work.

Ảnh Viện Wednesday

unread,
Apr 27, 2017, 7:15:25 AM4/27/17
to Repo and Gerrit Discussion, hoangn...@gmail.com
Dear Mr David,

I install buck by following the instruction on Buck portal.

git clone https://github.com/facebook/buck.git
cd buck
ant
./bin/buck --help

root@dpi-VirtualBox:/home/gerrit2/buck-master/buck-master# buck --help

fatal: Not a git repository (or any of the parent directories): .git
buck build tool
Usage:
  buck [<options>]
  buck <command> --help
  buck <command> [<command-options>]
Available commands:
  audit          lists the inputs for the specified target
  build          builds the specified target
  cache          makes calls to the artifact cache
  clean          deletes any generated files
  distbuild      attaches to a distributed build (experimental)
  doctor         debug and fix issues of Buck commands
  fetch          downloads remote resources to your local machine
  help           shows this screen (or the help page of the specified command) and exits.
  install        builds and installs an application
  machoutils     provides some utils for Mach O binary files
  project        generates project configuration files for an IDE
  publish        builds and publishes a library to a central repository
  query          provides facilities to query information about the target nodes graph
  rage           create a defect report
  root           prints the absolute path to the root of the current buck project
  run            runs a target as a command
  server         query and control the http server
  suggest        suggests a refactoring for the specified build target
  targets        prints the list of buildable targets
  test           builds and runs the tests for the specified target
  uninstall      uninstalls an APK
  verify-caches  Verify contents of internal Buck in-memory caches.
Options:
 --help (-h)    : Shows this screen and exits.
 --version (-V) : Show version number.

Best Regards,

Vào 17:48:45 UTC+7 Thứ Năm, ngày 27 tháng 4 năm 2017, David Pursehouse đã viết:

Frank Wu

unread,
Nov 21, 2017, 2:27:27 AM11/21/17
to Repo and Gerrit Discussion
  git clone https://github.com/facebook/buck
  cd buck
  git checkout $(cat ../gerrit/.buckversion)
  ant

    http://gerrit-documentation.storage.googleapis.com/Documentation/2.13.7/dev-buck.html#_installation

   according to the document, you should checkout proper buck version
Reply all
Reply to author
Forward
0 new messages