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.

[bug] self.package_folder is None in package_info() if layout() is used

See original GitHub issue

Environment Details (include every applicable attribute)

  • Conan version: 1.52.0, 1.53.0
  • Python version: 3.10

Steps to reproduce (Include if Applicable)

Create a conan file like so:

    def package_info(self):
        bin_path = os.path.join(self.package_folder, "bin")

    def layout(self):
        cmake_layout(self)

Set package in editable mode

install with CMakeDeps and CmakeToolchain generator:

conan install package/0.1@blah/blah -g CMakeDeps -g CMakeToolchain

Logs (Executed commands with output) (Include/Attach if Applicable)

ERROR: package/0.1@blah/blah : Error in package_info() method, line 228
        bin_path = os.path.join(self.package_folder, "bin")
        TypeError: expected str, bytes or os.PathLike object, not NoneType

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:25 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Nov 2, 2022

Ok, so this is the requirement:

  • We need to define a way, to specify a environment variable in an abstract way, so it can point to a file inside the build tree in editable layout and to a file inside the package in cache layout, so it gets the full correct path in the consumer side.

We certainly need to think about this, doesn’t seem an easy feature, as it requires some similar generalization and management like the one happening for cpp_info.

0reactions
paulharriscommented, Nov 29, 2022

Seem, seems to have been fixed by #12598 - awesome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Methods — conan 1.53.0 documentation
Using the self.copy() method, artifacts are copied from the build folder to the package folder. The syntax of self.copy inside ...
Read more >
Package Manager throwing numerous errors. - Unity Forum
I'm attempting to evaluate the tutorials in Unity for purposes of training and I'm unable to get them to work. Specifically I'm attempting ......
Read more >
buildpkg.py
packageInfoDefaults.keys() for k, v in options.items(): if k in fields: self.packageInfo[k] = v elif not k in ["OutputDir"]: raise Error, "Unknown package ...
Read more >
PackageInfo - Android Developers
Descriptor bit used with describeContents() : indicates that the Parcelable ... Information collected from the <application> tag, or null if there was none....
Read more >
conan/installer.py at develop - GitHub
# Build folder can use a different package_ID if build_id() is defined. # This function decides if the build folder should be re-used...
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