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.

Generate a debug and release package without discarding any of them

See original GitHub issue

In my build pipeline I generate packages for debug and release build types after which I want to upload the debug and release packages to the remote server. I tried the following shell script:

conan install . --install-folder=build_debug -s build_type=Debug
conan build . --source-folder=. --build-folder=build_debug
conan package . --source-folder=. --build-folder=build_debug
conan export-pkg . @mycompany/dev --build-folder=build_debug -s build_type=Debug

conan install . --install-folder=build_release -s build_type=Release
conan build . --source-folder=. --build-folder=build_release
conan package . --source-folder=. --build-folder=build_release
conan export-pkg . @mycompany/dev --build-folder=build_release -s build_type=Release

# next pipeline stage
conan upload mypackagename/* --all -c -r my_remote

Both packages (Debug and Release) will result in different package hashes as expected. The problem that I have is that export-pkg is deleting my previously generated package in the cache. When I run conan upload, I am not able to upload a debug version and release version to the remote server.

I tried to run conan upload after the debug package is generated, and do the same thing after the release package is generated. This also does not work: when running conan install for packages that depend on mypackagename/* only a debug or release version is found.

I am a bit confused on how to approach the situation when I want to upload different package versions for debug and release builds. What would be an appropriate way to solve this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jlemeincommented, Mar 22, 2021

conan package is not removing anything from the cache. It only seems to flag or invalidate something, Then when running conan export-pkg it removes the previously cached results for the package that I am exporting. The snippet that I have provided in my previous post is the example:

  • First build two packages for debug and release.
  • Then run conan export-pkg for both debug and release. Result is two packages in the cache, which is correct.
  • Then run conan package . --source-folder=. --build-folder=build_debug again. Nothing happens in the cache yet.
  • Then run conan export-pkg . @mycompany/dev -bf=build_debug -s build_type=Debug again. Now the release package is removed from the cache. The debug also actually, but is then added again as a result of running this command.

My conan version is 1.33.0 and my OS is Ubuntu 18.04.5 LTS (Bionic Beaver)

0reactions
memshardedcommented, Mar 25, 2021

It sounds tricky though that packages get removed without the --force flag if I set export_sources to ‘*’. But the problem is solved for me now.

Yes, you are right, this is a side effect of an existing limitation of the current Conan cache: It can only host 1 revision at a time. When you are creating a new revision, because exports_sources modified it, the previous one is replaced. The next iteration of the cache (designed for Conan 2.0) will be able to contain multiple revisions, in that sense the binaries will not be removed, they will remain there in a previous revision, so you could use them if you want (by expliciting the revision or using a lockfile).

Thanks for the feedback!, I think this can be closed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging The Release Build Type Without Generating a ...
I create a new directory under app/src called debugRelease/java . In there I put any code that I wanted to be different when...
Read more >
Set debug and release configurations - Visual Studio (Windows)
In this article. Change the build configuration; Generate symbol (.pdb) files for a build (C#, C++, Visual Basic, F#); See also.
Read more >
CMake Part 2 - Release and Debug builds - Sticky Bits
Configuring Debug and Release Builds; CMake Generator Expressions ... and Release, but CMake allows any type that is supported by the build ......
Read more >
DebugPackage - Debian Wiki
Debug packages contain debug symbols and usually are named <package>-dbg. They are useful if program crashes and you want to generate stack ...
Read more >
Debugging Options (Using the GNU Compiler Collection (GCC))
This enables debug information consumers to inspect state at certain points of the program, even if no instructions associated with the corresponding source ......
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