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 VxWorks to os in default settings.yml. (#10313) #10315
Conversation
c51b643
to
1cb8bea
Compare
1cb8bea
to
d5b40be
Compare
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.
This is fine, adding VxWorks make sense.
There is still a couple of tests broken, because they list the available OSs in settings.yml, and that output changed now. Please see if you can fix them, otherwise we will help.
What would be very nice to have in the codebase is a full functional test that does some build of a package to VxWorks. Ideally with the most mainstream tooling (if building for VxWorks is commonly done with CMake, then using CMake). This test can be excluded from our CI with pytest.mark.tool_vxworks
(check the conftest.py
file in the test
folder), but it should work locally when the vxworks tools are installed. This will serve as a documentation and also utility to debug and support users using VxWorks. Not necessary to add it in this PR, but if there is experience out there using Conan for VxWorks, it would be great to incorporate at least the basic knowledge in the codebase to be future-proof.
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 am going to approve this atm, and will comment on the docs PR.
I still would like to really test the things that are stated in the docs PR. It should be possible to write a unit-test that covers using os=VxWorks
(and the necessary toolchain, via profiles, etc), that really builds and check the binaries, and that any user with the toolchain installed could execute. The conftest.py
file can explain the configuration of the toolchain. We have struggled in the past to maintain insufficiently tested integrations, and having these tests would really help.
So if you please would consider adding this in the future, it would be fantastic, open an issue to discuss, and we will give guidelines.
Great to hear. Thanks. |
I'd love to provide sufficient tests, but am not familiar with the conan code base, yet. Could you perhaps give me a little hint on where to start to implement proper tests and what the proper preconditions would be? A pointer to an existing "exotic" toolchain/os test would be a great start. Thanks! |
Sure, I think the best would be something like this, testing clang in Windows: https://github.com/conan-io/conan/blob/develop/conans/test/functional/toolchains/cmake/test_cmake_toolchain_win_clang.py
|
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 seems the test is doing just a normal native "clang" compilation, not cross-compiling to vxworks.
def test_clang_cmake_ninja(client): | ||
client.run("create . pkg/0.1@ -pr=clang -c tools.cmake.cmaketoolchain:generator=Ninja") | ||
assert 'cmake -G "Ninja"' in client.out | ||
assert "main __clang_major__12" in client.out |
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 theory the binary created will not run in the current platform, is not executable, this shouldn't be possible.
cmake.configure() | ||
cmake.build() | ||
cmd = os.path.join(self.cpp.build.bindirs[0], "my_app") | ||
self.run(cmd, env=["conanrunenv"]) |
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.
This self.run() should fail if the binary was actually cross-built for vxwork os. It should be replaced for some check of the binary.
[settings] | ||
arch=armv7 | ||
build_type=RelWithDebInfo | ||
compiler=clang |
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 clang
the compiler used to cross-compile to vxworks
?
For cross compiling, it is typically necessary to provide a CC=full/path/to/cross/compiler
env-var
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.
clang and ldarm are available in the path in my docker container.
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.
Ok, good, I was mostly wondering if clang
is the compiler actually used to compile to vxworks, and no other compiler should go here.
Closes #10313
Changelog: Feature: Add VxWorks to OSs in default settings.yml.
Docs: conan-io/docs#2355
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.