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

Strange behaviour when cleaning up "/share/locale" #154

Open
a-andre opened this issue May 22, 2018 · 2 comments · May be fixed by #592
Open

Strange behaviour when cleaning up "/share/locale" #154

a-andre opened this issue May 22, 2018 · 2 comments · May be fixed by #592

Comments

@a-andre
Copy link

a-andre commented May 22, 2018

Take the following example org.test.test.json file

{
    "app-id": "org.test.test",
    "runtime": "org.gnome.Platform",
    "runtime-version": "3.28",
    "sdk": "org.gnome.Sdk",
    "modules": [
        {
            "name": "testA",
            "cleanup": [
                "/share/locale"
            ],
            "buildsystem": "simple",
            "build-commands": [
                "mkdir -p /app/share/locale/es",
                "touch /app/share/locale/es/testA.mo"
            ]
        },
        {
            "name": "testB",
            "buildsystem": "simple",
            "build-commands": [
                "mkdir -p /app/share/locale/es",
                "touch /app/share/locale/es/testB.mo"
            ]
        }
    ]
}

Running $ flatpak-builder dir --repo=repo org.test.test.json creates the directories dir/files/share/runtime. But there is no dir/files/share/locale/es/testB.mo.

After removing the cleanup part flatpak-builder creates dir/files/share/locale/es/test{A|B}.mo as expected.

It only happens for /share/locale, maybe because it is treated special.

@chrisawi
Copy link
Contributor

chrisawi commented Mar 1, 2024

With separate-locales enabled, /app/share/locale/*/ are moved and replaced with symlinks during the build phase. If I'm reading the code correctly, the first module to create a locale dir ends up 'owning' that symlink.

When cleanup runs, it will naively remove the symlinks owned by the module if they match the pattern, even if their targets contain message catalogs from other modules.

I wonder if it would be feasible to delay locale migration until after cleanup.

@skierpage
Copy link

I think this is causing skrooge bug 476591, wherein the symlinks in /app/share/locale/ are missing for several locales that have translations. I added cleanup properties to several of its library modules because otherwise they put a lot of irrelevant binaries and docs in the flatpak.

chrisawi added a commit to chrisawi/flatpak-builder that referenced this issue Mar 2, 2024
Otherwise, module-level cleanup can remove locale symlinks that point to
locale data installed by other modules.

Closes flatpak#154
@chrisawi chrisawi linked a pull request Mar 2, 2024 that will close this issue
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 a pull request may close this issue.

3 participants