flatpak / flatpak-builder-tools

Various helper tools for flatpak-builder
198 stars 107 forks source link

Cargo: The following files not tracked in the working copy would be overwritten by the extraction: #414

Open wiiznokes opened 5 months ago

wiiznokes commented 5 months ago

flatpak-builder version

1.4.1

Linux distribution and version

fedora 40

Affected flatpak-builder tool

cargo/flatpak-cargo-generator.py

flatpak-builder tool cli args

No response

Source repository URL

https://github.com/wiiznokes/fan-control

Flatpak-builder manifest URL

https://github.com/flathub/io.github.wiiznokes.fan-control

Description

Full output (this is French, i tried to google translate it for the title)

python3 flatpak-builder-tools/cargo/flatpak-cargo-generator.py fan-control/Cargo.lock -o cargo-sources.json
INFO:root:Loading packages from https://github.com/wash2/accesskit
INFO:root:Adding package accesskit from https://github.com/wash2/accesskit
INFO:root:Adding package accesskit_consumer from https://github.com/wash2/accesskit
INFO:root:Adding package accesskit_macos from https://github.com/wash2/accesskit
INFO:root:Adding package accesskit_unix from https://github.com/wash2/accesskit
INFO:root:Adding package accesskit_windows from https://github.com/wash2/accesskit
INFO:root:Adding package accesskit_winit from https://github.com/wash2/accesskit
INFO:root:Loading packages from https://github.com/jackpot51/rust-atomicwrites
INFO:root:Adding package atomicwrites from https://github.com/jackpot51/rust-atomicwrites
INFO:root:Loading packages from https://github.com/pop-os/window_clipboard
INFO:root:Adding package clipboard_macos from https://github.com/pop-os/window_clipboard
INFO:root:Adding package clipboard_wayland from https://github.com/pop-os/window_clipboard
INFO:root:Adding package clipboard_x11 from https://github.com/pop-os/window_clipboard
INFO:root:Loading packages from https://github.com/pop-os/libcosmic
INFO:root:Adding package cosmic-config from https://github.com/pop-os/libcosmic
INFO:root:Adding package cosmic-config-derive from https://github.com/pop-os/libcosmic
INFO:root:Loading packages from https://github.com/pop-os/cosmic-text
Depuis https://github.com/pop-os/cosmic-text
 * branch            a03ec6b75f0ea8fd6264d6cd05afcec3c2213f8f -> FETCH_HEAD
erreur : Les fichiers suivants non suivis de la copie de travail seraient écrasés par l'extraction :
        .gitattributes
        .github/workflows/pages.yml
        .github/workflows/rust.yml
        .gitignore
        CHANGELOG.md
        Cargo.toml
        LICENSE-APACHE
        LICENSE-MIT
        README.md
        benches/layout.rs
        ci.sh
        deny.toml
        editor-test.sh
        examples/editor-test/Cargo.toml
        examples/editor-test/src/main.rs
        examples/editor/Cargo.toml
        examples/editor/src/main.rs
        examples/multiview/Cargo.toml
        examples/multiview/src/main.rs
        examples/rich-text/Cargo.toml
        examples/rich-text/src/main.rs
        examples/terminal/Cargo.toml
        examples/terminal/src/main.rs
        fonts/FiraMono-LICENSE
Veuillez renommer ou effacer ces fichiers avant de basculer de branche.
erreur : Les fichiers suivants non suivis de la copie de travail seraient effacés par l'extraction :
        editor-orbclient.sh
Veuillez renommer ou effacer ces fichiers avant de basculer de branche.
Abandon
INFO:root:Adding package cosmic-theme from https://github.com/pop-os/libcosmic
INFO:root:Loading packages from https://github.com/gfx-rs/wgpu
INFO:root:Adding package d3d12 from https://github.com/gfx-rs/wgpu
INFO:root:Adding package dnd from https://github.com/pop-os/window_clipboard
INFO:root:Loading packages from https://github.com/pop-os/glyphon
INFO:root:Adding package glyphon from https://github.com/pop-os/glyphon
INFO:root:Adding package iced from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_accessibility from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_core from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_futures from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_graphics from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_renderer from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_runtime from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_style from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_tiny_skia from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_wgpu from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_widget from https://github.com/pop-os/libcosmic
INFO:root:Adding package iced_winit from https://github.com/pop-os/libcosmic
INFO:root:Adding package libcosmic from https://github.com/pop-os/libcosmic
INFO:root:Loading packages from https://github.com/wiiznokes/lm-sensors
INFO:root:Adding package lm-sensors from https://github.com/wiiznokes/lm-sensors
INFO:root:Adding package mime from https://github.com/pop-os/window_clipboard
INFO:root:Adding package naga from https://github.com/gfx-rs/wgpu
INFO:root:Loading packages from https://github.com/pop-os/smithay-clipboard
INFO:root:Adding package smithay-clipboard from https://github.com/pop-os/smithay-clipboard
INFO:root:Loading packages from https://github.com/pop-os/softbuffer
INFO:root:Adding package softbuffer from https://github.com/pop-os/softbuffer
INFO:root:Loading packages from https://github.com/dioxuslabs/taffy
INFO:root:Adding package taffy from https://github.com/dioxuslabs/taffy
INFO:root:Adding package wgpu from https://github.com/gfx-rs/wgpu
INFO:root:Adding package wgpu-core from https://github.com/gfx-rs/wgpu
INFO:root:Adding package wgpu-hal from https://github.com/gfx-rs/wgpu
INFO:root:Adding package wgpu-types from https://github.com/gfx-rs/wgpu
INFO:root:Adding package window_clipboard from https://github.com/pop-os/window_clipboard
INFO:root:Loading packages from https://github.com/pop-os/winit
INFO:root:Adding package winit from https://github.com/pop-os/winit
Traceback (most recent call last):
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 436, in <module>
    main()
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 429, in main
    generated_sources = asyncio.run(generate_sources(load_toml(args.cargo_lock),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 383, in generate_sources
    for pkg in await asyncio.gather(*pkg_coros):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 333, in get_package_sources
    return await get_git_package_sources(package, git_repos)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 270, in get_git_package_sources
    git_repo['commits'][commit] = await get_git_repo_packages(repo_url, commit)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 183, in get_git_repo_packages
    git_repo_dir = fetch_git_repo(git_url, commit)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fedasus/Documents/io.github.wiiznokes.fan-control/flatpak-builder-tools/cargo/flatpak-cargo-generator.py", line 116, in fetch_git_repo
    subprocess.run(['git', 'checkout', commit], cwd=clone_dir, check=True)
  File "/usr/lib64/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'checkout', 'a03ec6b75f0ea8fd6264d6cd05afcec3c2213f8f']' returned non-zero exit status 1.
wiiznokes commented 5 months ago

issue worked around by running rm -rf ~/.cache/flatpak-cargo

Btw, i don't see the point of cloning and checkout every git repo. I mean sure, if you're doing force push, they can have invalid commit, but its very rare, so i don't really see the point

wiiznokes commented 5 months ago

My guess is that this line doesn't works very well, but i'm not sure. subprocess.run(['git', 'fetch', 'origin', commit], cwd=clone_dir, check=True)