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

Copy translation message logs twice #16133

Open
hishamco opened this issue May 21, 2024 · 15 comments
Open

Copy translation message logs twice #16133

hishamco opened this issue May 21, 2024 · 15 comments

Comments

@hishamco
Copy link
Member

I noticed in the last few releases that a translation message logged twice while building a project

Screenshot 2024-05-22 023106

@Piedone
Copy link
Member

Piedone commented May 22, 2024

Please add repro steps and details, as asked in the template.

@hishamco
Copy link
Member Author

  1. Open your favorite command line
  2. Locate OC repo
  3. Run dotnet build
  4. You will see "Copying translations files" twice per project

@hyzx86
Copy link
Contributor

hyzx86 commented May 25, 2024

Dears , Where does the PackageTranslationFiles in the OrchardCore.Application.Cms.Core.Targets.targets file come from?

  <Target
    Name="CopyPackageTranslationFiles"
    AfterTargets="Build">
    <Message Text="Copying translation files: $(MSBuildProjectName)" Importance="high" />
    <Copy
      SourceFiles="%(PackageTranslationFiles.FullPath)"
      DestinationFolder="Localization\%(RecursiveDir)"
      Condition="'@(PackageTranslationFiles)' != ''"
      SkipUnchangedFiles="true"
      OverwriteReadOnlyFiles="false" />
  </Target>

@hyzx86
Copy link
Contributor

hyzx86 commented May 25, 2024

@hishamco I was trying to locate the problem mentioned in #16153.
I searched for the whole solution, looked for Copying translation files and found this.

@hishamco
Copy link
Member Author

Dears , Where does the PackageTranslationFiles in the OrchardCore.Application.Cms.Core.Targets.targets file come from?

I don't know :) that's why I prefer to use MSBuild programmatically :)

Related to #12364

@sebastienros
Copy link
Member

Before net8.0 we were targeting 6 and 7. Because the build is done in parallel, some files were locked during the copy process. We tried to copy the files once even with two targets, but the way the Targets in MSBUILD work when you have multiple tfms doesn't allow for that. So we decided to copy twice at a point where it's not concurrent anymore. Though with a single TFM (net8.0) I am not sure it should still happen.

@sebastienros
Copy link
Member

@hishamco can you try with a previous version, and the net8 SDK only (no net9). Ideally at a commit after #14732, I would expect to be copied once for a single TFM.

@hishamco
Copy link
Member Author

Screenshot 2024-05-31 071301

I expect the issue is related to TFMs, but while we set it to .net8.0 I thought that might be another reason for that

@sebastienros
Copy link
Member

I have no idea what the new screenshot is trying to demonstrate, and why it is different from the first screenshot.

@sebastienros
Copy link
Member

Or is the new screenshot from 1.8.3 as I suggested to try?

@hishamco
Copy link
Member Author

Sorry, the new screenshot shows that when I run the build before your linked PR, everything is fine, and copying translations logs once

@sebastienros
Copy link
Member

The PR is fine, however it works after the PR is the intended behavior (maybe not the optimal but one that doesn't crash randomly). Maybe watching the meeting that happened right after the PR would give some explanations what to expect.

@hishamco
Copy link
Member Author

I will check then see how it goes

Copy link
Contributor

It seems that this issue didn't really move for quite a while despite us asking the author for further feedback. Is this something you'd like to revisit any time soon or should we close? Please reply.

Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

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

Successfully merging a pull request may close this issue.

4 participants