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

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

Open
wiiznokes opened this issue Jun 18, 2024 · 2 comments
Labels
bug cargo Rust cargo

Comments

@wiiznokes
Copy link

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 wiiznokes added the bug label Jun 18, 2024
@wiiznokes
Copy link
Author

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
Copy link
Author

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)

@hfiguiere hfiguiere added the cargo Rust cargo label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cargo Rust cargo
Projects
None yet
Development

No branches or pull requests

2 participants