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

Move alloc tests to rmake #121918

Closed

Conversation

abhay-51
Copy link

@abhay-51 abhay-51 commented Mar 2, 2024

Issues from the tracking PR #121876

cc @jieyouxu

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 2, 2024
@rust-log-analyzer

This comment has been minimized.

tests/run-make/alloc-no-oom-handling/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/alloc-no-rc/rmake.rs Outdated Show resolved Hide resolved
tests/run-make/alloc-no-sync/rmake.rs Outdated Show resolved Hide resolved
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Mar 3, 2024
@abhay-51 abhay-51 marked this pull request as ready for review March 3, 2024 13:56
@abhay-51 abhay-51 marked this pull request as draft March 3, 2024 17:59
use std::path::PathBuf;

fn main() {
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
Copy link
Member

@jieyouxu jieyouxu Mar 3, 2024

Choose a reason for hiding this comment

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

You can avoid path separators (PathBuf::from does not attempt to validate its string source, nor does it convert path separators AFAIK) via:

let lib_path = ["..", "..", "..", "library", "alloc", "src", "lib.rs"].iter().collect();

This would internally use the platform separator for the target the test is running on, and when you do path.to_str().unwrap() you would get back a path string with the correct platform separator, for any executable (including the ones that don't try to normalize paths).

We probably want to add some arg_path convenience API that does this, but I'm not sure of the exact API / semantics and potential footguns.

Copy link
Author

@abhay-51 abhay-51 Mar 3, 2024

Choose a reason for hiding this comment

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

Should I also try to use the absolute path here using tmp dir i think or the relative path is okay?

Copy link
Member

@jieyouxu jieyouxu Mar 3, 2024

Choose a reason for hiding this comment

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

Here tmpdir is irrelevant because we're actually referring to the stdlib sources, not compiled libs, so relative path is correct

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense thanks

@abhay-51
Copy link
Author

abhay-51 commented Mar 4, 2024

I added an arg path to the rustc function. or would it make more sense to add a general path function?

@abhay-51 abhay-51 marked this pull request as ready for review March 5, 2024 20:16
@Mark-Simulacrum
Copy link
Member

This looks like a reasonable starting point to me, but can you squash commits down into 1?

@abhay-51
Copy link
Author

@Mark-Simulacrum I have squashed the commits. Lmk if I need to make any other changes. Thanks!!

@bors
Copy link
Contributor

bors commented Mar 12, 2024

☔ The latest upstream changes (presumably #122036) made this pull request unmergeable. Please resolve the merge conflicts.

@jieyouxu
Copy link
Member

Could you please also add a comment documenting the intent of the test?

@workingjubilee
Copy link
Member

Needs rebase + addressing jieyouxu's comment.

@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 Mar 13, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 31, 2024
Rewrite `core-no-fp-fmt-parse` test in Rust

Claiming the simple "core-no-fp-fmt-parse" test from rust-lang#121876. `run_make_support` was altered with `arg_path` written in rust-lang#121918 by `@abhay-51,` with additional doc comment.

Preliminary GSoC contribution for the project proposal mentored by `@jieyouxu.`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2024
Rollup merge of rust-lang#123180 - Oneirical:master, r=Mark-Simulacrum

Rewrite `core-no-fp-fmt-parse` test in Rust

Claiming the simple "core-no-fp-fmt-parse" test from rust-lang#121876. `run_make_support` was altered with `arg_path` written in rust-lang#121918 by `@abhay-51,` with additional doc comment.

Preliminary GSoC contribution for the project proposal mentored by `@jieyouxu.`
@Dylan-DPC
Copy link
Member

@abhay-51 any updates on this?

bors added a commit to rust-lang-ci/rust that referenced this pull request May 13, 2024
Rewrite 3 very similar `run-make` alloc tests to rmake

Part of rust-lang#121876

rust-lang#121918 attempted to port these 3 tests 2 months ago. However, since then, the structure of `run-make-support` has changed a bit and new helper functions were added. Since there has been no activity on the PR, they are good low-hanging fruit to knock down, using the new functions of the current library.

There is also the removal of a useless import on a very similar test.
@oskgo
Copy link
Contributor

oskgo commented Jul 11, 2024

I'm closing this since it has been handled by #125024, which has been merged.

@oskgo oskgo closed this Jul 11, 2024
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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants