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

[feature] Support source backups/fallback when a recipe uses Git tool #3788

Open
1 task done
rconde01 opened this issue Jul 1, 2024 · 3 comments
Open
1 task done
Assignees
Milestone

Comments

@rconde01
Copy link
Contributor

rconde01 commented Jul 1, 2024

What is your suggestion?

The source backup feature works with get and download, but not with Git. This seems like a big gap.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Jul 2, 2024
@memsharded
Copy link
Member

Thanks for the suggestion @rconde01, but this is not really a gap but intended:

  • Sources backup are intended for third-parties on the internet. So far the whole ConanCenter recipes can download() the sources instead of git-clone the sources, so this doesn't seem a necessary use case so far.
  • Backuping a tgz or zip file based on its declared checksum can be done relatively robustly. What is the process of backuping a cloned & checkout repository? this is not clear at all, if the full repo with .git folder should be backuped or not.
  • What is the process of reusing a backup from a git checkout? It means that the backup cannot be done after a git clone, because that might not be the correct code if a checkout is following. What if a recipe does a checkout of 2 different branches, one to build the code and other to build the docs?
  • Backuping only the current files of the checkout will be insufficient for users that expect some git operations to work later. Backuping the .git folder can have issues, as file permissions or other stuff might not be fully portable in all platforms.
  • What is the process of recovering a backup if the source() method is something like this?
    def source(self):
       git = Git(self)  # by default, the current folder "."
       git.clone(url="<repourl>", target="target") # git clone url target
       # we need to cd directory for next command "checkout" to work
       git.folder = "target"                       # cd target
       git.checkout(commit="<commit>")             # git checkout commit
    That is basically intractable. Conan would need to understand the whole execution flow and steps of the source() method, to be able to provide a reproducible state that comes from a .tgz backup in Conan that replicates the result of the git operations.

I am afraid this is not planned, backup sources will only support downloading files, not git operations.
Thanks for the feedback!

@rconde01
Copy link
Contributor Author

rconde01 commented Jul 2, 2024

That seems reasonable - but I would suggest updating the docs for backup sources saying this situation is not (and will not be) handled, and some options for transforming the recipe such that it can be supported.

@memsharded
Copy link
Member

Sounds good, lets move to the docs repo

@memsharded memsharded transferred this issue from conan-io/conan Jul 2, 2024
@memsharded memsharded added this to the 2 milestone Jul 2, 2024
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

No branches or pull requests

2 participants