[question] expected behavior for export-pkg tools.unzip
See original GitHub issueConan version 1.11.1 Windows 10
I was wondering the expected behavior of tools.unzip when using the export-pkg command from outside the conanfile.py’s directory.
So taking the example package source directory and conanfile.py below:
└───some_path
└───package
├───conanfile.py
└───library.zip
from conans import ConanFile, tools
class ExampleConan(ConanFile):
name = "library"
version = "1.0"
settings = "os", "arch"
def package(self):
zip_file = "library.zip"
tools.unzip(zip_file)
self.copy("*", dst="bin", src="bin", keep_path=False)
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
The command below fails during the copy to find the unpacked contents of library.zip as it gets unzipped to the cwd(some_path).
# from outside the package's directory
conan export-pkg some_path/package example/stable
Is this the expected behavior? I got stuck on this thinking the expected behavior was for the library.zip to be unzipped into the same directory as the conanfile.py.
Or maybe another question, is it just ill advised to use export-pkg for my case and I should use exports_sources to export the library.zip and treat the unzip as a build step?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
cmdline-tools : could not determine SDK root - Stack Overflow
The problem seems to be that the sdkmanager expects to reside in an environment called. /YOURPATH/cmdline-tools/SOMETHING/bin but unpacks to / ...
Read more >Import solutions - Power Apps | Microsoft Learn
During export of unmanaged solutions, some forms that aren't modified get exported with the attribute unmodified=1 in the form XML of the ...
Read more >Import & Export Surveys - Qualtrics
Importing a QSF Survey · Navigate to the Survey tab and click Tools. Import Export menu under Tools · Select Import/Export. · Choose...
Read more >Changelog — conan 1.56.0 documentation
Feature: Improved tools.Git to allow capturing the current branch and enabling the export of a package whose version is based on the branch...
Read more >Python import: Advanced Techniques and Tips
In this tutorial, you'll learn how to: Use modules, packages, and namespace packages; Handle resources and data files inside your packages; Import modules ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok great! This makes sense to me. Big thanks for getting my question answered @jgsogo @Johnnyxy
Hi all,
It is not clear to me the final conclusion, so please @conanuser1234 (also reference for other readers) take this into account:
If library.zip contains pre-compiled binaries (.lib, .a, .so, .dylib, .h, etc), or final artifacts (headers in case of header-only library) to be packaged, then, yes, the way to package them is with
conan export-pkg
. Please do not useexports_sources
for that. In this case, the recipe won’t be building anything withbuild()
.If library.zip contains the source-code, then
conan export-pkg
is useless, and indeed you should useexports_sources
or other source method (like SCM). The recipe will have abuild()
method in which the binary artifacts will be built from source.I hope this helps. Cheers.