You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment Details (include every applicable attribute)
Conan version: 1.26.0+
Steps to reproduce (Include if Applicable)
Put a dummy.txt next to the following conanfile.py in some directory.
# conanfile.py
from conans import ConanFile
from os.path import isfile
class ExportSourcesTestConan(ConanFile):
name = "export-sources-test"
version = "1.0"
settings = None
#exports_sources = "dummy.txt",
def export_sources(self):
self.copy("dummy.txt")
def build(self):
if not isfile("dummy.txt"):
raise RuntimeError("Oh no!")
If the conanfile.py uses export_sources() the build step will raise the exception. If exports_sources is used, the build step succeeds.
Cause
The function complete_recipe_sources() in client/source.py only tests whether conanfile.exports_sources is defined. If only export_sources() is defined the sources won't be downloaded and the source directory stays empty.
Workaround
Defining both exports_sources and export_sources() triggers the download of the sources. But it would be nice to use export_sources() completely independent from exports_sources.
The text was updated successfully, but these errors were encountered:
Thanks very much for your complete report and detailed investigation. Indeed a bug that needs to be fixed.
You were just one if from a Pull Request, next time don't hesitate to submit it, we can help with the testing if necessary :)
I have contributed the fix in #7380, planned for next release (Conan 1.28)
Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
Put a
dummy.txt
next to the followingconanfile.py
in some directory.Create and upload the package
Remove the package from the local cache and install it from your remote:
If the
conanfile.py
usesexport_sources()
the build step will raise the exception. Ifexports_sources
is used, the build step succeeds.Cause
The function
complete_recipe_sources()
inclient/source.py
only tests whetherconanfile.exports_sources
is defined. If onlyexport_sources()
is defined the sources won't be downloaded and the source directory stays empty.Workaround
Defining both
exports_sources
andexport_sources()
triggers the download of the sources. But it would be nice to useexport_sources()
completely independent fromexports_sources
.The text was updated successfully, but these errors were encountered: