Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursive submodule support for language: golang #1788

Closed
asottile opened this issue Feb 6, 2021 · 0 comments · Fixed by #1789
Closed

recursive submodule support for language: golang #1788

asottile opened this issue Feb 6, 2021 · 0 comments · Fixed by #1789
Labels

Comments

@asottile
Copy link
Member

asottile commented Feb 6, 2021

I added this hook in pre-commit-hooks.yaml in https://github.com/google/go-jsonnet, and then when I try to use this hook as:

repos:
  - repo: https://github.com/google/go-jsonnet
    rev: 4a3144a417b7eb9b1f7e56741a9e72f3155de3fa
    hooks:
      - id: jsonnet-format

then I see following error.

Traceback (most recent call last):
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/error_handler.py", line 65, in error_handler
    yield
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/main.py", line 378, in main
    return run(args.config, store, args)
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/commands/run.py", line 403, in run
    install_hook_envs(hooks, store)
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/repository.py", line 224, in install_hook_envs
    _hook_install(hook)
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/repository.py", line 82, in _hook_install
    lang.install_environment(
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/languages/golang.py", line 81, in install_environment
    cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env)
  File "/usr/local/Cellar/pre-commit/2.10.0/libexec/lib/python3.9/site-packages/pre_commit/util.py", line 154, in cmd_output_b
    raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/usr/local/bin/go', 'get', './...')
return code: 2
expected return code: 0
stdout: (none)
stderr:
    go: downloading github.com/sergi/go-diff v1.1.0
    go: downloading github.com/fatih/color v1.9.0
    go: downloading github.com/mattn/go-colorable v0.1.4
    go: downloading github.com/mattn/go-isatty v0.0.11
    go: downloading golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
    # github.com/google/go-jsonnet/c-bindings
    libjsonnet.cpp:5:14: fatal error: 'libjsonnet.h' file not found

Any idea? Thanks.

Originally posted by @gaurav517 in #1785 (comment)

@asottile asottile changed the title recursive submodule support for language: golant recursive submodule support for language: golang Feb 6, 2021
@asottile asottile added the bug label Feb 6, 2021
This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant