Conversation
lordshashank
commented
Mar 25, 2024
- Resolves Run the tests from std in the CI rust-lang/rustc_codegen_gcc#338
- added tests of standard library
|
@antoyo interestingly all std tests passed. As tests passed, I guess panic was expected, let me know if thats not the case. |
|
I have reasons to believe that this doesn't actually use the GCC codegen for the std tests. |
|
I got a patch to attempts to run the std with the GCC codegen: From fdb72558a19e2bc3b21acd569c9f6f6e9af8dc56 Mon Sep 17 00:00:00 2001
From: Antoni Boucher <bouanto@zoho.com>
Date: Wed, 27 Mar 2024 12:22:52 -0400
Subject: [PATCH] Attempt to run std tests with cg_gcc
---
build_system/src/test.rs | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/build_system/src/test.rs b/build_system/src/test.rs
index 37cfa1a08ff..60a8f5b7aec 100644
--- a/build_system/src/test.rs
+++ b/build_system/src/test.rs
@@ -985,6 +985,13 @@ where
env.get_mut("RUSTFLAGS").unwrap().clear();
+ let rustflags = format!(
+ "{test_flags} -Zcodegen-backend={backend} -Clto=off",
+ test_flags = env.get("TEST_FLAGS").unwrap_or(&String::new()),
+ backend = args.config_info.cg_backend_path,
+ );
+ env.insert("RUSTFLAGS".to_string(), rustflags);
+
run_command_with_output_and_env(
&[
&"./x.py",
@@ -992,7 +999,8 @@ where
&"--run",
&"always",
&"--stage",
- &"0",
+ &"0", // TODO: try --stage 1 while setting codegen-backend in config.toml.
+ &"-v",
&test_type,
&"--rustc-args",
&rustc_args,
@@ -1005,9 +1013,11 @@ where
fn test_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
let std_tests = test_rustc_inner(env, args, |_| Ok(false), "library/std");
- let run_make_tests = test_rustc_inner(env, args, |_| Ok(false), "tests/run-make");
- let ui_tests = test_rustc_inner(env, args, |_| Ok(false), "tests/ui");
- std_tests.and(run_make_tests).and(ui_tests)
+ std_tests
+ //let run_make_tests = test_rustc_inner(env, args, |_| Ok(false), "tests/run-make");
+ //let ui_tests = test_rustc_inner(env, args, |_| Ok(false), "tests/ui");
+ //ui_tests
+ //std_tests.and(run_make_tests).and(ui_tests)
}
fn test_failing_rustc(env: &Env, args: &TestArg) -> Result<(), String> {
--
2.44.0But it fails with a bunch of errors like this: I have no idea how to debug this. You could try debugging this if you have ideas. I hope it helps. |
|
@antoyo would you like all the tests (ui and run-make) to run with stage 1 or just std ones? |
|
I would say only when it's necessary, so only |
|
with stage 1 and "gcc" flag as well , it is panicking with weird errors like this: |
|
Yes, this is because Thin LTO is not supported. |
|
Tried that and few things, still same. Could you explain why it didn't worked in current state as was for test suits? |
|
It seems the |
|
I am not even reaching there with stage 1 (still getting same errs as above) , not sure where's the problem. |
|
Let me try with |
|
I got the same Thin LTO error, but I was able to continue by adding this code before running At this point, there's this panic to debug: I can post a full patch if you cannot reach this point. |
|
Ah!, am stuck here. From what I understood, compiler is trying to use an intrinsic function that is not yet implemented in the rustc_codegen_gcc backend. Am not able to reach the specific functionality causing this, got nothing much from full backtrace as well. |
|
This is reaching this line. and adding it allows to get past this panic. The line is even upstream so I guess we clone an earlier version for the tests? Ideally, we would want to run the tests on the current version, not some old version, but I guess an old version is a good start. I hope this helps you to continue debugging this. |
|
ok so we clone and checkout to the commit as per rustc version which currently does not have |
|
It seems like it was added upstream on March 5th, unless I don't understand something, so this should already be OK. |
|
ya it was added then but mybe it was not on release, we use commit 2d24fe591f30386d6d5fc2bb941c78d7266bf10f doesn't have that patch. |
|
Ok, I'll attempt to do the sync quickly, then. |
|
Let me know once its done. |
|
I will. The sync is harder to do this time because a bug was introduced. |
|
The sync was finally done, so you can probably continue working on this. |
|
It seems that's linking the std twice. |
|
Normally with the provided sysroot, it should work. |
I believe the problem is actually because we provide the sysroot, since this will provide a second |
|
Oh, I see. |
|
I did not forget about this. |
|
I just tried looking at this again. Could you please rebase and see what you get? |
|
Hey, sorry am busy in other things, would check this out once I get free if you don't mind 🙂 |