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

Bazel updates #2696

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Bazel updates #2696

merged 1 commit into from
Aug 7, 2024

Conversation

louwers
Copy link
Collaborator

@louwers louwers commented Aug 6, 2024

  • Update Bazel
  • Update Bazel dependencies
  • Get rid of WORKSPACE so Renovate can auto-update

@louwers louwers requested review from keith and mwilsnd August 6, 2024 22:44
@louwers louwers added the build Related to build, configuration or CI/CD label Aug 6, 2024
@louwers louwers enabled auto-merge (squash) August 6, 2024 22:45
Copy link
Collaborator

@keith keith left a comment

Choose a reason for hiding this comment

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

nice!

@louwers
Copy link
Collaborator Author

louwers commented Aug 6, 2024

@keith Apparently auto-updates don't work when you have both a WORKSPACE and a MODULE.bzl. It is a miracle everything still worked. Hehe.

@louwers louwers requested a review from HarelM August 6, 2024 23:18
Copy link

github-actions bot commented Aug 6, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  -5.9%  -808Ki  -5.9%  -800Ki    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2696-compared-to-main.txt

@louwers louwers merged commit b392e4a into maplibre:main Aug 7, 2024
24 of 27 checks passed
@louwers louwers deleted the bazel-updates branch August 7, 2024 09:51
@bdon
Copy link

bdon commented Jan 2, 2025

Are there any guidelines on how to make this build work with MacPorts? I don't have Homebrew meaning libuv as defined in MODULE.bazel cannot be found.

@louwers
Copy link
Collaborator Author

louwers commented Jan 2, 2025

@bdon You can also use CMake to build for macOS. I can write some instructions.

@bdon
Copy link

bdon commented Jan 4, 2025

That would be really helpful. I was attempting to patch MODULE.bazel with something like this:

new_local_repository(
    name = "libuv",
    build_file_content = """
cc_library(
    name = "libuv",
    hdrs = [
        "include/uv.h",
        "include/uv/darwin.h",
        "include/uv/errno.h",
        "include/uv/threadpool.h",
        "include/uv/unix.h",
        "include/uv/version.h",
    ],
    srcs = [
        "lib/libuv.a",  # Static library from MacPorts
    ],
    includes = ["include"],
    visibility = ["//visibility:public"],
)
""",
    path = "/opt/local",  # MacPorts path for libuv
)

But haven't had any success yet.

@louwers
Copy link
Collaborator Author

louwers commented Jan 4, 2025

The GLFW app crashes on macOS with Metal if you use CFRunLoop. I haven't been able to figure out why, that is why I changed the macOS Bazel build config to use libuv. Ideally we change it to compile libuv from source instead...

Anyway, if you the CMake build config uses CFRunLoop. As said the GLFW app crashes when used with Metal. But if you have MoltenVK installed you can use Vulkan instead...

cmake -S . -B build-macos-vulkan -GNinja \
  -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/homebrew/bin/ccache \
  -DMLN_WITH_OPENGL=OFF \
  -DMLN_WITH_METAL=OFF \
  -DMLN_WITH_VULKAN=ON \
  -DMLN_LEGACY_RENDERER=OFF \
  -DMLN_DRAWABLE_RENDERER=ON \
  -DMLN_WITH_WERROR=OFF \
  -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build-macos-vulkan
build-macos-vulkan/platform/glfw/mbgl-glfw --style "https://tiles.openfreemap.org/styles/liberty"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to build, configuration or CI/CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants