+
Skip to content

build.rs: copy i10n in release #8276

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

AleksaBajat
Copy link

Discussed in #8263.

Only l10n that are configured for the build get their l10n files copied to the target/release directory.
CLI works as intended in release.

@sylvestre
Copy link
Contributor

some jobs are failing
could you please add some tests too?
thanks

source_path, dest_path, err
);
} else {
println!(
Copy link
Contributor

@sudhackar sudhackar Jun 27, 2025

Choose a reason for hiding this comment

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

Where does this println output to?

Its reflected when used with cargo -vv like

[coreutils 0.1.0] cargo:rerun-if-changed=build.rs
[coreutils 0.1.0] cargo:rustc-cfg=build="release"
[coreutils 0.1.0] Copied locale file: /home/sudhackar/repos/coreutils/src/uu/base32/locales/en-US.ftl -> /home/sudhackar/repos/coreutils/target/release/locales/base32/en-US.ftl
[coreutils 0.1.0] Copied locale file: /home/sudhackar/repos/coreutils/src/uu/base64/locales/en-US.ftl -> /home/sudhackar/repos/coreutils/target/release/locales/base64/en-US.ftl
[coreutils 0.1.0] Copied locale file: /home/sudhackar/repos/coreutils/src/uu/basename/locales/en-US.ftl -> /home/sudhackar/repos/coreutils/target/release/locales/basename/en-US.ftl
[coreutils 0.1.0] Copied locale file: /home/sudhackar/repos/coreutils/src/uu/basename/locales/fr-FR.ftl -> /home/sudhackar/repos/coreutils/target/release/locales/basename/fr-FR.ftl
....

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

@AleksaBajat
Copy link
Author

@sylvestre will do. However I would like to point out that the jobs don't seem to fail due to the new code but the code that was here beforehand. I also wonder if it makes sense to have a completely different approach to handling localization files based on the build profile. If we take this approach with build.rs in release, I would think it would be completely fine to make it the same for debug builds. Please have a look at get_locales_dir. To me it seems like a complexity we can and should avoid.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

- works the same in both release and debug
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@AleksaBajat
Copy link
Author

AleksaBajat commented Jun 28, 2025

@sylvestre, I tried making the localization the same across build profiles but it seems like that breaks quite a lot of tests. I reverted those changes and only keeping this scoped, maybe we can have a look some other time. build.rs does not support tests by default, is it acceptable to add a new package that is going to be a build-dependency and have tested code that is going to be used in build.rs?

EDIT: Looking at the tests that failed before revert, there might be something that I'm missing with the current implementation. Investigating...

EDIT: Seems that the cause of failure for the tests when we have a unified approach is due to Rust using non-standard binary paths when runnings tests (starting from deps making it unable to find relative locales path). It's best that we keep the distinction between debug and release.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载