Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cppstd as a subsetting of compiler #4917

Merged
merged 73 commits into from May 3, 2019
Merged
Changes from 10 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
84009cb
create migration and introduce compiler.cppstd setting
jgsogo Apr 5, 2019
03cb75e
add tests at the profile level
jgsogo Apr 5, 2019
3928d79
add comment
jgsogo Apr 5, 2019
fc87bbb
keep old naming, add per compiler
jgsogo Apr 5, 2019
ebc3662
validation of package settings is done in the graph
jgsogo Apr 9, 2019
5033e8e
add checks for scoped settings
jgsogo Apr 9, 2019
dd67039
fix some tests (still some failing)
jgsogo Apr 9, 2019
ed405e1
use compiler.cppstd instead of .cppstd (fix some tests)
jgsogo Apr 10, 2019
82d3b92
raise for undefined setting compiler.cppstd
jgsogo Apr 10, 2019
166b814
fix test, mocked settings needs a fields
jgsogo Apr 10, 2019
c4643b2
remove typos
jgsogo Apr 10, 2019
db138de
Merge remote-tracking branch 'conan/develop' into feat/4873-cppstd-su…
jgsogo Apr 10, 2019
2451039
lost in migration
jgsogo Apr 10, 2019
93536a4
catch deprecation warnings for tests coming from previous merge
jgsogo Apr 10, 2019
374dfc2
check settings after contraining
jgsogo Apr 10, 2019
35c2a4d
test recipe with cppstd but without compiler
jgsogo Apr 10, 2019
3bac571
fix pep8
jgsogo Apr 10, 2019
98c3989
fix some tests
jgsogo Apr 10, 2019
9f9620b
up parameterized (add handy parameterized_class decorator)
jgsogo Apr 10, 2019
67db297
Merge branch 'dep/up-parameterized' into feat/4873-cppstd-subsetting
jgsogo Apr 10, 2019
9cb9faf
no need to warn twice (if we are check_cppstd for the conanfile)
jgsogo Apr 10, 2019
a14a495
keep the warning for the user (in console, not to stderr)
jgsogo Apr 10, 2019
1b6d458
need fields attribute again
jgsogo Apr 10, 2019
7ecf2ea
calls to build need to silence warnings
jgsogo Apr 10, 2019
f874eda
need a better mock
jgsogo Apr 10, 2019
9307770
add compiler version (needed to pass tests when the default compiler …
jgsogo Apr 10, 2019
85b8d23
add libcxx to compiler
jgsogo Apr 10, 2019
6a2e831
use cppstd=17 as it is also supported for Visual Studio (when running…
jgsogo Apr 10, 2019
c5c1965
catch warnings of test using cppstd in command line
jgsogo Apr 10, 2019
bb2bc3d
force a known default profile
jgsogo Apr 10, 2019
6036696
fix test for windows
jgsogo Apr 10, 2019
3007f8d
Add tests checking ID for different 'cppstd' strategies
jgsogo Apr 15, 2019
b64ec64
Merge branch 'feat/4873-cppstd-tests' into feat/4873-cppstd-subsetting
jgsogo Apr 15, 2019
f372619
catch warnings
jgsogo Apr 15, 2019
b2b45b1
order imports
jgsogo Apr 15, 2019
f3df1e6
Merge branch 'feat/4873-cppstd-tests' into feat/4873-cppstd-subsetting
jgsogo Apr 15, 2019
7629f1e
do not allow the user to specify both settings
jgsogo Apr 15, 2019
da53c5d
fix cancelation of cppstd for default value
jgsogo Apr 15, 2019
c3cf564
add tests (methodic) for compiler.cppstd with default value
jgsogo Apr 15, 2019
0b8cc79
Add some notices: settings are being constrained before check
jgsogo Apr 15, 2019
65b4339
typo, proper way to check if in settings
jgsogo Apr 15, 2019
809661c
no need to try/except
jgsogo Apr 15, 2019
b28a400
set compiler.cppstd to default value if it is not given (neither cpps…
jgsogo Apr 26, 2019
35e55fa
note about ConanInfo.loads
jgsogo Apr 26, 2019
8e8fcf5
at the moment of executing, settings can be different (info.header_on…
jgsogo Apr 26, 2019
4bd4974
Merge remote-tracking branch 'conan/develop' into feat/4873-cppstd-su…
jgsogo Apr 26, 2019
5242eae
organize code related to std_matching
jgsogo Apr 29, 2019
5e64300
minimize changes in default_cppstd_test
jgsogo Apr 29, 2019
61d47ba
Merge remote-tracking branch 'conan/develop' into feat/4873-cppstd-su…
jgsogo Apr 29, 2019
38ec954
add settings for 1.15
jgsogo Apr 29, 2019
28cf036
remove comment
jgsogo Apr 29, 2019
193be14
validate scoped profile at the very beginning
jgsogo Apr 29, 2019
b6a0a50
do not copy if not needed
jgsogo Apr 29, 2019
141d402
we removed a call to deprecation... we raise less deprecation errors
jgsogo Apr 29, 2019
c726584
we removed a call to deprecation... we raise less deprecation errors
jgsogo Apr 29, 2019
a958a47
cppstd deprecation message (for recipe) as warning
jgsogo Apr 30, 2019
6ddc385
Merge remote-tracking branch 'conan/develop' into feat/4873-cppstd-su…
jgsogo Apr 30, 2019
124ac14
use setting compiler.cppstd in build_helpers
jgsogo Apr 30, 2019
5526a98
deprecate functions 'default_std_[non_]matching' for compiler.cppstd
jgsogo Apr 30, 2019
6a59a69
Merge remote-tracking branch 'conan/develop' into feat/4873-cppstd-su…
jgsogo Apr 30, 2019
325f964
for pure_c, remove the compiler.cppstd subsetting
jgsogo Apr 30, 2019
5785d10
checksum for conanfile template is different
jgsogo Apr 30, 2019
3edfe5c
the flag is passed to the compiler
jgsogo Apr 30, 2019
218a148
examples of C library
jgsogo May 1, 2019
2a54111
ID will be different for different platforms
jgsogo May 1, 2019
1db65da
the id depends on other defaults (remove that test)
jgsogo May 1, 2019
ffd567c
Merge branch 'feat/4873-cppstd-subsetting-c-library' into feat/4873-c…
jgsogo May 1, 2019
92ea7ff
do not populate default value of 'compiler.cppstd'
jgsogo May 3, 2019
b3c0c50
no longer used function
jgsogo May 3, 2019
de8d7fe
revert changes associated to checksum of conanfile generated for testing
jgsogo May 3, 2019
c27c802
relax failure on user side
jgsogo May 3, 2019
57e53b7
remove tests (not for this PR)
jgsogo May 3, 2019
b5f2300
migrations_settings is populated just before the release
jgsogo May 3, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1128,7 +1128,7 @@ def get_graph_info(profile_names, settings, options, env, cwd, install_folder, c
% install_folder)
graph_info = None

if profile_names or settings or options or profile_names or env or not graph_info:
if profile_names or settings or options or env or not graph_info:
if graph_info:
# FIXME: Convert to Exception in Conan 2.0
output.warn("Settings, options, env or profile specified. "
@@ -58,24 +58,27 @@
libcxx: [libstdc++, libstdc++11]
threads: [None, posix, win32] # Windows MinGW
exception: [None, dwarf2, sjlj, seh] # Windows MinGW
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
Visual Studio:
runtime: [MD, MT, MTd, MDd]
version: ["8", "9", "10", "11", "12", "14", "15", "16"]
toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp,
v140, v140_xp, v140_clang_c2, LLVM-vs2012, LLVM-vs2012_xp,
LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2014, LLVM-vs2014_xp,
LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2, v142]
cppstd: [None, 14, 17, 20]
clang:
version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
"5.0", "6.0", "7.0",
"8"]
"5.0", "6.0", "7.0", "8"]
libcxx: [libstdc++, libstdc++11, libc++]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
apple-clang:
version: ["5.0", "5.1", "6.0", "6.1", "7.0", "7.3", "8.0", "8.1", "9.0", "9.1", "10.0"]
libcxx: [libstdc++, libc++]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
build_type: [None, Debug, Release, RelWithDebInfo, MinSizeRel]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20]
cppstd: [None, 98, gnu98, 11, gnu11, 14, gnu14, 17, gnu17, 20, gnu20] # Deprecated, use compiler.cppstd
"""

default_client_conf = """
@@ -15,6 +15,7 @@
from conans.model.settings import Settings
from conans.model.values import Values
from conans.util.files import load
from conans.client.settings_preprocessor import check_cppstd


class ProcessedProfile(object):
@@ -87,6 +88,10 @@ def _initialize_conanfile(conanfile, processed_profile):
# Update the values, keeping old ones (confusing assign)
values_tuple = processed_profile._package_settings[conanfile.name]
tmp_settings.values = Values.from_list(values_tuple)
try:
check_cppstd(tmp_settings)
except ConanException as e:
raise ConanException("Package '{}': {}".format(conanfile.name, e))

conanfile.initialize(tmp_settings, processed_profile._env_values)

@@ -51,19 +51,16 @@ def _make_migrations(self, old_version):
if old_version is None:
return

if old_version < Version("1.14.0"):
migrate_config_install(self.cache)

if old_version < Version("1.13.0"):
if old_version < Version("1.15.0"):
old_settings = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]
arch_build: [x86, x86_64, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x]
# Only for building cross compilation tools, 'os_target/arch_target' is the system for
# which the tools generate code
os_target: [Windows, Linux, Macos, Android, iOS, watchOS, tvOS, FreeBSD, SunOS, Arduino]
arch_target: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]
arch_target: [x86, x86_64, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x]
# Rest of the settings are "host" settings:
# - For native building/cross building: Where the library/program will run.
@@ -88,7 +85,7 @@ def _make_migrations(self, old_version):
SunOS:
Arduino:
board: ANY
arch: [x86, x86_64, ppc32, ppc64le, ppc64, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr]
arch: [x86, x86_64, ppc32, ppc64le, ppc64, armv5el, armv5hf, armv6, armv7, armv7hf, armv7s, armv7k, armv8, armv8_32, armv8.3, sparc, sparcv9, mips, mips64, avr, s390, s390x]
compiler:
sun-cc:
version: ["5.10", "5.11", "5.12", "5.13", "5.14"]
@@ -105,11 +102,11 @@ def _make_migrations(self, old_version):
exception: [None, dwarf2, sjlj, seh] # Windows MinGW
Visual Studio:
runtime: [MD, MT, MTd, MDd]
version: ["8", "9", "10", "11", "12", "14", "15"]
version: ["8", "9", "10", "11", "12", "14", "15", "16"]
toolset: [None, v90, v100, v110, v110_xp, v120, v120_xp,
v140, v140_xp, v140_clang_c2, LLVM-vs2012, LLVM-vs2012_xp,
LLVM-vs2013, LLVM-vs2013_xp, LLVM-vs2014, LLVM-vs2014_xp,
LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2]
LLVM-vs2017, LLVM-vs2017_xp, v141, v141_xp, v141_clang_c2, v142]
clang:
version: ["3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0",
"5.0", "6.0", "7.0",
@@ -124,6 +121,10 @@ def _make_migrations(self, old_version):
"""
self._update_settings_yml(old_settings)

if old_version < Version("1.14.0"):
migrate_config_install(self.cache)

if old_version < Version("1.13.0"):
# MIGRATE LOCAL CACHE TO GENERATE MISSING METADATA.json
_migrate_create_metadata(self.cache, self.out)

@@ -1,3 +1,5 @@
import warnings

from conans.client.build.cppstd_flags import cppstd_flag
from conans.errors import ConanException
from conans.util.log import logger
@@ -12,13 +14,31 @@ def check_cppstd(settings):
compiler = settings.get_safe("compiler")
compiler_version = settings.get_safe("compiler.version")
cppstd = settings.get_safe("cppstd")
if not cppstd or compiler not in ("gcc", "clang", "apple-clang", "Visual Studio"):

if cppstd:
warnings.warn("cppstd setting is deprecated, use compiler.cppstd instead")

try:
compiler_cppstd = settings.compiler.cppstd
except ConanException:
# There can be compilers that do not define 'compiler.cppstd' (keep compatibility)
compiler_cppstd = cppstd
else:
if cppstd and compiler_cppstd and cppstd != compiler_cppstd:
raise ConanException("The specified 'compiler.cppstd={}' and 'cppstd={}' are"
" different.".format(compiler_cppstd, cppstd))

if cppstd and not compiler_cppstd:
settings.compiler.cppstd = cppstd
compiler_cppstd = cppstd

if not compiler_cppstd or compiler not in ("gcc", "clang", "apple-clang", "Visual Studio"):
return
cpp_values = settings.cppstd.values_range
cpp_values = settings.compiler.cppstd.values_range
available = [v for v in cpp_values if cppstd_flag(compiler, compiler_version, v)]
if str(cppstd) not in available:
raise ConanException("The specified 'cppstd=%s' is not available "
"for '%s %s'. Possible values are %s'" % (cppstd,
if str(compiler_cppstd) not in available:
raise ConanException("The specified 'compiler.cppstd=%s' is not available "
"for '%s %s'. Possible values are %s'" % (compiler_cppstd,
compiler,
compiler_version,
available))
@@ -132,6 +132,7 @@ def initialize(self, settings, env):
self.options = create_options(self)
self.requires = create_requirements(self)
self.settings = create_settings(self, settings)

try:
This conversation was marked as resolved by jgsogo

This comment has been minimized.

Copy link
@memsharded

memsharded Apr 24, 2019

Contributor

I think this check might be redundant:

  • It is not possible to get cppstd defined if it doesn't come from the profile
  • The profile was checked before being applied to conanfiles

If the problem is per-package settings, I think I'd try to implement that in the same place as the global cppstd is checked, to keep that logic together.

This comment has been minimized.

Copy link
@jgsogo

jgsogo Apr 24, 2019

Author Member

Yes, this is about checking the per-package settings.

I tried to do it (there are some ideas in this PR which I moved from this repo to mine), but there is a problem: I need to constrain the settings for the package before checking them and that action is performed inside this function, in the call to self.settings = create_settings(self, settings).

I would really like to move this check to previous stages (this is executed once the graph starts to run), but it would require to move too many things not related to this PR, don't you think so?

This comment has been minimized.

Copy link
@lasote

lasote Apr 26, 2019

Contributor

I don't get it. I will go ask you "live" LoL

if self.settings.os_build and self.settings.os:
self.output.writeln("*"*60, front=Color.BRIGHT_RED)
@@ -145,6 +146,13 @@ def initialize(self, settings, env):
except ConanException:
pass

try:
This conversation was marked as resolved by jgsogo

This comment has been minimized.

Copy link
@jgsogo

jgsogo Apr 15, 2019

Author Member

Need to try/except?

if 'cppstd' in self.settings.fields:
self.output.writeln("Setting 'cppstd' is deprecated in favor of 'compiler.cppstd',"
" please update your recipe.", front=Color.BRIGHT_RED)
except ConanException:
pass

# needed variables to pack the project
self.cpp_info = None # Will be initialized at processing time
self.deps_cpp_info = DepsCppInfo()
@@ -397,15 +397,16 @@ def default_std_matching(self):
If we are building with gcc 7, and we specify -s cppstd=gnu14, it's the default, so the
same as specifying None, packages are the same
"""

if self.full_settings.cppstd and \
self.full_settings.compiler and \
self.full_settings.compiler.version:
if self.full_settings.compiler and \
This conversation was marked as resolved by jgsogo

This comment has been minimized.

Copy link
@jgsogo

jgsogo Apr 10, 2019

Author Member

Do we want to maintain this default behavior?

self.full_settings.compiler.version and \
self.full_settings.compiler.cppstd:
default = cppstd_default(str(self.full_settings.compiler),
str(self.full_settings.compiler.version))
if default == str(self.full_settings.cppstd):
if default == str(self.full_settings.compiler.cppstd):
self.settings.compiler.cppstd = None
self.settings.cppstd = None

def default_std_non_matching(self):
if self.full_settings.cppstd:
self.settings.cppstd = self.full_settings.cppstd
if self.full_settings.compiler.cppstd:
self.settings.compiler.cppstd = self.full_settings.compiler.cppstd
self.settings.cppstd = self.full_settings.compiler.cppstd
@@ -0,0 +1,101 @@
# coding=utf-8

import textwrap
import unittest

from parameterized import parameterized

from conans.test.utils.deprecation import catch_deprecation_warning
from conans.test.utils.test_files import temp_folder
from conans.test.utils.tools import TestClient


class SettingsCppStdScopedPackageTests(unittest.TestCase):
# Validation of scoped settings is delayed until graph computation, a conanfile can
# declare a different set of settings, so we should wait until then to validate it.

def setUp(self):
self.tmp_folder = temp_folder()
self.t = TestClient(base_folder=self.tmp_folder)
self.t.run("new hh/0.1@user/channel --bare")

def test_value_invalid(self):
self.t.run("create . hh/0.1@user/channel -shh:compiler=apple-clang -shh:compiler.cppstd=144",
assert_error=True)
self.assertIn("Invalid setting '144' is not a valid 'settings.compiler.cppstd' value",
self.t.out)

def test_value_different_with_scoped_setting(self):
with catch_deprecation_warning(self):
self.t.run("create . hh/0.1@user/channel"
" -s hh:cppstd=11"
" -s hh:compiler=apple-clang"
" -s hh:compiler.cppstd=14", assert_error=True)
self.assertIn("Package 'hh': The specified 'compiler.cppstd=14' and 'cppstd=11'"
" are different", self.t.out)

def test_value_different_with_general_setting(self):
with catch_deprecation_warning(self, n=2):
self.t.run("create . hh/0.1@user/channel"
" -s cppstd=11"
" -s hh:compiler=apple-clang"
" -s hh:compiler.cppstd=14", assert_error=True)
self.assertIn("Package 'hh': The specified 'compiler.cppstd=14' and 'cppstd=11'"
" are different", self.t.out)

@unittest.expectedFailure
This conversation was marked as resolved by jgsogo

This comment has been minimized.

Copy link
@jgsogo

jgsogo Apr 10, 2019

Author Member

In this test, although the recipe does not define settings = ... "compiler", the settings object contains that value, it detects the mismatch and raises.

def test_conanfile_without_compiler(self):
# TODO: This one fails, the settings object has the compiler too...

conanfile = textwrap.dedent("""
from conans import ConanFile
class Lib(ConanFile):
settings = "os", "arch"
""")
t = TestClient(base_folder=temp_folder())
t.save({'conanfile.py': conanfile})

with catch_deprecation_warning(self, n=2):
self.t.run("create . hh/0.1@user/channel"
" -s cppstd=11"
" -s hh:compiler=apple-clang"
" -s hh:compiler.cppstd=14")


class UseCompilerCppStdSettingTests(unittest.TestCase):

conanfile = textwrap.dedent("""
from conans import ConanFile
class Lib(ConanFile):
settings = "cppstd", "os", "compiler", "arch", "build_type"
def configure(self):
self.output.info(">>> cppstd: {}".format(self.settings.cppstd))
self.output.info(">>> compiler.cppstd: {}".format(self.settings.compiler.cppstd))
""")

def setUp(self):
self.t = TestClient()
self.t.save({'conanfile.py': self.conanfile})

def test_user_notice(self):
self.t.run("info .")
self.assertIn("Setting 'cppstd' is deprecated in favor of 'compiler.cppstd',"
" please update your recipe.", self.t.out)

@parameterized.expand([(True, ), (False, )])
def test_use_cppstd(self, compiler_setting):
settings_str = "-s cppstd=11 -s compiler.cppstd=11" if compiler_setting else "-s cppstd=11"
with catch_deprecation_warning(self):
self.t.run("info . {}".format(settings_str))
self.assertIn(">>> cppstd: 11", self.t.out)
self.assertIn(">>> compiler.cppstd: 11", self.t.out)

def test_only_compiler_cppstd(self):
""" settings.cppstd is available only if declared explicitly (otherwise it is deprecated) """
self.t.run("info . -s compiler.cppstd=11")
self.assertNotIn(">>> cppstd: 11", self.t.out)
self.assertIn(">>> cppstd: None", self.t.out)
self.assertIn(">>> compiler.cppstd: 11", self.t.out)
@@ -1,6 +1,7 @@
import unittest

from conans.paths import CONANFILE
from conans.test.utils.deprecation import catch_deprecation_warning
from conans.test.utils.tools import TestClient


@@ -18,15 +19,17 @@ class TestConan(ConanFile):
"""
client.save({CONANFILE: conanfile})
client.run('create . user/testing -s compiler="gcc" '
'-s compiler.libcxx="libstdc++11" '
'-s compiler.version="4.6" -s cppstd=17', assert_error=True)
with catch_deprecation_warning(self):
client.run('create . user/testing -s compiler="gcc" '
'-s compiler.libcxx="libstdc++11" '
'-s compiler.version="4.6" -s cppstd=17', assert_error=True)

self.assertIn("The specified 'cppstd=17' is not available for 'gcc 4.6'", client.out)
self.assertIn("The specified 'compiler.cppstd=17' is not available for 'gcc 4.6'", client.out)
self.assertIn("Possible values are ['11', '98', 'gnu11', 'gnu98']", client.out)

client.run('create . user/testing -s compiler="gcc" -s compiler.libcxx="libstdc++11" '
'-s compiler.version="6.3" -s cppstd=17')
with catch_deprecation_warning(self):
client.run('create . user/testing -s compiler="gcc" -s compiler.libcxx="libstdc++11" '
'-s compiler.version="6.3" -s cppstd=17')

def gcc_8_std_20_test(self):
client = TestClient()
@@ -40,9 +43,10 @@ class TestConan(ConanFile):
"""
client.save({CONANFILE: conanfile})
client.run('create . user/testing -s compiler="gcc" '
'-s compiler.libcxx="libstdc++11" '
'-s compiler.version="8" -s cppstd=20')
with catch_deprecation_warning(self):
client.run('create . user/testing -s compiler="gcc" '
'-s compiler.libcxx="libstdc++11" '
'-s compiler.version="8" -s cppstd=20')

def set_default_package_id_test(self):
client = TestClient()
@@ -56,18 +60,23 @@ class TestConan(ConanFile):
def build(self):
self.output.warn("BUILDING!")
"""
client.save({CONANFILE: conanfile % ""}) # Without the setting
# Without the setting
client.save({CONANFILE: conanfile % ""})
client.run('create . user/testing -s compiler="gcc" -s compiler.version="7.1" '
'-s compiler.libcxx="libstdc++" '
'--build missing')
self.assertIn("BUILDING!", client.out)
client.run("search MyLib/0.1@user/testing")

# Add the setting but with the default value, should not build again
client.save({CONANFILE: conanfile % '"cppstd"'}) # With the setting
client.run('create . user/testing -s compiler="gcc" -s compiler.version="7.1" '
'-s compiler.libcxx="libstdc++" '
'-s cppstd=gnu14 '
'--build missing')
with catch_deprecation_warning(self):
client.run('create . user/testing -s compiler="gcc" -s compiler.version="7.1" '
'-s compiler.libcxx="libstdc++" '
'-s cppstd=gnu14 '
'--build missing')
client.run("search MyLib/0.1@user/testing")

if client.cache.config.revisions_enabled:
self.assertIn("doesn't belong to the installed recipe revision, removing folder",
client.out)
@@ -77,8 +86,9 @@ def build(self):

# Add the setting but with a non-default value, should build again
client.save({CONANFILE: conanfile % '"cppstd"'}) # With the setting
client.run('create . user/testing -s compiler="gcc" -s compiler.version="7.1" '
'-s compiler.libcxx="libstdc++" '
'-s cppstd=gnu17 '
'--build missing')
with catch_deprecation_warning(self):
client.run('create . user/testing -s compiler="gcc" -s compiler.version="7.1" '
'-s compiler.libcxx="libstdc++" '
'-s cppstd=gnu17 '
'--build missing')
self.assertIn("BUILDING!", client.out)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.