question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source generation depending on another package

See original GitHub issue

I’m actually using conan 0.18.1 but looking at the changelog my problem is not resolved.

I have two conans package, one containing a configuration file that could be required by multiple other packages and another which requires the first package with the configuration file.

To get the configuration file from the first package, I use the imports() method associated with the helper command self.copy(). This way, I’m able to get the configuration file from the first package. But my problem is that the second package has its sources depending on this configuration file, they are generated. The imports() is called after the source() therefore I can’t get the configuration file to generate my sources in the right section. I can generate my sources in the build() but then they will not be present in the package, hence my test_package method fail and further dependencies will be broken too. I also tried to call self.copy() directly in the source method, but that was a fail ('NoneType' object is not callable).

Is it possible to accomplish what I’m trying ? My guess to do it (only if it is wise from a general point of view) : either call the imports() method before the source() method or enable the self.copy in the source() method.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dkgscommented, Feb 8, 2017

Aw ok, I missed the fact that the source are copied to the build folder. There wasn’t any problem, just me that generate code at the wrong place ^^.

Thanks for the clarification 😃

0reactions
memshardedcommented, Feb 8, 2017

Still not sure about what you mean. The source code evolves as follows:

  • “export” copies code from user spaces to the conan local cache
  • code is copied from the “export” cache folder to the “source” cache folder
  • source() is called
  • code is copied from the “source” folder to the “build/<ID>” folder where ID is the package binary hash folder
  • build() method is called
  • package() copies from the “build/<ID>” folder to the “package/<ID>” folder, using the self.copy patterns

Code generated either in the source() method or in the build() method will end in the “package” folder if correctly managed by the package() method. Am I missing something?

In any case, very glad that I could help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to publish this C# Source Generator ...
I've created a C# source generator, and would like to publish it to ... on by the generator, but the generated source code...
Read more >
Support for source generators that add non BCL code
I think a source generator that emits code that depends on other nuget packages is perfectly normal and should be a first class...
Read more >
Source Generators
Source Generators is a C# compiler feature that lets C# developers inspect user code as it is being compiled. Source generators create new ......
Read more >
Source Generation and Writing Your Own Package ... - YouTube
Source Generation and Writing Your Own Package (The Boring Flutter Development Show, Ep. 22). 14K views · 3 years ago ...more ...
Read more >
source_gen | Dart Package
source_gen is based on the build package and exposes options for using your Generator in a Builder . Choose a Builder based on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found