Test building custom targets and resolve an issue probing rustc
#970
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.
The
rustcprobe done in our build scripts needs to pass--targettoget the correct configuration, which usually comes from the
TARGETenvironment variable. However, for targets specified via a
target.jsonfile,
TARGETgets set to the file name without an extension or path.rustcwill check a search path to attempt to locate the file, but thisis likely to fail since the directory where Cargo invokes build scripts
(and hence where those scripts invoke
rustc) might not have anyrelation to the JSON spec file.
Resolve this for now by leaving
f16andf128disabled if therustccommand fails. Result of the discussion at CARGO-14208 may eventually
provide a better solution.
A CI test is also added since custom JSON files are an edge case that
could fail in other ways. I verified this fails without the fix here.
The JSON file is the output for
thumbv7em-none-eabi, just renamed sorustcdoesn't identify it.