Skip to content

[feature] Profile rendering "root_profile_name" #19390

@HekyM

Description

@HekyM

What is your suggestion?

Hi,
I was looking to profile-rendering using jinja templates to use single profile with settings-specific options.

Getting settings from a filename using profile_name is almost what I was looking for.

Limitation with profile_name I found is, that it's "current profile filename". So it's usage i more about to copy&paste profile under different name to use it for different settings.

I think that having also root_profile_name variable with name of "root" profile (used from cli --profile) will add more efficient setup.

Here is example I would like to use:

Lest say package foo has optional dependency on package bar using with_bar option. But bar doesn't support arm architecture

Profiles

.my_options

{% set os, arch, compiler, compiler_version = root_profile_name.split('-') %}
[options]
foo/*:with_bar = {{ arch in ['x86', 'x86_64'] }}

Linux-x86_64-gcc-12

include(.my_options)

Linux-armv8-gcc-12

include(.my_options)

Usage

... --profile:host Linux-armv8-gcc-12

... --profile:host Linux-x86_64-gcc-12

This way, I could maintain single .my_options profile, as settings-specific options are rare but required.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions