rustc: Simplify getting sysroot library directory by petrochenkov · Pull Request #129418 · rust-lang/rust (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

petrochenkov

@petrochenkov

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Aug 22, 2024

jieyouxu

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Aug 23, 2024

jieyouxu added a commit to jieyouxu/rust that referenced this pull request

Aug 23, 2024

@jieyouxu

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 23, 2024

@bors

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

jieyouxu added a commit to jieyouxu/rust that referenced this pull request

Aug 23, 2024

@jieyouxu

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 23, 2024

@bors

Rollup of 5 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Aug 24, 2024

@workingjubilee

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Aug 24, 2024

@workingjubilee

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Aug 24, 2024

@workingjubilee

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 24, 2024

@bors

…kingjubilee

Rollup of 10 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Aug 24, 2024

@matthiaskrgr

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 24, 2024

@bors

tgross35 added a commit to tgross35/rust that referenced this pull request

Aug 25, 2024

@tgross35

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 25, 2024

@bors

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Aug 27, 2024

@workingjubilee

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 27, 2024

@bors

…kingjubilee

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Aug 27, 2024

@bors

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Aug 27, 2024

@rust-timer

Rollup merge of rust-lang#129418 - petrochenkov:libsearch2, r=jieyouxu

rustc: Simplify getting sysroot library directory

It was very non-obvious that sess.target_tlib_path, make_target_lib_path(...), and sess.target_filesearch(...).search_paths() result in the same sysroot library directory paths. They are however, indeed the same, because sess.target_tlib_path is initialized to make_target_lib_path(...) on Session creation, and they are used interchangeably.

There are still some redundant calls to make_target_lib_path and other inconsistent ways to obtain sysroot directories, but fixing that requires some behavior changes, while this PR is a pure refactoring. Some places in the compiler even disagree on the number of sysroots - 1 (explicit --sysroot or default sysroot), 2 (explicit --sysroot and default sysroot), or an unclear number of sysroot_candidates every of which is considered. The logic currently using sess.target_tlib_path or equivalents assumes one sysroot.