Skip to content

Add a default directory to RUST_TARGET_PATH #16351

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
emberian opened this issue Aug 8, 2014 · 7 comments
Closed

Add a default directory to RUST_TARGET_PATH #16351

emberian opened this issue Aug 8, 2014 · 7 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)

Comments

@emberian
Copy link
Member

emberian commented Aug 8, 2014

It's possible that we want some sort of system-wide installation of target specifications.

@steveklabnik steveklabnik added the A-frontend Area: Compiler frontend (errors, parsing and HIR) label Jan 27, 2015
@steveklabnik
Copy link
Member

Would this change need an RFC? I'm inclined to say so, but I'm not sure.

@emberian
Copy link
Member Author

No, this is purely a rustc thing. Target specs can't ever be part of the language spec.

@steveklabnik
Copy link
Member

Triage: not aware of a change here.

@kevinmehall
Copy link
Contributor

What if it tried <sysroot>/lib/rustlib/<target name>/target.json instead of or in addition to a fixed directory? That way you could install a target specification and the associated libraries by unpacking a single directory.

@emberian
Copy link
Member Author

emberian commented Feb 7, 2016

This was clarified in a recent PR, let me find it.

@emberian
Copy link
Member Author

emberian commented Feb 7, 2016

#31117

@xobs
Copy link
Contributor

xobs commented Mar 12, 2020

This issue is mentioned in src/librustc_target/spec/mod.rs:1271 as being a FIXME. There still doesn't appear to be any sort of sane default search path.

I like @kevinmehall 's approach, which tucks the target.json inside the sysroot, making it easy to distribute. I'd also vote for adding . to the list.

Should this issue be reopened, since it was closed without any solution?

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 9, 2021
Add default search path to `Target::search()`

The function `Target::search()` accepts a target triple and returns a `Target` struct defining the requested target.

There is a `// FIXME 16351: add a sane default search path?` comment that indicates it is desirable to include some sort of default. This was raised in rust-lang#16351 which was closed without any resolution.

rust-lang#31117 was proposed, however that has platform-specific logic that is unsuitable for systems without `/etc/`.

This patch implements the suggestion raised in rust-lang#16351 (comment) where a `target.json` file may be placed in `$(rustc --print sysroot)/lib/rustlib/<target-triple>/target.json`. This allows shipping a toolchain distribution as a single file that gets extracted to the sysroot.
bors added a commit to rust-lang-ci/rust that referenced this issue May 9, 2021
Add default search path to `Target::search()`

The function `Target::search()` accepts a target triple and returns a `Target` struct defining the requested target.

There is a `// FIXME 16351: add a sane default search path?` comment that indicates it is desirable to include some sort of default. This was raised in rust-lang#16351 which was closed without any resolution.

rust-lang#31117 was proposed, however that has platform-specific logic that is unsuitable for systems without `/etc/`.

This patch implements the suggestion raised in rust-lang#16351 (comment) where a `target.json` file may be placed in `$(rustc --print sysroot)/lib/rustlib/<target-triple>/target.json`. This allows shipping a toolchain distribution as a single file that gets extracted to the sysroot.
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 21, 2024
internal: Eagerly lower enum variants in CrateDefMap construction
spikespaz pushed a commit to spikespaz/dotwalk-rs that referenced this issue Aug 29, 2024
Add default search path to `Target::search()`

The function `Target::search()` accepts a target triple and returns a `Target` struct defining the requested target.

There is a `// FIXME 16351: add a sane default search path?` comment that indicates it is desirable to include some sort of default. This was raised in rust-lang/rust#16351 which was closed without any resolution.

rust-lang/rust#31117 was proposed, however that has platform-specific logic that is unsuitable for systems without `/etc/`.

This patch implements the suggestion raised in rust-lang/rust#16351 (comment) where a `target.json` file may be placed in `$(rustc --print sysroot)/lib/rustlib/<target-triple>/target.json`. This allows shipping a toolchain distribution as a single file that gets extracted to the sysroot.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)
Projects
None yet
Development

No branches or pull requests

4 participants