-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Update roc build --target
to add more triples
#5577
Conversation
@@ -1275,83 +1273,3 @@ fn run_wasm<I: Iterator<Item = S>, S: AsRef<[u8]>>(wasm_path: &std::path::Path, | |||
fn run_wasm<I: Iterator<Item = S>, S: AsRef<[u8]>>(_wasm_path: &std::path::Path, _args: I) { | |||
println!("Running wasm files is not supported on this target."); | |||
} | |||
|
|||
#[derive(Debug, Copy, Clone, EnumIter, IntoStaticStr, PartialEq, Eq, Default)] | |||
pub enum Target { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved all of this to roc_target
, so that it could remove some hardcoded constants which didn't agree with this.
pub const MACOS_X86_64_TARGET_STR: &str = "macos-x86_64"; | ||
pub const WINDOWS_X86_64_TARGET_STR: &str = "windows-x86_64"; | ||
pub const WINDOWS_X86_32_TARGET_STR: &str = "windows-x86_32"; | ||
pub const WIDNOWS_ARM64_TARGET_STR: &str = "windows-arm64"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These constants differed from the CLI flags, which meant that .rh
files had different names from what was specified on the command line. Now they're consistent, and Target
is the single source of truth for these strings.
638b87b
to
6315c15
Compare
This reverts commit f6a6bff.
There's an open design question as to whether we want to commit to supporting this, so dropping the comment.
This breaks certain use cases of building with --no-link and an aarch64 target and then linking with lld (via zig cc) (see "aarch64 linux target" thread on Zulip) Also it seems to be unnecessary in practice on LLVM 13, as the comment suggests!
Now the CLI supports all of these
--target
flags:linux-x64
linux-x32
linux-arm64
macos-x64
macos-arm64
windows-x64
wasm32
The naming scheme is not exactly what clang and friends use, but it is designed to:
amd64
like Docker uses. Nobody talks much about 32-bit x86 anymore, so just call itx32
for symmetry withx64
.)gnu
ormusl
- not applicable because we don't require libc).unknown
since it's implied.x32
, noti386
, and in the futurearm32
overarm
).This also changes the naming scheme for precompiled
.rh
files to be consistent with this naming system. (As it happens, only x64 targets changed names, so by coincidence the existing tarballs will continue to work on other architectures. This PR includes a backwards compatibility check which special-casesx86_64
as a synonym forx64
in these filenames. Eventually new versions ofbasic-cli
etc will be published with the new filenames, the tutorial will be updated, and this fixup can be removed.)