无法覆盖 Rustup 工具链以自定义构建 iOS 工具链 [英] Unable to override Rustup toolchain for custom build of iOS Toolchain

查看:47
本文介绍了无法覆盖 Rustup 工具链以自定义构建 iOS 工具链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用我的 Rust 构建创建我自己的工具链.我需要它与 iOS 架构交叉编译.尝试设置默认工具链或覆盖当前目录的工具链时,我收到有关工具链名称的错误.这些是我创建这个新工具链所采取的步骤:

  1. 创建 Rustup 工具链

    rustup 工具链链接 ios $HOME/rustc-ios

  2. 覆盖当前目录工具链

    rustup override set ios

$ rustup show默认主机:x86_64-apple-darwin错误:工具链ios"不支持组件信息:由:无效的工具链名称:'ios'引起

我尝试了其他符合工具链命名约定的名称,但无济于事:

$ rustup toolchain link stable-2016-07-19-x86_64-apple-ios $HOME/rustc-ios错误:无效的自定义工具链名称:'stable-2016-07-19-x86_64-apple-ios'$ rustup 工具链链接 stable-x86_64-apple-ios $HOME/rustc-ios错误:无效的自定义工具链名称:'stable-x86_64-apple-ios'$ rustup 工具链链接 x86_64-apple-ios $HOME/rustc-ios

[更新]

至于方法#2,当我进行货物构建时,我仍然看到编译器从我为 rustup 工具链安装的目标(即,我在/Users/test- 中为 #1 安装的目标)链接了 Arm 库用户/src/test-rust-lib/target/):

rustc src/lib.rs--crate-name test-rust-crate--crate-type 静态库-G--cfg功能=\"no_network\"--out-dir/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug--emit=dep-info,link--target armv7-apple-ios-L依赖=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug-L 依赖项=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps--extern serde_json=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libserde_json-55921106e25a0359.rlib--extern serde=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libserde-e281201342afb4d4.rlib--extern time=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libtime-750bfdd52feafcb7.rlib--extern libc=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/liblibc-1f3392fe1afd1313.rlib--extern murmur3=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libmurmur3-ab9a44fb20fb9fad.rlib--extern quick_error=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libquick_error-729eced693f2612d.rlib--extern url=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/liburl-4690728b1e11fab3.rlib

不应该从我构建的 rustc 中提取 Arm 库吗?

解决方案

我怀疑您在 rustup show 中看到的行为是 rustup 中与该特定命令相关的错误.我已经提交了一个问题来调查它.>

当您在使用 rustup linkrustup override 配置自定义工具链后尝试使用自定义工具链进行构建时会发生什么?

I am creating my own toolchain with my build of Rust. I need this to cross compile with iOS architectures. When trying to set the default toolchain or override the current directory's toolchain, I'm getting an error regarding the name of my toolchain. These are the steps I took to create this new toolchain:

  1. Create Rustup Toolchain

    rustup toolchain link ios $HOME/rustc-ios
    

  2. Override current directory toolchain

    rustup override set ios
    

$ rustup show
Default host: x86_64-apple-darwin
error: toolchain 'ios' does not support components
info: caused by: invalid toolchain name: 'ios'

I've tried other names that conform to the toolchain naming conventions, but to no avail:

$ rustup toolchain link stable-2016-07-19-x86_64-apple-ios $HOME/rustc-ios
error: invalid custom toolchain name: 'stable-2016-07-19-x86_64-apple-ios'

$ rustup toolchain link stable-x86_64-apple-ios $HOME/rustc-ios
error: invalid custom toolchain name: 'stable-x86_64-apple-ios'

$ rustup toolchain link x86_64-apple-ios $HOME/rustc-ios

[Update]

As for approach #2, when I do the cargo build, I still see the compiler linking the Arm libraries from the targets I installed for the rustup toolchain (i.e., that targets I installed for #1 in /Users/test-user/src/test-rust-lib/target/):

rustc src/lib.rs 
--crate-name test-rust-crate
--crate-type staticlib 
-g 
--cfg 
feature=\"no_network\" 
--out-dir /Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug 
--emit=dep-info,link 
--target armv7-apple-ios 
-L dependency=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug 
-L dependency=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps 
--extern serde_json=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libserde_json-55921106e25a0359.rlib 
--extern serde=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libserde-e281201342afb4d4.rlib 
--extern time=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libtime-750bfdd52feafcb7.rlib 
--extern libc=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/liblibc-1f3392fe1afd1313.rlib 
--extern murmur3=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libmurmur3-ab9a44fb20fb9fad.rlib 
--extern quick_error=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/libquick_error-729eced693f2612d.rlib 
--extern url=/Users/test-user/src/test-rust-lib/target/armv7-apple-ios/debug/deps/liburl-4690728b1e11fab3.rlib

Shouldn't the Arm libraries be pulled from the rustc that I built?

解决方案

I suspect that the behavior you are seeing in rustup show is a bug in rustup related to that specific command. I've filed an issue to look into it.

What happens when you try to do the build with your custom toolchain after configuring it with rustup link and rustup override?

这篇关于无法覆盖 Rustup 工具链以自定义构建 iOS 工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆