Skip to content

docs: Update to reference host_platform instead of target_platform#1496

Open
mgorny wants to merge 1 commit into
prefix-dev:mainfrom
mgorny:host-platform-docs
Open

docs: Update to reference host_platform instead of target_platform#1496
mgorny wants to merge 1 commit into
prefix-dev:mainfrom
mgorny:host-platform-docs

Conversation

@mgorny
Copy link
Copy Markdown
Contributor

@mgorny mgorny commented Mar 17, 2025

Update the documentation throughout to replace the references to target_platform with host_platform where appropriate. That said, unless I've missed some fine point, this means pretty much everywhere.

@wolfv
Copy link
Copy Markdown
Member

wolfv commented Mar 18, 2025

Thanks for the changes! I am wondering which one is "clearer" to the user ... target_platform or host_platform?

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Mar 18, 2025

I think cross-builds are inherently "hard" difficulty, and all terms are hard. In Gentoo, I personally went for explicit CBUILD, CHOST, CTARGET to avoid ambiguity.

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Mar 18, 2025

This change was basically prompted by regro/cf-scripts#3832 (comment)

@h-vetinari
Copy link
Copy Markdown

Thanks for the changes! I am wondering which one is "clearer" to the user ... target_platform or host_platform?

@isuruf has been making the case for following build/host/target (and fixing conda's inconsistent usage of these terms). This matches autotools conventions, but not only. For example, I like meson's write-up on this topic, which comes to the same conclusion.

The "problem" is that the vast majority of cross-compiled cases (already not the most common concern itself) only care about two architectures - where it's built and where it's run. But if you use "target" for the latter, it becomes very confusing in those cases where the full generality is actually necessary (e.g. "canadian cross" compilers).

This is, for example, why our compiler feedstocks need to hack around this by using cross_target_platform, because conda-build uses target_platform for what should be host_platform.

In short: I agree that we should use v1 as an opportunity to clean up these inaccuracies, and +1 for using host_platform.

@isuruf
Copy link
Copy Markdown
Contributor

isuruf commented Mar 25, 2025

I think the easiest way to explain to users is

  1. build_platform is the platform for requirements/build
  2. host_platform is the platform for requirements/host.
  3. target_platform is for advanced users (compiler package authors) only.

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Feb 16, 2026

Rebased and updated more occurrences.

@wolfv
Copy link
Copy Markdown
Member

wolfv commented Feb 20, 2026

I am fine with merging this, but should we explain host and target platform somewhere? Specifically target platform? I also still think that on the CLI, setting --target-platform linux-64 makes it intuitively very clear what you want (compile for the target of linux-64 ...)

@h-vetinari
Copy link
Copy Markdown

but should we explain host and target platform somewhere?

I have a page I started writing recently; still need to finish up some bits and pieces, but it's getting there: conda-forge/conda-forge.github.io#2738

Feedback welcome! You can copy stuff from there for the r-b docs, or maybe simply refer to that page then.

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Mar 30, 2026

Rebased. That said, I see that there's also some incorrect logic within rattler-build, so I guess I'll extend the PR to handle that as well.

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Mar 30, 2026

Or rather, I feel like I should do that. However, it seems that the codebase is almost universally using target_platform when it ought to use host_platform (and largely ignoring host_platform everywhere), so I'd like to get confirmation before I start on such a herculean task.

@mgorny
Copy link
Copy Markdown
Contributor Author

mgorny commented Mar 31, 2026

I am fine with merging this, but should we explain host and target platform somewhere? Specifically target platform? I also still think that on the CLI, setting --target-platform linux-64 makes it intuitively very clear what you want (compile for the target of linux-64 ...)

Do you have a specific idea where to add this? IIRC the only relevant part of the docs is https://rattler-build.prefix.dev/latest/compilers/#cross-compilation which is updated here, or the command-line interface docs. I can expand either on the three platforms, though I suppose most of users won't need to know about "target" at all.

Update the documentation throughout to replace the references to
`target_platform` with `host_platform` where appropriate.  That said,
unless I've missed some fine point, this means pretty much everywhere.

Signed-off-by: Michał Górny <mgorny@quansight.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants