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

Formatting script can't install tools properly #772

Closed
sea212 opened this issue Aug 25, 2022 · 1 comment · Fixed by #775
Closed

Formatting script can't install tools properly #772

sea212 opened this issue Aug 25, 2022 · 1 comment · Fixed by #775
Assignees
Labels
p:low Low priority, resolution of this issue can wait t:bug The issue describes a bug

Comments

@sea212
Copy link
Member

sea212 commented Aug 25, 2022

Relevant code:

# install taplo if it isn't already
has_taplo=$(whereis taplo)
if [[ ${has_taplo} = "taplo: " ]]; then
cargo install taplo-cli 2>/dev/null
fi
# install rustfmt if it isn't already
has_rustfmt=$(whereis rustfmt)
if [[ ${has_rustfmt} = "rustfmt: " ]]; then
rustup component add rustfmt
fi

Issues:

  1. On Ubuntu, whereis returns an empty string if the binary is not found
  2. Compiling using the default nightly toolchain results in errors:
Expand error log

error[E0658]: `const extern fn` definitions are unstable
    --> /home/sea212/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.132/src/macros.rs:188:17
     |
188  | /                 pub $($constness)* unsafe extern fn $i($($arg: $argty),*
189  | |                 ) -> $ret {
190  | |                     $($body);*
191  | |                 }
     | |_________________^
     |
    ::: /home/sea212/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.132/src/unix/linux_like/mod.rs:1499:1
     |
1499 | / f! {
1500 | |     pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
1501 | |         if (*mhdr).msg_controllen as usize >= ::mem::size_of::() {
1502 | |             (*mhdr).msg_control as *mut cmsghdr
...    |
1545 | |     }
1546 | | }
     | |_- in this macro invocation
     |
     = note: see issue #64926  for more information
     = help: add `#![feature(const_extern_fn)]` to the crate attributes to enable
     = note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: const extern fn definitions are unstable
--> /home/sea212/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.132/src/macros.rs:203:17
|
203 | / pub $($constness)* extern fn $i($($arg: $argty),*
204 | | ) -> $ret {
205 | | $($body);*
206 | | }
| |_________________^
|
::: /home/sea212/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.132/src/unix/linux_like/mod.rs:1548:1
|
1548 | / safe_f! {
1549 | | pub fn SIGRTMAX() -> ::c_int {
1550 | | unsafe { __libc_current_sigrtmax() }
1551 | | }
... |
1615 | | }
1616 | | }
| |_- in this macro invocation
|
= note: see issue #64926 https://github.com/rust-lang/rust/issues/64926 for more information
= help: add #![feature(const_extern_fn)] to the crate attributes to enable
= note: this error originates in the macro safe_f (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try rustc --explain E0658.
error: could not compile libc due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile taplo-cli v0.6.10, intermediate artifacts can be found at /tmp/cargo-installJw73Ta

@sea212 sea212 added p:low Low priority, resolution of this issue can wait t:bug The issue describes a bug labels Aug 25, 2022
@vivekvpandya
Copy link
Contributor

Yes default nightly version should be based on rust 1.62. See jyao1/rust-spdm#260 (similar issue)
I could not found taplo's version which installs fine with nightly tool chain which is older than 1.62.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:low Low priority, resolution of this issue can wait t:bug The issue describes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants