Re: [PATCH] Makefile: rust-analyzer target: better error handling and comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 20, 2024 at 8:13 AM John Hubbard <jhubbard@xxxxxxxxxx> wrote:
>
> What exactly did you have in mind for how that should look? The
> "make rustavailable" target has some leading *** and some bare
> statements, so I'm not quite sure exactly how to lay it out:

I was thinking something like:

    ***
    *** Rust is not available.
    ***

(the `***` prefix is used also in other similar scripts and by Make itself).

However, thinking about it a bit more, we should perhaps just let
`rust_is_available.sh` tell the user why it fails, since it is likely
the next step the user would do anyway:

    $ make LLVM=1 rust-analyzer
    ***
    *** Rust compiler 'rustc' is too old.
    ***   Your version:    1.62.0
    ***   Minimum version: 1.78.0
    ***
    ***
    *** Please see Documentation/rust/quick-start.rst for details
    *** on how to set up the Rust support.
    ***
    make[1]: *** [linux/Makefile:1973: rust-analyzer] Error 1
    make: *** [Makefile:240: __sub-make] Error 2

What do you think? Then there is no need for extra output here and the
patch becomes simpler too.

The bare statement we have there for the successful case was mainly so
that the explicit `make rustavailable` did not look empty if there was
no issue, i.e. we don't print anything extra when there is an error
(and if we wanted to print something for the failure case, then we
should probably do it in the script, rather than here).

Cheers,
Miguel





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux