You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"error occurred: unknown target" when trying to add a new target #135271
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
when forking the rust-lang/rust repo and attempting to add support for a new target triple, x will fail to recognise the new target when trying to build the cross compiling rustc
this happens when exactly following the directions laid out by "adding a new target" on the rustc dev guide, so either x has an issue with building the new rustc, or the documentation needs updating!
i've added the target triple to the supported targets macro, included it in the stage0 missing targets array, and (not entirely sure if this is necessary but still did it) supplied a json file with a rough specification of the target platform
the exact error given by x (presumably coming from the rustc used for building) is: error occurred: unknown target 'my-target-triple'
Please include more specific repro steps. Best if you have some changes that we can checkout to try to repro locally or look at. The description as is is kinda vague ngl.
i havent actually done any porting of the std/pal stuff yet because i am first trying to take care of this error
it really seems like it is on x's side , unless theres something missing from the docs ,,,, i dunno..
but the repro steps are really just following the docs on how to add a target -w- and setting up the usual information pertaining to one
changed the title [-]x fails to build for a custom target triple[/-][+]"error occurred: unknown target" when trying to add a new target[/+]on Jan 8, 2025
oh !
thank you all for replying so fast i was not expecting this >w< , it is very much appreciated
i should probably mention just because it might be relevant , but , i am not making a target with intent to like , actually add it to rust! its just a hobby project that will stay on my little personal fork
i will look into forking cc! unless another solution pops up before i get to that
thank you :3
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
Activity
0x0nyx98 commentedon Jan 8, 2025
reproduced on nixos and debian by the way!
jieyouxu commentedon Jan 8, 2025
Please include more specific repro steps. Best if you have some changes that we can checkout to try to repro locally or look at. The description as is is kinda vague ngl.
0x0nyx98 commentedon Jan 8, 2025
oh the repo im using is on my profile!
https://github.com/0x0nyx98/dostogo-rustc-target
it has a silly name i know >w<
i havent actually done any porting of the std/pal stuff yet because i am first trying to take care of this error
it really seems like it is on x's side , unless theres something missing from the docs ,,,, i dunno..
but the repro steps are really just following the docs on how to add a target -w- and setting up the usual information pertaining to one
workingjubilee commentedon Jan 8, 2025
the ` is not a ', unfortunately
0x0nyx98 commentedon Jan 8, 2025
oh , is that important , o////o sorry ,,,
ChrisDenton commentedon Jan 8, 2025
Maybe this is related: https://github.com/rust-lang/cc-rs/blob/b886474a357ef5238848a42a1f9b2bccb6d45ee4/src/target.rs#L66-L73?
jieyouxu commentedon Jan 8, 2025
AFAICT this is emitted from
cc, you may need to temporarily forkccto add your custom target, but this seems not ideal[-]x fails to build for a custom target triple[/-][+]"error occurred: unknown target" when trying to add a new target[/+]0x0nyx98 commentedon Jan 8, 2025
oh !
thank you all for replying so fast i was not expecting this >w< , it is very much appreciated
i should probably mention just because it might be relevant , but , i am not making a target with intent to like , actually add it to rust! its just a hobby project that will stay on my little personal fork
i will look into forking cc! unless another solution pops up before i get to that
thank you :3
workingjubilee commentedon Jan 8, 2025
not enormously, I was just noting for posterity's sake
seems rust-lang/cc-rs#1317
jieyouxu commentedon Jan 8, 2025
Yeah, so:
Rollup merge of rust-lang#137460 - onur-ozkan:downgrade-cc, r=jieyouxu
Rollup merge of rust-lang#137460 - onur-ozkan:downgrade-cc, r=jieyouxu
Unrolled build for rust-lang#137460
cuviper commentedon Mar 18, 2025
This was backported to 1.85.1.