Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

No upload when CONAN_LOGIN_USERNAME, CONAN_USERNAME or Conanfile.user are defined and different #606

Description

@NokiDev

Description of Problem

CPT uses CONAN_LOGIN_USERNAME as conan user, rather than defined variable CONAN_USERNAME or Conanfile.user
I believe this leads to a reference mismatch, making the upload of artifacts not executed (the process stops after running test_package, without a log). See runner.py#171.

I'm not sure why the user used by cpt is not the one defined either with CONAN_USERNAME or Conanfile.user, but it happened when upgrading conan from 1.45 to 1.52.0. So it might be a conan API thing.

The workaround, we use for now is to define directly the user in ConanMultiPackager(user=my_package_user)

Environment Details

  • Conan Package Tools Version: 0.38.0
  • Operating System: Windows
  • Operation System Version: Windows Server 2019
  • Compiler+version: gcc-5.4
  • Conan version: conan 1.52.0 (> 1.45)
  • Python version: python 3.9.0
  • CI Tool : Gitlab

Steps to reproduce (Include if Applicable)

The following recipe :

class MyRecipeConan(ConanFile):
	name = "my-recipe"
	license = ""
	user = "my_package_user"
	
	requires = ()

	settings = {}
	short_paths = False
	exports_sources = ["*"]
	generators = "txt"

	def generate(self):
		pass

	def layout(self):
		pass

	def build(self):
		pass

	def build_id(self):
		self.info_build.clear()

	def package(self):
		self.copy("*")

	def package_id(self):
		self.info.clear()

The following build.py :

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from cpt.packager import ConanMultiPackager


if __name__ == "__main__":
    builder = ConanMultiPackager(
	archs=['x86_64'], #Don't really matters actually.
        visual_versions=['16'],
        build_types=['RelWithDebInfo'],
        visual_runtimes=['MD',]
    )
    builder.add_common_builds()
    builder.run()

Setting the following in environment :

CONAN_USERNAME="my_package_user"
CONAN_CHANNEL="stable"
CONAN_LOGIN_USERNAME="my_login_user"
CONAN_PASSWORD="mypassword"

Running python ./build.py

Build logs (Include if Available)

Notice the mismatch between CPT user in configuration and the actual user of the package.

+--------------------+-----------------------------------------------------------------+
| Configuration      | value                                                           |
|--------------------+-----------------------------------------------------------------|
| name               | my-recipe                                                       |
| version            | 0.0.0                                                           |
| user               | my_login_user                                                   |
| channel            | stable                                                          |
| build_modes        |                                                                 |
| require_overrides  |                                                                 |
| profile_name       | C:\Windows\TEMP\tmprm11l096conan_package_tools_profiles\profile |
| profile_build_name |                                                                 |
+--------------------+-----------------------------------------------------------------+
Exporting package recipe
my-recipe/0.0.0@my_package_user/stable exports_sources: Copied 1 file: .gitignore
my-recipe/0.0.0@my_package_user/stable: A new conanfile.py version was exported
my-recipe/0.0.0@my_package_user/stable: Folder: K:\.c.p\2099_\.conan\data\my-recipe\0.0.0\my_package_user\stable\export
my-recipe/0.0.0@my_package_user/stable: Using the exported files summary hash as the recipe revision: f92738ed1a316ed685e7135a7dd73a2f 
my-recipe/0.0.0@my_package_user/stable: Exported revision: f92738ed1a316ed685e7135a7dd73a2f

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions