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

bgfx: add new version and consolidated recipe #24423

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

RazielXYZ
Copy link
Contributor

@RazielXYZ RazielXYZ commented Jun 23, 2024

Summary

Changes to recipe: bgfx

Motivation

This adds a consolidated recipe for bgfx going forward. This is versioned using bgfx' versioning scheme (https://github.com/bkaradzic/bgfx/blob/93961afcfd45bdcbdb91bddfb133a621d340f136/src/bgfx.cpp#L3566), and integrates bx and bimg into this package. This was done after discussions about whether having bx and bimg separate is valuable, and how due to their interdependence, need for dependency sources, and reliance on specific versions, having them separate makes updates on CCI much slower and more cumbersome.

Details

The recipe is still based on the previous bgfx recipe, but with quite a few changes and additions.
It adds all things required for bimg and bx to be integrated into this recipe, such as defines, libs, and their headers.
It also adds an option for rtti, due to the fact that bgfx' (and bx', and bimg's) build scripts are hardcoded to build with rtti disabled. Packages on CCI are rtti enabled by default, and mixing these can cause linker issues, especially on linux in my experience.
There is also improved support for mingw and android, changes to make other things more consistent, and so on.
The new recipe has been locally tested on windows 11 msvc194 and mingw, linux gcc, and android.

Some questions I was pondering:
Would there be value in adding an option for overriding bx' CRT detection in order for this to build with something like musl?
Would there be value in exposing options for opengl version etc. and other compile-time options that bgfx has?


@conan-center-bot

This comment has been minimized.

@RazielXYZ
Copy link
Contributor Author

RazielXYZ commented Jun 23, 2024

This needs osx >= 13, how do we limit it to that? Looks like it's trying to use 11.3 and the cci profiles do not provide os.version or os.sdk_version for osx, it seems

Copy link
Contributor

@xoorath xoorath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending a new recipe folder name + updating the bx package to a different version so it's in sync with bgfx.

recipes/bgfx/config.yml Show resolved Hide resolved
recipes/bgfx/consolidated/conandata.yml Outdated Show resolved Hide resolved
@AbrilRBS AbrilRBS self-assigned this Jun 23, 2024
recipes/bgfx/consolidated/conanfile.py Outdated Show resolved Hide resolved
recipes/bgfx/consolidated/conanfile.py Outdated Show resolved Hide resolved
Move old recipe to cci2023
Use matching bx commit
Add cppstd handling for conan 1 to toolchain generators
Add apple sdk checks
Change warning for compiler check
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@RazielXYZ
Copy link
Contributor Author

On conan 1, it still doesn't seem to use C++17 even with setting tc.cppstd = "-std=c++17" manually. I'm guessing tc.generate() overwrites it from self.settings?
On mac, I guess we might need to skip macos builds on cci for now if the agents' macos sdk is too old.

tc.generate()
else:
tc = AutotoolsToolchain(self)
if not self.settings.get_safe("compiler.cppstd"):
tc.cppstd = "-std=c++17"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AbrilRBS What's the fate of this following the closure of #16533 ?

Try with-macos=11 for macos [11, 13)
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 6 (62568b97a2ba68c6d9aa8bf279bc3665463d46d7):

  • bgfx/cci.20230216:
    Didn't run or was cancelled before finishing

  • bgfx/1.127.8789:
    CI failed to create some packages (All logs)

    Logs for packageID 4159b958656e503d491ea2d672d42b805f007389:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=9
    os=Linux
    [options]
    bgfx:shared=False
    
    [...]
    ----Running------
    > cmake --build '/home/conan/workspace/prod-v1/bsr/cci-3a12b5c8/recipes/bgfx/all/test_v1_package/build/ff828b48c3d218c9c72b050ec1a6c750acf541f4' '--' '-j3'
    -----------------
    Scanning dependencies of target test_package
    [ 50%] Building CXX object test_package/CMakeFiles/test_package.dir/test_package.cpp.o
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        CMAKE_EXPORT_NO_PACKAGE_REGISTRY
        CMAKE_INSTALL_BINDIR
        CMAKE_INSTALL_DATAROOTDIR
        CMAKE_INSTALL_INCLUDEDIR
        CMAKE_INSTALL_LIBDIR
        CMAKE_INSTALL_LIBEXECDIR
        CMAKE_INSTALL_OLDINCLUDEDIR
        CMAKE_INSTALL_SBINDIR
    
    
    In file included from /home/conan/workspace/prod-v1/bsr/85548/ebdcf/.conan/data/bgfx/1.127.8789/_/_/package/4159b958656e503d491ea2d672d42b805f007389/include/bx/bx.h:15,
                     from /home/conan/workspace/prod-v1/bsr/cci-3a12b5c8/recipes/bgfx/all/test_package/test_package.cpp:1:
    /home/conan/workspace/prod-v1/bsr/85548/ebdcf/.conan/data/bgfx/1.127.8789/_/_/package/4159b958656e503d491ea2d672d42b805f007389/include/bx/platform.h:467:27: error: static assertion failed: 
    
    	** IMPORTANT! **
    
    	C++17 standard support is required to build.
    	
    
      467 | static_assert(__cplusplus >= BX_LANGUAGE_CPP17, "\n\n"
          |                           ^
    make[2]: *** [test_package/CMakeFiles/test_package.dir/build.make:82: test_package/CMakeFiles/test_package.dir/test_package.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:113: test_package/CMakeFiles/test_package.dir/all] Error 2
    make: *** [Makefile:103: all] Error 2
    WARN: *** Conan 1 is legacy and on a deprecation path ***
    WARN: *** Please upgrade to Conan 2 ***
    bgfx/1.127.8789 (test package): WARN: 
         ************************************************
         The 'cmake' generator is deprecated.
         Please update your code and remove it.
         *************************************************
    
    bgfx/1.127.8789 (test package): WARN: 
         ************************************************
         The 'cmake_find_package_multi' generator is deprecated.
         Please update your code and remove it.
         *************************************************
    
    bgfx/1.127.8789 (test package): WARN: **** The 'from conans import CMake' helper is deprecated. Please update your code and remove it. ****
    ERROR: bgfx/1.127.8789 (test package): Error in build() method, line 12
    	cmake.build()
    	ConanException: Error 2 while executing cmake --build '/home/conan/workspace/prod-v1/bsr/cci-3a12b5c8/recipes/bgfx/all/test_v1_package/build/ff828b48c3d218c9c72b050ec1a6c750acf541f4' '--' '-j3'
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

Failure in build 6 (62568b97a2ba68c6d9aa8bf279bc3665463d46d7):

  • bgfx/cci.20230216:
    Didn't run or was cancelled before finishing

  • bgfx/1.127.8789:
    CI failed to create some packages (All logs)

    Logs for packageID dfcf5299bdb4bcc1da7ae4e0eec623df7eae5099:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.cppstd=17
    compiler.libcxx=libc++
    compiler.version=13
    os=Macos
    [options]
    */*:shared=False
    
    [...]
    Creating ../../osx-x64/obj/Release/bgfx/src
    bgfx.cpp
    debug_renderdoc.cpp
    dxgi.cpp
    glcontext_egl.cpp
    glcontext_html5.cpp
    glcontext_wgl.cpp
    nvapi.cpp
    renderer_agc.cpp
    renderer_d3d11.cpp
    renderer_d3d12.cpp
    renderer_gl.cpp
    renderer_gnm.cpp
    renderer_mtl.mm
    renderer_noop.cpp
    ../../../src/bgfx.cpp:2645:87: warning: converting the result of '?:' with integer constants to a boolean always evaluates to 'true' [-Wtautological-constant-compare]
                    { gl::rendererCreate,     gl::rendererDestroy,     BGFX_RENDERER_OPENGL_NAME,     !!BGFX_CONFIG_RENDERER_OPENGLES   }, // OpenGLES
                                                                                                        ^
    ../../../src/config.h:99:8: note: expanded from macro 'BGFX_CONFIG_RENDERER_OPENGLES'
                                            ? BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION : 0)
                                              ^
    ../../../src/config.h:88:54: note: expanded from macro 'BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION'
    #               define BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION (0 \
                                                                      ^
    renderer_nvn.cpp
    renderer_vk.cpp
    shader.cpp
    shader_dxbc.cpp
    shader_spirv.cpp
    topology.cpp
    vertexlayout.cpp
    ../../../src/renderer_vk.cpp:6520:31: warning: unused variable 'blockInfo' [-Wunused-variable]
                    const bimg::ImageBlockInfo &blockInfo = bimg::getBlockInfo(tf);
                                                ^
    ../../../src/renderer_mtl.mm:2131:17: fatal error: no type or protocol named 'MTLBinding'
                            , NSArray<id<MTLBinding>>* _vertexArgs
                                         ^
    1 error generated.
    make[1]: *** [../../osx-x64/obj/Release/bgfx/src/renderer_mtl.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    1 warning generated.
    1 warning generated.
    make: *** [bgfx] Error 2
    
    bgfx/1.127.8789: ERROR: 
    Package 'dfcf5299bdb4bcc1da7ae4e0eec623df7eae5099' build failed
    bgfx/1.127.8789: WARN: Build folder /Users/jenkins/workspace/prod-v2/bsr/76992/ffdae/p/b/bgfx8e50c918a4397/b/build-release
    ERROR: bgfx/1.127.8789: Error in build() method, line 257
    	autotools.make(target=proj, args=["-R", f"-C {proj_path}", mingw, conf])
    	ConanException: Error 2 while executing
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@RazielXYZ
Copy link
Contributor Author

@AbrilRBS when you have the time, it would be great if we could figure out how to proceed on this.

Copy link
Contributor

@xoorath xoorath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I double checked the commits and hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants