-
Notifications
You must be signed in to change notification settings - Fork 993
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] Add ability to ignore folders in scm
attribute
#6605
Comments
For example, I noticed that after testing my package with I know that you expect to run
I know that the ideal way of package development would be to use (*) The |
I'd also like to see ".git" ignored. When developing with the "package development" commands, subsequent calls of |
Let's focus on the original issue, we know that there are flaws related to the development commands (we would love to hear your feedback about them), but it is better not to mix them with this issue. I agree with you that we should avoid copying the ignored files, we can ask Git to tell us which files/directories are in the Besides taking into account what it is said in the Thanks for reporting! |
Asking the git for files in Those files are not in The other cases when test files are relevant for testing the code, but not relevant for the package could be:
You generally want those files in git (usually in git LFS) because you need them for your unit tests and during development, but the final package will never depend on them. |
The point here, is that when using the SCM, what you get when the package is going to be built in the local cache, using a The best way to achieve that is using the information from the .gitignore, using Conan to do extra filtering on that local copy, will produce failures later. Lets say that you exclude a local "header.h", but that is not .gitignored. When the package is built from sources in the cache, and does the |
From my point of view this just means that the filtering should be done after |
Removing those big files when the package is built in the cache as a dependency might be even slower, because they will be cloned anyway from the repo. The value of removing those is very marginal to be a feature to be added with the added complexity. Regarding the other optimization (avoiding the copy), lets discuss about it, I don't think this is a good first issue. |
Specifically, in my case, those big files are actually in I agree that it is problematic to exclude some files that are actually part of the source (local header, as in your example). One possible idea would be to ignore certain submodules during the copy (this is essentially the same as #6606), but someone will certainly have a submodule in which only some files need to be ignored, so this is also not a good solution. Maybe we can go the Of course, if anyone has some better idea, let's discuss it. |
I've opened a different issue (#6617) for taking into account the As for the submodules, we should do the same: if the SCM attribute says that We can open one issue for that and keep this to discuss about ignoring specific files ⬇️ About ignoring files: IMHO we shouldn't make the syntax more complex to add a feature that works only for an optimization. Those |
Wasn't just that the reason for adding move semantics to C++ ?
I've requested that feature back in July 😛 But in general, the And, based on this comment from @jgsogo, it seems that local development flow is on special codepath in conan, i.e. it appears that different code gets executed in Also, the My current flow for testing this package is to first |
|
Currently, when
scm
attribute is used, the entire folder is copied to the local cache on the invocation ofconan create
. This can take a long time if the source folder contains some temporary files or folders that are under.gitignore
. This also includes the.git
folder, which contains the entire git history and should not be copied tosource
folder in the local cache, as the revision information is extracted before copying the source.I propose adding the
ignore
attribute to thescm
attribute so that files and folders matching the entries in theignore
attribute will not get copied to thesource
folder onconan create
invocation.For example, it would look like:
Also, I think that
.git
should be ignored by default (i.e. it should not be required to add it to the list.The text was updated successfully, but these errors were encountered: