Extract arch and os from machine triplet when available, add machine triplet variable. #5587
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the
opam
counter part of the problems discussed in ocaml/ocaml#12326.The
opam
binary is also impacted by this issue as it queries the architecture usinguname
which returns the host processor architecture, not the runtime architecture. Here's an example from inside a docker debian/armhf image:With these changes, the returned architecture is as we expect:
The
opam
binary is making all sort of assumptions about the system it runs on,os
,distribution
, package manager etc. Thus, it make sense that it should also be more accurate about the runtime's architecture.With these changes, it should be possible to have
opam
invoke the OCaml'sconfigure
script with the--build
parameter that matches the machine triplet.This solution is more desirable than the proposed changes in the OCaml compiler
configure
script in that the compiler has less assumptions to make about the system and leaves the user in charge of dealing with corner-cases.