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

dylib-soname run-make test is not language independant #129362

Closed
Urgau opened this issue Aug 21, 2024 · 3 comments · Fixed by #129363
Closed

dylib-soname run-make test is not language independant #129362

Urgau opened this issue Aug 21, 2024 · 3 comments · Fixed by #129363
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Urgau
Copy link
Member

Urgau commented Aug 21, 2024

On an non-English system the run-make tests/run-make/dylib-soname test fails because it searches a english "needle" but readelf may print it in another language.

--- stderr -------------------------------
=== HAYSTACK ===

La section dynamique à l'offset 0x156868 contient 29 entrées :
  Étiquettes Type                         Nom/Valeur
 0x0000000000000001 (NEEDED)             Bibliothèque partagée : [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Bibliothèque partagée : [libc.so.6]
 0x0000000000000001 (NEEDED)             Bibliothèque partagée : [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Bibliothèque soname : [libfoo.so]
[..]

=== NEEDLE ===
Library soname: [libfoo.so]
thread 'main' panicked at [..]/rust/tests/run-make/dylib-soname/rmake.rs:17:14:
needle was not found in haystack
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Putting LC_ALL=C in my environment variable makes readelf use it's default (English) language.
We should probably do that for all the run-make tests.

@Urgau Urgau added A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. A-compiletest Area: The compiletest test runner labels Aug 21, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 21, 2024
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 21, 2024
@jieyouxu
Copy link
Member

... good catch. I love C locale.

@petrochenkov
Copy link
Contributor

In the compiler we set LC_ALL=C and VSLANG=1033 before calling linker because we inspect linker output sometimes.

That said, isn't the plan to migrate operations like this from third-party tools to library calls to something like object?

@jieyouxu
Copy link
Member

jieyouxu commented Aug 21, 2024

That said, isn't the plan to migrate operations like this from third-party tools to library calls to something like object?

It is. However, my current plan is to prioritize first getting rid of make and trimming down external bin tools and deps where possible (some of them are first moved to llvm bintools which are at least batched together with llvm). It's non-trivial to match readelf/readobj etc. when they have various combination of flags, and when reviewing I found out that libraries like object have differences in its interpretation of symbols (i.e. they don't match cleanly 1-to-1).

Getting rid of make first of all means that we can run the run-make tests outside of msys2 msys lol.

I'm going to do a second pass after first getting rid of make, and revisit things like:

  • External bin tools.
  • Tests that require bootstrap cargo and then internet connection to run the test (the target sanity check tests).

TL;DR: yes, eventually.

@bors bors closed this as completed in 92f0b7e Aug 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 21, 2024
Rollup merge of rust-lang#129363 - Urgau:run-make-lc_all-c, r=jieyouxu

Force `LC_ALL=C` for all run-make tests

This PR adds `LC_ALL=C` for all run-make tests so that they become locale independent.

Fixes rust-lang#129362
r? `@jieyouxu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants