-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 imagl/0.2.1 #4630
Add imagl/0.2.1 #4630
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Prepare for CCI
This comment has been minimized.
This comment has been minimized.
Thanks @prince-chrismc. I will make some changes to take your advices into account. But there are compiling issues since last month, jenkins bot used Visual Studio 16.8 (according to logs). Now, it uses Visual Studio 16.4... I was surprised to find that my code was not compatible with this version, since Microsoft has moved a feature between two header files. So I need to be more specific in the recipe to check the MSVC compiler version. |
🙃 We have this
|
…rty, hardly detecting msvc compiler version
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…not work on my computer...
This comment has been minimized.
This comment has been minimized.
…nts on CMake's Ninja generator need
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding comments, I just want to clarity one thing you wrote
recipes/imagl/all/conanfile.py
Outdated
@@ -117,10 +133,31 @@ def requirements(self): | |||
def _configure_cmake(self): | |||
if self._cmake: | |||
return self._cmake | |||
|
|||
# CMake generator must be set to Ninja when using Visual Studio to let choose the right | |||
# MSVC compiler version when multiple versions are installed on build machine. The problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lingo I am most familiar with is "MSVC toolsets" and yes CMake which takes "VS2019" as an arg always chooses the highest one installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, "MSVC toolset" is more often understood as the main version of toolset (140 for VS2013, 141 for VS2017 and 142 for VS2019). This is why I wanted to be explicit about the version of the compiler (the "142" toolset includes the 14.2x versions of the toolset, each version of which contains the MSVC compiler in version 19.2x ...).
recipes/imagl/all/conanfile.py
Outdated
# Building with specific MSVC version could be needed since imaGL requires some minimal | ||
# version to be compiled according to its own version. Following table links imaGL version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this required for the build to pass on CCI?
In the Conan universe if you want to build an exact toolset you could use the new msvc compiler. (this is consistent with CMake)
Just as a sanity check,
Is this required ? Or is it an improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not required to pass on CCI. By the way, CCI is not able to build imaGL since tools.vswhere
does not work on CCI (see #4954) and I don't know how to test for minor version of MSVC without vswhere. It's done from line 89 to 95. Some imaGL versions could be built in CCI (CCI has Visual Studio 16.4, so imaGL 0.1.2 and 0.2.1 could be built), but I don't know how to be sure that the recipe is cooked on the CCI CI/CD machine.
I do this in the recipe to allow imaGL to be built locally in a Visual Studio command line environment with a specific version of the toolset (using VCVARS and company environment variables). So the recipe is compatible with "Visual Studio" compiler from the Conan universe.
Still in this universe, using the new msvc compiler is allowed thanks to lines 47 and 53. But CCI still uses "Visual Studio".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to understand a couple of things that are being implemented in this recipe. It deserves some attention if we want it to be merged.
I have questions related to:
- option
allow_clang_11
: I think it is not needed. - MSVC minor versions: if needed, we can upgrade the version, now we are using 19.28.29333. But the recipe cannot use
vswhere
in thevalidate()
method because that method is running first in a Linux container... it could be used in thebuild()
if it is really needed.
"clang": "10", | ||
"apple-clang": "11" | ||
} | ||
if tools.Version(self.version) <= "0.1.1" or tools.Version(self.version) == "0.2.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 0.2.0 is not listed in config.yml... is this a typo?
recipes/imagl/all/conanfile.py
Outdated
} | ||
if tools.Version(self.version) <= "0.1.1" or tools.Version(self.version) == "0.2.0": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 0.2.0 is not listed in config.yml... is this a typo?
|
||
@property | ||
def _supports_jpeg(self): | ||
return tools.Version(self.version) >= "0.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 0.2.0 is not listed in config.yml... is this a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine for me, I guess that jpeg support was added in 0.2.0, so it doesn't matter that exact 0.2.0 version was not in CCI, it makes the recipe more robust if for any reason 0.2.0 is added later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We started by adding 0.2.0 but there was a new point release since then
recipes/imagl/all/conanfile.py
Outdated
version="[{}.0,{}.0)".format(str(self.settings.compiler.version), int(str(self.settings.compiler.version))+1), latest=True, property_="installationVersion")[0]["installationVersion"] | ||
toolset_version = tools.vcvars_dict(self).get("VCToolsVersion", os.environ.get("VCToolsVersion","")) | ||
except ConanException: | ||
raise ConanInvalidConfiguration("Your Visual Studio compiler seems not to be installed in a common way. It is not supported. This unfortunately happens in conan center index. To build imaGL, append '--build missing' to your 'conan install' command line.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose here? Probably we need a different approach. These lines are evaluated in the machine where Conan is running, in CCI we will run them in a Linux container which will not work as expected, and probably discard the intended configuration.
In the validate()
we can use only the settings/options from the profile and dependencies. This method should be agnostic to everything else.
recipes/imagl/all/conanfile.py
Outdated
if self.options.shared: | ||
del self.options.fPIC | ||
if not self.settings.compiler.cppstd: | ||
self.settings.compiler.cppstd = "20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not assign a value here, it is not going to work... and future versions of Conan will fail here.
To answer to @jgsogo
This has already been discussed here. For short, it's because of a misinstallation in CCI for clang 11. See conan-io/conan-docker-tools#251 and conan-io/conan-docker-tools#252.
Ok, I understand now why it does not 'work'. So, since you are saying that you are using 19.28, I will totally remove this check which does not make sense anymore. Minimal version to build imaGL is 19.25 and CCI documentation prints that MSVC is 19.24 (Visual Studio 16.4) |
Specify library name and version: imagl/0.2.0
conan-center hook activated.