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

box2d: 2.4.2 -> 3.0.0 #340470

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

box2d: 2.4.2 -> 3.0.0 #340470

wants to merge 5 commits into from

Conversation

GaetanLepage
Copy link
Contributor

Description of changes

Changelog: https://box2d.org/posts/2024/08/releasing-box2d-3.0/

cc @raskin

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@GaetanLepage
Copy link
Contributor Author

Currently fails with:

[ 98%] Linking CXX executable ../bin/test
cd /build/source/build/test && /nix/store/hx89vlv61l4vm0dvn0zww817nckzh7ls-cmake-3.29.6/bin/cmake -E cmake_link_script CMakeFiles/test.dir/link.txt --verbose=1
/nix/store/gxpdysvlj9l6bfin03k6yq0s922pk7pg-gcc-wrapper-13.3.0/bin/g++ -O3 -DNDEBUG CMakeFiles/test.dir/main.c.o CMakeFiles/test.dir/test_bitset.c.o CMakeFiles/test.dir/test_collisi>
/build/source/samples/settings.cpp: In function 'bool ReadFile(char*&, int&, const char*)':
/build/source/samples/settings.cpp:35:14: error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)' declared with attribute 'warn_unused_result' [8;;https://gcc.g>
   35 |         fread( data, size, 1, file );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/build/source/samples/shader.cpp: In function 'GLuint sCreateShaderFromFile(const char*, GLenum)':
/build/source/samples/shader.cpp:153:14: error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)' declared with attribute 'warn_unused_result' [8;;https://gcc.gn>
  153 |         fread( source, size, 1, file );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [samples/CMakeFiles/samples.dir/build.make:345: samples/CMakeFiles/samples.dir/shader.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/build/source/build'
cc1plus: all warnings being treated as errors
[ 98%] Built target test
make[2]: *** [samples/CMakeFiles/samples.dir/build.make:331: samples/CMakeFiles/samples.dir/settings.cpp.o] Error 1
make[2]: Leaving directory '/build/source/build'
make[1]: *** [CMakeFiles/Makefile2:338: samples/CMakeFiles/samples.dir/all] Error 2
make[1]: Leaving directory '/build/source/build'
make: *** [Makefile:139: all] Error 2

@GaetanLepage
Copy link
Contributor Author

Not sure that my glfw injection is working:

-- Adding Box2D unit tests
CMake Warning at samples/CMakeLists.txt:20 (find_package):
  By not providing "Findglfw.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "glfw", but
  CMake did not find one.

  Could not find a package configuration file provided by "glfw" with any of
  the following names:

    glfwConfig.cmake
    glfw-config.cmake

  Add the installation prefix of "glfw" to CMAKE_PREFIX_PATH or set
  "glfw_DIR" to a directory containing one of the above files.  If "glfw"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring done (1.0s)
-- Generating done (0.0s)

@tobim
Copy link
Contributor

tobim commented Sep 14, 2024

Not sure that my glfw injection is working:

Did you try glfw3?

@GaetanLepage
Copy link
Contributor Author

Did you try glfw3?

It works better thanks, but still fails with:

/build/source/samples/settings.cpp: In function 'bool ReadFile(char*&, int&, const char*)':
/build/source/samples/settings.cpp:35:14: error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)' declared with attribute 'warn_unused_result' [-Werror=unused-result]
   35 |         fread( data, size, 1, file );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/build/source/samples/shader.cpp: In function 'GLuint sCreateShaderFromFile(const char*, GLenum)':
/build/source/samples/shader.cpp:153:14: error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  153 |         fread( source, size, 1, file );
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [samples/CMakeFiles/samples.dir/build.make:345: samples/CMakeFiles/samples.dir/shader.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1plus: all warnings being treated as errors
make[2]: *** [samples/CMakeFiles/samples.dir/build.make:331: samples/CMakeFiles/samples.dir/settings.cpp.o] Error 1
make[2]: Leaving directory '/build/source/build'
make[1]: *** [CMakeFiles/Makefile2:338: samples/CMakeFiles/samples.dir/all] Error 2
make[1]: Leaving directory '/build/source/build'
make: *** [Makefile:139: all] Error 2

@tobim
Copy link
Contributor

tobim commented Sep 15, 2024

erincatto/box2d#784 might fix that.

@GaetanLepage
Copy link
Contributor Author

GaetanLepage commented Sep 15, 2024

erincatto/box2d#784 might fix that.

Thanks ! I was able to cherry-pick the necessary fixes.
Now it builds fine, however, the result doesn't include the headers anymore:

previous version

[nix-shell:~/nixpkgs]$ tree /nix/store/jlnr0l28rq29y8xrhrn7sdswxycv8kav-box2d-2.4.2
/nix/store/jlnr0l28rq29y8xrhrn7sdswxycv8kav-box2d-2.4.2
├── include
│   └── box2d
│       ├── b2_api.h
│       ├── b2_block_allocator.h
│       ├── b2_body.h
│       ├── b2_broad_phase.h
│       ├── b2_chain_shape.h
│       ├── b2_circle_shape.h
│       ├── b2_collision.h
│       ├── b2_common.h
│       ├── b2_contact.h
│       ├── b2_contact_manager.h
│       ├── b2_distance.h
│       ├── b2_distance_joint.h
│       ├── b2_draw.h
│       ├── b2_dynamic_tree.h
│       ├── b2_edge_shape.h
│       ├── b2_fixture.h
│       ├── b2_friction_joint.h
│       ├── b2_gear_joint.h
│       ├── b2_growable_stack.h
│       ├── b2_joint.h
│       ├── b2_math.h
│       ├── b2_motor_joint.h
│       ├── b2_mouse_joint.h
│       ├── b2_polygon_shape.h
│       ├── b2_prismatic_joint.h
│       ├── b2_pulley_joint.h
│       ├── b2_revolute_joint.h
│       ├── b2_rope.h
│       ├── b2_settings.h
│       ├── b2_shape.h
│       ├── b2_stack_allocator.h
│       ├── b2_time_of_impact.h
│       ├── b2_timer.h
│       ├── b2_time_step.h
│       ├── b2_types.h
│       ├── b2_weld_joint.h
│       ├── b2_wheel_joint.h
│       ├── b2_world_callbacks.h
│       ├── b2_world.h
│       └── box2d.h
└── lib
    ├── cmake
    │   └── box2d
    │       ├── box2dConfig.cmake
    │       ├── box2dConfig-release.cmake
    │       └── box2dConfigVersion.cmake
    └── libbox2d.a

6 directories, 44 files

new version:

[nix-shell:~/nixpkgs]$ tree /nix/store/if07h00dhj0xw8dkcfc0kxr1y6z2bf28-box2d-3.0.0
/nix/store/if07h00dhj0xw8dkcfc0kxr1y6z2bf28-box2d-3.0.0
└── lib
    └── libbox2d.a

2 directories, 1 file

@ofborg ofborg bot requested review from 7c6f434c and guibou September 15, 2024 11:07
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 27, 2024
@atomicptr
Copy link

Considering box2d 3.0 is not compatible with the 2.x version (which has been renamed to box2d-lite https://github.com/erincatto/box2d-lite), it would probably be nice to have box2d-lite also available when this gets merged to make migrations easier on the projects that depend on the current 2.x version.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Oct 6, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants