Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Migrate run-make/issue-14500 to new rmake.rs format #125047

Merged
merged 4 commits into from
May 14, 2024

Conversation

Oneirical
Copy link
Contributor

@Oneirical Oneirical commented May 12, 2024

Part of #121876 and the associated Google Summer of Code project.

Note: I find suspicious that libbar.a is hardcoded and is not using the STATICLIB call to adapt to Windows platforms. Is this intentional? If not, this will need to be changed.

@rustbot
Copy link
Collaborator

rustbot commented May 12, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 12, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 12, 2024

Some changes occurred in run-make tests.

cc @jieyouxu

The run-make-support library was changed

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment on lines 153 to 158
/// Pass a codegen option.
pub fn codegen_option(&mut self, option: &str) -> &mut Self {
self.cmd.arg("-C");
self.cmd.arg(option);
self
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think specific helpers for specific codegen options are better, i.e. .lto() over .codegen_options("lto") or something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take the opportunity to rename this test to something that's not as opaque as issue-14500. Maybe reachable-extern-fn-available-lto?

use run_make_support::{cc, extra_c_flags, run, rustc, tmp_dir};

fn main() {
let libbar_path = tmp_dir().join("libbar.a");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall exactly, do we have a static library name helper? If not, can you add one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already one! I should use it.

@jieyouxu
Copy link
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2024
@jieyouxu

This comment was marked as outdated.

@jieyouxu
Copy link
Contributor

@rustbot author

@Oneirical
Copy link
Contributor Author

Well noticed. It just so happens that everyone (that we care about) uses just about the same naming convention for static libraries:

Here is the part that made me suspicious (in tools.mk):

mylibrary.lib on MSVC.

     ifeq ($(UNAME),Darwin)
         STATICLIB = $(TMPDIR)/lib$(1).a
     else
         ifdef IS_WINDOWS
             ifdef IS_MSVC
                 STATICLIB = $(TMPDIR)/$(1).lib
             else
                 STATICLIB = $(TMPDIR)/lib$(1).a
             endif
         else
             STATICLIB = $(TMPDIR)/lib$(1).a
         endif
     endif

@jieyouxu
Copy link
Contributor

Well noticed. It just so happens that everyone (that we care about) uses just about the same naming convention for static libraries:

Here is the part that made me suspicious (in tools.mk):

mylibrary.lib on MSVC.

     ifeq ($(UNAME),Darwin)
         STATICLIB = $(TMPDIR)/lib$(1).a
     else
         ifdef IS_WINDOWS
             ifdef IS_MSVC
                 STATICLIB = $(TMPDIR)/$(1).lib
             else
                 STATICLIB = $(TMPDIR)/lib$(1).a
             endif
         else
             STATICLIB = $(TMPDIR)/lib$(1).a
         endif
     endif

You're right, I completely forgot about msvc being special again... There's technically no standard here, but AFAICT msvc uses lib by its own convention. So yeah, we can use the static_library_name helper in the support library.

@jieyouxu
Copy link
Contributor

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 14, 2024

📌 Commit 45b50d3 has been approved by jieyouxu

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 14, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 14, 2024
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#119838 (style-guide: When breaking binops handle multi-line first operand better)
 - rust-lang#124844 (Use a proper probe for shadowing impl)
 - rust-lang#125047 (Migrate `run-make/issue-14500` to new `rmake.rs` format)
 - rust-lang#125080 (only find segs chain for missing methods when no available candidates)
 - rust-lang#125088 (Uplift `AliasTy` and `AliasTerm`)
 - rust-lang#125100 (Don't do post-method-probe error reporting steps if we're in a suggestion)
 - rust-lang#125118 (Use new utility functions/methods in run-make tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 844c7e8 into rust-lang:master May 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 14, 2024
Rollup merge of rust-lang#125047 - Oneirical:test5, r=jieyouxu

Migrate `run-make/issue-14500` to new `rmake.rs` format

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Note: I find suspicious that `libbar.a` is hardcoded and is not using the `STATICLIB` call to adapt to Windows platforms. Is this intentional? If not, this will need to be changed.
@Oneirical Oneirical deleted the test5 branch May 15, 2024 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants