Skip to content

Conversation

GuillaumeGomez
Copy link
Member

@rustbot rustbot added A-CI Area: Our Github Actions CI 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-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Sep 10, 2025
@GuillaumeGomez GuillaumeGomez changed the title Run rust tests with GCC backend Run tests with GCC backend Sep 10, 2025
@Kobzol
Copy link
Member

Kobzol commented Sep 10, 2025

We can also specify the doc_url of the job (

doc_url: https://rustc-dev-guide.rust-lang.org/tests/rust-for-linux.html
) to this: https://rustc-dev-guide.rust-lang.org/tests/codegen-backend-tests/cg_gcc.html

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from e2d0466 to 2c2dac0 Compare September 10, 2025 16:32
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch 2 times, most recently from dfd72e4 to bbdbe70 Compare September 10, 2025 17:53
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch 2 times, most recently from 6bcf347 to 3a3bcf7 Compare September 10, 2025 18:24
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 3a3bcf7 to 0efa10e Compare September 10, 2025 19:32
@GuillaumeGomez
Copy link
Member Author

Error in ui tests:

2025-09-10T20:29:55.1757480Z -	error: couldn't load codegen backend /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_gcc-1.91.0-nightly.so: libgccjit.so.0: cannot open shared object file: No such file or directory
2025-09-10T20:29:55.1758929Z +	error: couldn't load codegen backend $BUILD_DIR/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_gcc-1.91.0-nightly.so: libgccjit.so.0: cannot open shared object file: No such file or directory

Seems like something went wrong with the build/install of libgccjit. Any idea @Kobzol? I thought libgccjit was built with bootstrap if download-ci-gcc was set to false but maybe I misunderstood something.

@tgross35
Copy link
Contributor

Is the .so actually in the load path? For some reason the GCC backend works differently than clif for me locally and I often find I need to manually append LD_LIBRARY_PATH, wonder if it could be something similar here.

@GuillaumeGomez
Copy link
Member Author

Arf, it's the usual case of "it works locally for me". :-/

Gonna try to investigate if it's something wrong with paths.

@GuillaumeGomez
Copy link
Member Author

Seems like we don't copy the .so files when we build gcc unlike when we download it.

Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 12, 2025
…eGomez

Fix `libgccjit` symlink when we build GCC locally

Unblocks rust-lang#146414.

r? `@GuillaumeGomez`
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 12, 2025
…eGomez

Fix `libgccjit` symlink when we build GCC locally

Unblocks rust-lang#146414.

r? ``@GuillaumeGomez``
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 12, 2025
…eGomez

Fix `libgccjit` symlink when we build GCC locally

Unblocks rust-lang#146414.

r? ```@GuillaumeGomez```
rust-timer added a commit that referenced this pull request Sep 12, 2025
Rollup merge of #146449 - Kobzol:gcc-fix-symlink, r=GuillaumeGomez

Fix `libgccjit` symlink when we build GCC locally

Unblocks #146414.

r? ```@GuillaumeGomez```
@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 0efa10e to 7d861fe Compare September 12, 2025 16:01
@rustbot

This comment has been minimized.

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 13, 2025
Fix `libgccjit` symlink when we build GCC locally

Unblocks rust-lang/rust#146414.

r? ```@GuillaumeGomez```
@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 0e66bc1 to fad2ab4 Compare October 2, 2025 16:02
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Oct 2, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 3403655 to 2ae5737 Compare October 2, 2025 22:48
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 3, 2025
Initialize llvm submodule if not already the case to run citool

While working on rust-lang/rust#146414, I ran the following command (to run CI docker locally):

```
cargo run --manifest-path src/ci/citool/Cargo.toml run-local --type pr x86_64-gnu-gcc
```

However, since I didn't have `src/llvm` submodule initialized, it failed. Apparently it's a common issue for people using this tool so this PR removes this small inconvenience.

r? ``@Kobzol``
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 9ee26a6 to 042451c Compare October 3, 2025 09:37
@GuillaumeGomez
Copy link
Member Author

@Kobzol It's ready to review.

Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

The GCC job spends a bunch of time documenting rustc and other things. Is the GCC backend actually used for anything when documenting (doctests?). If not, we could skip that.

Could you remove the temporary comment of the GCC download? I want to check that the job downloads GCC properly and I want to see how long it takes.

View changes since this review

let target = run.target;

// GCC cannot run coverage tests.
if let Some(codegen_backend) = run.builder.config.cmd.test_codegen_backend() {
Copy link
Member

Choose a reason for hiding this comment

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

Let's at least print some warning when these tests are skipped.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think that it will be better to just ignore these tests in the CI config. Let's use ./x test --stage 2 tests --skip tests/coverage --skip tests/coverage-run-rustdoc in the Dockerfile.

<<: *job-linux-4c
- name: x86_64-gnu-miri
<<: *job-linux-4c
- name: x86_64-gnu-gcc
Copy link
Member

Choose a reason for hiding this comment

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

Note: remove before merging.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't we want this to run on each PR or did I misunderstand when this one is run?

src/ci/run.sh Outdated

# Download GCC from CI on test builders
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set gcc.download-ci-gcc=true"
# FIXME: Temporarily commented out until the GCC build/download strategy is cleared out or
Copy link
Member

Choose a reason for hiding this comment

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

Note: remove before merging.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

return;
}

// It we were running with GCC backend tests, no need to run these tests.
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit unobvious, why should the GCC codegen tests be ignored?

Copy link
Member Author

Choose a reason for hiding this comment

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

They run tests/ui, which has already been run. Gonna update the comment.

Copy link
Member

Choose a reason for hiding this comment

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

That assumes a specific execution from our CI. Someone could run x test <cg_gcc> with the GCC backend, which should work.

In any case, we should modify the CI test command in the Dockerfile to not run this test at all. So I would also revert this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah good point.

let target = run.target;

// GCC cannot run coverage tests.
if let Some(codegen_backend) = run.builder.config.cmd.test_codegen_backend() {
Copy link
Member

Choose a reason for hiding this comment

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

Actually, I think that it will be better to just ignore these tests in the CI config. Let's use ./x test --stage 2 tests --skip tests/coverage --skip tests/coverage-run-rustdoc in the Dockerfile.

@Kobzol Kobzol changed the title Run tests with GCC backend Add a CI job that runs a subset of UI tests with the GCC backend Oct 3, 2025
@GuillaumeGomez
Copy link
Member Author

The GCC job spends a bunch of time documenting rustc and other things. Is the GCC backend actually used for anything when documenting (doctests?). If not, we could skip that.

Good idea.

Could you remove the temporary comment of the GCC download? I want to check that the job downloads GCC properly and I want to see how long it takes.

Sure.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 042451c to 63d5352 Compare October 3, 2025 13:07
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 63d5352 to 5b36236 Compare October 3, 2025 13:31
@@ -1,4 +1,5 @@
//@ aux-build:doctest_crate.rs
//@ ignore-backends: gcc
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Since we're now skipping the whole suite in the Dockerfile, this test doesn't need an explicit ignore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks!

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from 5b36236 to fbf75ff Compare October 6, 2025 09:23
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez GuillaumeGomez force-pushed the run-test-with-gcc-backend branch from fbf75ff to bf2b742 Compare October 6, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations 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) 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.

6 participants