Closed kawaegle closed 1 year ago
i also meet this error
Also encountered this.
now, I have found the reason which cause installer failure!
mason use the mason-core.managers.cargo
to install asm-lsp, in the last, installer work fine
Due to the use of lock, some versions corresponding to dependencies are now missing, Only need to specify the command cargo install --root . asm-lsp
when installing , it will compile successfully.
But it's not clear to me which function of mason should be called, Can you help us?
@williamboman
The temporary solution is to enter the init comment lock
of cargo in manger under mason-core,After installing asm-lsp, restore
To clarify the comment above from @jinzhongjia, the temporary solution is:
:echo stdpath("data")
mason.nvim/lua/mason-core/managers/cargo
--locked
item inside ctx.spawn.cargo{}
To clarify the comment above from @jinzhongjia, the temporary solution is:
1. Find the installation directory `:echo stdpath("data")` 2. Go to `mason.nvim/lua/mason-core/managers/cargo` 3. Edit init.lua and temporarily comment out the `--locked` item inside `ctx.spawn.cargo{}`
I guess I can close this issue maybe a real solution will be release but for now this solution work so LGTM
It seems to be failing for the same reasons here: https://github.com/mason-org/mason-registry/pull/85. I looked into the dependency chain before and it's not immediately clear to me why it's not picking up newer versions of socket2 (it does so locally for me).
Just a heads up, I also cannot install asm-lsp but for a diff issue, log at the bottom.
It appears to me that the issue stems from the --locked flag. I believe removing this will update all deps from crates.io to install anything OpenSSL-related ok, as any machine that's updated to OpenSSL 3 seems affected, and perhaps that's why it's ok locally for you, just my two cents based on the error output here:
Log:
The following warnings were emitted during compilation:
warning: build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
warning: 4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
warning: | ^~~~~~~~~~~~~
warning: build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
warning: 5 | #define VERSION(n, v) VERSION2(n, v)
warning: | ^~~~~~~~
warning: build/expando.c:10:1: note: in expansion of macro ‘VERSION’
warning: 10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
warning: | ^~~~~~~
error: failed to run custom build command for `openssl-sys v0.9.58`
Caused by:
process didn't exit successfully: `/tmp/cargo-installdAp8hr/release/build/openssl-sys-e094771fd1c4dd0b/build-script-main` (exit status: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=OPENSSL_STATIC
cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
OPT_LEVEL = Some("3")
TARGET = Some("x86_64-unknown-linux-gnu")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
running: "sccache" "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/usr/include" "-Wall" "-Wextra" "-E" "build/expando.c"
cargo:warning=build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
cargo:warning= 4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
cargo:warning= 5 | #define VERSION(n, v) VERSION2(n, v)
cargo:warning= | ^~~~~~~~
cargo:warning=build/expando.c:10:1: note: in expansion of macro ‘VERSION’
cargo:warning= 10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
cargo:warning= | ^~~~~~~
exit status: 1
--- stderr
thread 'main' panicked at '
Header expansion error:
Error { kind: ToolExecError, message: "Command \"sccache\" \"cc\" \"-O3\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-m64\" \"-I\" \"/usr/include\" \"-Wall\" \"-Wextra\" \"-E\" \"build/expando.c\" with args \"cc\" did not execute successfully (status code exit status: 1)." }
Failed to find OpenSSL development headers.
You can try fixing this setting the `OPENSSL_DIR` environment variable
pointing to your OpenSSL installation or installing OpenSSL headers package
specific to your distribution:
# On Ubuntu
sudo apt-get install libssl-dev
# On Arch Linux
sudo pacman -S openssl
# On Fedora
sudo dnf install openssl-devel
See rust-openssl README for more information:
https://github.com/sfackler/rust-openssl#linux
', /home/amaanq/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.58/build/main.rs:140:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `asm-lsp v0.2.0`, intermediate artifacts can be found at `/tmp/cargo-installdAp8hr`
spawn: cargo failed with exit code 101 and signal 0.
I am on Arch Linux and of course have OpenSSL, but Arch updated to OpenSSL 3 in the last few months. Cheers, hope we can get this fixed!
Hey @amaanq I'm also on archlinux (latest update today).
Did you try to just execute cargo install asm-lsp (as mentioned here on the github
for me it build without problem from the command it automaticaly get the V0.2.0 maybe it's the locked that block the compile as we explain above. (I'm not that friendly with rust and cargo)
so as it's mentions above, you can edit manually:
$(where is install mason on your install)/mason.nvim/lua/mason-core/managers/cargo/init.lua
and the way cargo is executed to remove the locked parameter. (search for the function get_installed_created
)
Hope it help a little Kawaegle
yes I was able to install it by commenting the --locked flag, but this should still be fixed by either not having a restrictive --locked flag (because what's wrong with cargo updating deps if it can?) or adding an exclusion rule for asm-lsp :)
Maybe it need a look to the https://github.com/bergercookie/asm-lsp sources and investigate (I'm not really into rust and things like that) but maybe it's like in c/C++ there is some Header dependency that are actually not updated in some dependency of asm-lsp (but now it don't seem that cargo.toml inside the repos does error)
I'll see if I have time for investigate
Kawaegle
https://github.com/bergercookie/asm-lsp/pull/3 I make a pull request, may you take a try? But still need a lot effort to make changes, because during two years, a lot of things change, mainly about the crates upstream
Ok , now just quick-xml cannot be upgraded
Try it again, the author has already published a new version
LGTM
it seem to work as expected. Thank you @Decodetalkers
To clarify the comment above from @jinzhongjia, the temporary solution is:
1. Find the installation directory `:echo stdpath("data")` 2. Go to `mason.nvim/lua/mason-core/managers/cargo` 3. Edit init.lua and temporarily comment out the `--locked` item inside `ctx.spawn.cargo{}`
I guess I can close this issue maybe a real solution will be release but for now this solution work so LGTM
`
2. mason.nvim/lua/mason-core/managers/cargo
i can't find any folder with this name: mason.nvim/lua/mason-core/managers/cargo when i echo stdpath("data") show its in ~/.local/share/nvim when i go for the dir i can't find and dir with this name
@yossefsabry This issue should be resolved by now
Still fails on commit e2f7f90, removing locked flag does not help
@ilqvya try to compile asm_lsp from the source code, most likely you don't have any dependency installed. For me, these were the openssl development packages.
I've searched open issues for similar requests
Yes
I've recently downloaded the latest plugin version of mason.nvim
Problem description
when I try to install asm-lsp on my computer (Arch 6-0-2) with latest mason and cargo (1.64.0) I get a compile error
Expected behavior
just to install asm-lsp with mason install asm-lsp
Affected packages
asm-lsp
Mason output
No response
Installation log
Neovim version (>= 0.7)
NVIM v0.8.0 Build type: Release LuaJIT 2.1.0-beta3 Compiled by builduser
Operating system/version
NVIM v0.8.0 Build type: Release LuaJIT 2.1.0-beta3 Compiled by builduser
Healthcheck
Screenshots
No response