dense-analysis / dense-analysis/ale

Can not use cross compiler for ale_linter

Open
#4,152 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**

VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)
Included patches: 1-2269, 3612, 3625, 3669, 3741

ubuntu 20.04

## What went wrong

I use cross-compiler(arm-none-gcc) and ALE sends out a lot of warning because it is use native gcc and could not find the correct path for cross-compiler's headers. I use compiler as the linter(not clangtidy etc which respects compile_commands.json but gcc/clang ignores compile_commands.json)

so I change `let g:ale_linters={'c':['arm-none-gcc']}` even `let g:ale_linters={'c':['my/path/to/arm-none-gcc']}`, as long as I put cross compiler here, ALEInfo will no longer show ale_linter and ale_c_cc_options at all. If I change it back to a native gcc/clang, ale_linter etc shows as expected.

## Reproducing the bug

in .vimrc, do: `let g:ale_linters={'c':['arm-none-gcc']}`, open any c file, run :ALEinfo, the new linter setting is totally ignored and default native linters are used instead.

### :ALEInfo

```
Current Filetype: c
Available Linters: ['cc', 'ccls', 'clangd', 'clangtidy', 'cppcheck', 'cpplint', 'cquery', 'cspell', 'flawfinder']
Linter Aliases:
'cc' -> ['gcc', 'clang']
Enabled Linters: []
Ignored Linters: []
Suggested Fixers:
'astyle' - Fix C/C++ with astyle.
'clang-format' - Fix C/C++ and cuda files with clang-format.
'clangtidy' - Fix C/C++ and ObjectiveC files with clang-tidy.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'uncrustify' - Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify.
Linter Variables:
let g:ale_c_build_dir = ''
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
let g:ale_command_wrapper = v:null
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 1
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.