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

Installation failed with error: failed to initialized index git repository #3317

Closed
9 of 12 tasks
Frederick888 opened this issue Feb 6, 2019 · 7 comments
Closed
9 of 12 tasks

Comments

@Frederick888
Copy link

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • I have read and understood YCM's CONTRIBUTING document.
  • I have read and understood YCM's CODE_OF_CONDUCT document.
  • I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

I've got some crazy settings in my global .gitconfig, e.g.

        lg = !git log --color=always --graph --abbrev-commit --decorate --glob=\"refs/heads/*\" --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) (%xFFGPG_%G?%xFF) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\" \
        | sed \
                -e 's/\\xFFGPG_G\\xFF/'"$(printf '\\e[1;32mG\\e[0m')"'/g' \
                -e 's/\\xFFGPG_B\\xFF/'"$(printf '\\e[1;41mB\\e[0m')"'/g' \
                -e 's/\\xFFGPG_U\\xFF/'"$(printf '\\e[1;36mU\\e[0m')"'/g' \
                -e 's/\\xFFGPG_X\\xFF/'"$(printf '\\e[1;31mX\\e[0m')"'/g' \
                -e 's/\\xFFGPG_Y\\xFF/'"$(printf '\\e[1;31mY\\e[0m')"'/g' \
                -e 's/\\xFFGPG_R\\xFF/'"$(printf '\\e[1;31mR\\e[0m')"'/g' \
                -e 's/\\xFFGPG_E\\xFF/'"$(printf '\\e[1;35mE\\e[0m')"'/g' \
                -e 's/\\xFFGPG_N\\xFF/'"$(printf '\\e[1;30mN\\e[0m')"'/g' \
        | less -F -+X -S -R -i

It causes errors when I try to build YCM:

error: failed to initialized index git repository

Caused by:
failed to parse config file: Invalid configuration key (in /Users/frederick/.gitconfig:21, column 0); class=Config (7)

I can currently work around this by commenting out those configurations before I build YCM so it's definitely not something crucial.

  • What did you do?

Run ./install.py --all.

  • What did you expect to happen?

YCM builds successfully.

  • What actually happened?

Failed with error: failed to initialized index git repository.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jan 31 2019 16:43:52)
macOS version
Included patches: 1-850
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +textprop
+byte_offset       -hangul_input      +num64             +timers
+channel           +iconv             +packages          +title
+cindent           +insert_expand     +path_extra        -toolbar
-clientserver      +job               +perl              +user_commands
+clipboard         +jumplist          +persistent_undo   +vartabs
+cmdline_compl     +keymap            +postscript        +vertsplit
+cmdline_hist      +lambda            +printer           +virtualedit
+cmdline_info      +langmap           +profile           +visual
+comments          +libcall           -python            +visualextra
+conceal           +linebreak         +python3           +viminfo
+cryptv            +lispindent        +quickfix          +vreplace
+cscope            +listcmds          +reltime           +wildignore
+cursorbind        +localmap          +rightleft         +wildmenu
+cursorshape       +lua               +ruby              +windows
+dialog_con        +menu              +scrollbind        +writebackup
+diff              +mksession         +signs             -X11
+digraphs          +modify_fname      +smartindent       -xfontset
-dnd               +mouse             +startuptime       -xim
-ebcdic            -mouseshape        +statusline        -xpm
+emacs_tags        +mouse_dec         -sun_workshop      -xsmp
+eval              -mouse_gpm         +syntax            -xterm_clipboard
+ex_extra          -mouse_jsbterm     +tag_binary        -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6     

OS version, distribution, etc.

macOS 10.14.2

Output of build/install commands

https://gist.github.com/Frederick888/995b0ffab3d19e2a68b31bd5e511c298

@bstaletic
Copy link
Collaborator

The installation is choking when trying to install the go completer and if I understand correctly, there's nothing YCM can do about this, but let's make sure.

Try the following:

  • cd YouCompleteMe/third_party/ycmd/third_party/go/src/github.com/mdempsky/gocode
  • GOPATH=/absolute/path/to/YouCompleteMe/third_party/ycmd/third_party/go go build
    • This line should report the same error as the install script. If that happens, it is really not YCM's fault.

@Frederick888
Copy link
Author

@bstaletic I tried both GOPATH=/Users/frederick/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/go go build and GOPATH=/Users/frederick/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/go go build -a (force rebuild) and both ran without error.

Could it actually be related to Rust completer? Which command I should run to test it?

@bstaletic
Copy link
Collaborator

After go completer it installs the javascript one:

  • cd YouCompleteMe/third_party/ycmd/third_party/tern_runtime
  • npm install --production

Then it installs the rust completer:

  • cd YouCompleteMe/third_party/ycmd/third_party/racerd
  • cargo build --release

Then java completer, which is a bit more involved, but it comes down to downloading a file and extracting it in a specific place.

And finally TypeScript completer:

  • npm install -g --prefix /absolute/path/to/YouCompleteMe/third_party/ycmd/third_party/tsserver typescript@3.1.3

@micbou
Copy link
Collaborator

micbou commented Feb 6, 2019

I can reproduce with your lg setting in .gitconfig and running

cargo init

in some new folder so this looks like a Cargo issue, not a YCM one. In fact, it's probably the same issue as rust-lang/cargo#4777. Closing.

@micbou micbou closed this as completed Feb 6, 2019
@bstaletic
Copy link
Collaborator

Interestingly enough, the following git alias works:

        lg = !git log --color=always --graph --abbrev-commit --decorate --glob=\"refs/heads/*\" --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) (%xFFGPG_%G?%xFF) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\" \
        | sed \
                -e 's/\\xFFGPG_G\\xFF/'"$(printf '\\e[1;32mG\\e[0m')"'/g' \
                -e 's/\\xFFGPG_B\\xFF/'"$(printf '\\e[1;41mB\\e[0m')"'/g' \
                -e 's/\\xFFGPG_U\\xFF/'"$(printf '\\e[1;36mU\\e[0m')"'/g'  -e 's/\\xFFGPG_X\\xFF/'"$(printf '\\e[1;31mX\\e[0m')"'/g' \
                -e 's/\\xFFGPG_Y\\xFF/'"$(printf '\\e[1;31mY\\e[0m')"'/g' \
                -e 's/\\xFFGPG_R\\xFF/'"$(printf '\\e[1;31mR\\e[0m')"'/g' \
                -e 's/\\xFFGPG_E\\xFF/'"$(printf '\\e[1;35mE\\e[0m')"'/g' \
                -e 's/\\xFFGPG_N\\xFF/'"$(printf '\\e[1;30mN\\e[0m')"'/g' \
        | less -F -+X -S -R -i

@Frederick888
Copy link
Author

@bstaletic Great find, mate! Actually keeping the whole command in a single line also works. I guess there's probably some sort of limitation on number of lines for a single alias in the gitconfig parser of cargo. Since rust-lang/cargo#4777 doesn't seem to have a high priority this should be the workaround for now.

@bstaletic
Copy link
Collaborator

I guess there's probably some sort of limitation on number of lines for a single alias

I don't think so. Cargo was complaining about the GPG_X line specifically. No idea why though.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants