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
[bug] hard links are not preserved during creation of conan_package.tgz #6810
Comments
Hi @marsmike
Thanks very much for your kind words! We are always happy to learn from users that Conan is being useful there! Regarding your issue, it is possible. There is some provision in Conan to package symlinks, but the truth is that we haven't been reported or considered hard links in the past. We need to check this. It might be difficult to fix, but it would be great to identify the issue and cause. It is likely than in Conan 2.0 we will completely re-think how Conan package symlinks/hardlinks. Thanks very much for providing the above detailed explanation and code, including the https://lithium.li/hard_links_example.tar.gz link. Lets try at least to investigate this (labeled as "look into"). @uilianries Could you please try to reproduce the above issue with a unit test in our test suite? Thanks! |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@memsharded The PR #6827 contains a very similar scenario where I can reproduce such behavior. |
when building git - I think it relies on hardlinks being present. and conan simplifies them to simple copies. |
@uilianries did reproduce in #6827 , indeed an issue. |
It looks like you can have hardlinks in Windows with I agree we need to work in this, Conan needs to support links, but IMHO this is too risky for the last week before freezing Yes, and depending on what we store in the manifest it can compute different recipe revisions (#6153)... I would add this investigation for the next release |
We need to move this issue to |
#7178 is introducing a tool to "fix" or prepare packages with symlinks for compression. |
#7760 shows how to store and preserve hard-links during the archive creation |
Solved in #13137 for 2.0 (beta.10 today) |
Dear Conan Community, thank you all for your valuable time and great work: We simply love Conan!
There is an issue when using Conan to package tools and compilers from tar balls (i.e. cross compilation toolchains) which are containing many hard links. To reduce the size on the hard disk, many existing toolchains are packaged as *.tar.bz2 file and in there are a lot of the same files which are hard linked together.
Finding: The hard links are ignored, when creating the final conan_package.tgz. Conan creates copies of the files.
This results in larger Conan packages and a slower package creation and upload process. Depending on the toolchain, the Conan package size is one to several GB larger.
Environment Details
Steps to reproduce
Created a tar.gz file with hard links, file_10MB is the original file, link1..link4 are hard links:
File structure, all file* pointing to the same inode:
Tar respects the hard links, size of resulting tarball is 10MB.
Now create a Conan package with this conanfile.py:
Logs
After creation everything is fine, because we extract directly to the package folder. But when uploading the final package is created with a much larger size (50MB).
What we tried so far:
We think Conan should support hard links in the (mid term) future.
Thank you for your help and ideas!
B.r.
Mike
The text was updated successfully, but these errors were encountered: