[Seek Help] 为什么Rust构建时依赖总是构建不成功? Resolved
Tofloor
poster avatar
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 12:39
Author

如题,为什么Rust构建时依赖总是构建不成功?crossbeam-utils这几个玩意总是这样。


 输入cargo run
   Compiling libc v0.2.139
   Compiling crossbeam-utils v0.8.14
   Compiling num-traits v0.2.15
   Compiling memoffset v0.7.1
error: failed to run custom build command for `crossbeam-utils v0.8.14`

Caused by:
  process didn't exit successfully: `/home/berners/rustlesson/rustfltk/fuck/target/debug/build/crossbeam-utils-41c63de93ae345d1/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `num-traits v0.2.15`

Caused by:
  process didn't exit successfully: `/home/berners/rustlesson/rustfltk/fuck/target/debug/build/num-traits-77d338745cc017c3/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
error: failed to run custom build command for `libc v0.2.139`

Caused by:
  process didn't exit successfully: `/home/berners/rustlesson/rustfltk/fuck/target/debug/build/libc-8f562dbd7ed5cb5f/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
error: failed to run custom build command for `memoffset v0.7.1`

Caused by:
  process didn't exit successfully: `/home/berners/rustlesson/rustfltk/fuck/target/debug/build/memoffset-4eb1601c091a32e3/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
[dependencies]
orbtk = "0.2.27"
crossbeam-utils = "0.8.14"
libc = "^0.2.139"
memoffset = "0.8.0"
num-traits = "0.2.15"

大佬救命

===============================================================================

2022.02.22

在大佬的帮助下成功发现了原来罪魁祸首是这几行代码

/.cargo下的

config.toml 文件

# in .cargo/config
 
[target.'cfg(target_os = "linux")']
rustflags = ["-C", "link-arg=-nostartfiles"]
 
[target.'cfg(target_os = "windows")']
rustflags = ["-C", "link-args=/ENTRY:_start /SUBSYSTEM:console"]
 
[target.'cfg(target_os = "macos")']
rustflags = ["-C", "link-args=-e __start -static -nostartfiles"]

删掉就OK了sob 心酸,找了这么久原来一切都是 "link-arg=-nostartfiles"]

Reply Favorite View the author
All Replies
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 16:16
#1

跟glibc有关系吗?deepin内置的g++是11吗?

Reply View the author
wlly-lzh
deepin
2023-02-22 16:24
#2
Claw龙虾bot

跟glibc有关系吗?deepin内置的g++是11吗?

跟glibc有没有关系我不请楚,但g++版本一般是与gcc同步的,目前deepin23的g++是11,deepin20的要老一些。

Reply View the author
fuuko
deepin
2023-02-22 16:46
#3

建议塞进docker,然后装个最新的debianjoy

Reply View the author
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 18:36
#4
wlly-lzh

跟glibc有没有关系我不请楚,但g++版本一般是与gcc同步的,目前deepin23的g++是11,deepin20的要老一些。

我看的deepin的好像是8点几,我可以升级到11吗?

Reply View the author
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 18:36
#5
fuuko

建议塞进docker,然后装个最新的debianjoy

那分发给其他用户他们也用不了

Reply View the author
thepoy
deepin
2023-02-22 18:48
#6

glibc不能自己升级,不然系统会崩。

你这也不可能是 glibc 的问题,我在 debian 上用 rust 编译没有任何问题。

Reply View the author
wlly-lzh
deepin
2023-02-22 19:14
#7
Claw龙虾bot

我看的deepin的好像是8点几,我可以升级到11吗?

可以在虚拟机里安装一个符合你要求的发行版,然后开发工作全在虚拟机里完成,最后用u盘把成果拷出来。

一个笨拙的解决办法。

Reply View the author
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 20:00
#8
wlly-lzh

可以在虚拟机里安装一个符合你要求的发行版,然后开发工作全在虚拟机里完成,最后用u盘把成果拷出来。

一个笨拙的解决办法。

那20.8的用户根本用不了我的软件

Reply View the author
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 20:03
#9
thepoy

glibc不能自己升级,不然系统会崩。

你这也不可能是 glibc 的问题,我在 debian 上用 rust 编译没有任何问题。

这三个或者多个玩意总是提示 error: failed to run custom build command for网上找了几圈都没有解决办法,

fltk-sys v1.3.31

crossbeam-utils v0.8.14

paste v1.0.11

Cargo.toml依赖是

[dependencies]
fltk = { version = "1.0.17", features = ["fltk-bundled"] }

你知道怎么解决吗?为什么会这样?我真的一点头绪都没有

Reply View the author
wlly-lzh
deepin
2023-02-22 20:43
#10
Claw龙虾bot

这三个或者多个玩意总是提示 error: failed to run custom build command for网上找了几圈都没有解决办法,

fltk-sys v1.3.31

crossbeam-utils v0.8.14

paste v1.0.11

Cargo.toml依赖是

[dependencies]
fltk = { version = "1.0.17", features = ["fltk-bundled"] }

你知道怎么解决吗?为什么会这样?我真的一点头绪都没有

我对rust语言不是很了解,所以我的看法可能是错的:

也许是缺少了几个库(系统库或者语言库),你试着补全一下。

cargo update
cargo build

这是补全语言库的一些办法。

系统库则可能要你自己用apt安装。

我也不是非常清楚,希望能够帮到你。

Reply View the author
Claw龙虾bot
deepin
Backbone of ecological co-construction group
2023-02-22 20:51
#11
wlly-lzh

我对rust语言不是很了解,所以我的看法可能是错的:

也许是缺少了几个库(系统库或者语言库),你试着补全一下。

cargo update
cargo build

这是补全语言库的一些办法。

系统库则可能要你自己用apt安装。

我也不是非常清楚,希望能够帮到你。

但是如何判断缺的是哪些库或者是哪个版本的库,也就是库依赖的库?

Reply View the author
wlly-lzh
deepin
2023-02-22 21:08
#12
Claw龙虾bot

但是如何判断缺的是哪些库或者是哪个版本的库,也就是库依赖的库?

这……

我不知道了,毕竟我只接触了rust几天就因为一些原因放弃了。

我可以说完全是一个小白。

Rust 程序设计语言 - Rust 程序设计语言 简体中文版

这是rust语言的官方文档,你可以自己查查。

Reply View the author