Rollup merge of #110525 - jyn514:translation-download-rustc, r=albertlarsan68

Fix `tests/run-make-translation` when download-rustc is enabled

When building locally, we never generate a `share` directory in the local sysroot. However, when we download the `rustc` component from ci, it includes a `share/man` directory in the sysroot. The `run-make/translation` test assumed that it didn't exist, and would create a link from `fakeroot` to the real share directory, and write symbolic links into it. Change it not to create the link, so that rustc doesn't try to load multiple copies of the same `.ftl` file.

Fixes https://github.com/rust-lang/rust/issues/110357.
This commit is contained in:
Matthias Krüger 2023-04-19 17:54:42 +02:00 committed by GitHub
commit 9a13f4f018
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,8 @@ sysroot: test.rs working.ftl
rm -f $(FAKEROOT)/lib/rustlib/src
mkdir $(FAKEROOT)/lib/rustlib/src
ln -s $(SYSROOT)/lib/rustlib/src/* $(FAKEROOT)/lib/rustlib/src
# When download-rustc is enabled, `$(SYSROOT)` will have a share directory. Delete the link to it.
rm -f $(FAKEROOT)/share
mkdir -p $(FAKEROOT)/share/locale/zh-CN/
ln -s $(CURDIR)/working.ftl $(FAKEROOT)/share/locale/zh-CN/basic-translation.ftl
$(RUSTC) $< --sysroot $(FAKEROOT) -Ztranslate-lang=zh-CN 2>&1 | $(CGREP) "this is a test message"