Skip to content

Commit

Permalink
Merge branch 'feature/symbols_generator' into feature/mirserver-inter…
Browse files Browse the repository at this point in the history
…nal-dev
  • Loading branch information
mattkae committed Apr 23, 2024
2 parents ce81418 + 459f8bb commit e39742d
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 138 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/symbols-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Symbols Check

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.ref_name }}
cancel-in-progress: true

jobs:
Run:
runs-on: ubuntu-latest

timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Install dependencies
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository --update "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
sudo apt install libclang1-19
sudo apt install python3-clang-19
echo "MIR_SYMBOLS_MAP_GENERATOR_CLANG_SO_PATH=/usr/lib/llvm-19/lib/libclang-19.so.1" >> $GITHUB_ENV
echo "MIR_SYMBOLS_MAP_GENERATOR_CLANG_LIBRARY_PATH=/usr/lib/llvm-19/lib" >> $GITHUB_ENV
sudo apt-get build-dep ./
- name: Configure
run: >
cmake -B build ${{ github.workspace }}
- name: Check symbols
run: |
RET=0
cmake --build build --target check-miral-symbols-map || RET=$?
cmake --build build --target check-miroil-symbols-map || RET=$?
exit $RET
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ build
benchmarks/build

tools/bot-data.tar.xz
tools/symbols_map_generator/venv
16 changes: 13 additions & 3 deletions src/miral/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,23 @@ add_custom_target(regenerate-miral-debian-symbols ${MIR_CHECK_MIRAL_SYMBOLS_DEFA

add_custom_target(
generate-miral-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/run.sh
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name miral
--version ${MIRAL_VERSION}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--external-headers-directory="${PROJECT_SOURCE_DIR}/include/miral"
--include_dirs "$<JOIN:$<TARGET_PROPERTY:miral,INCLUDE_DIRECTORIES>,:>"
--output_symbols
--include-dirs "$<JOIN:$<TARGET_PROPERTY:miral,INCLUDE_DIRECTORIES>,:>"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

add_custom_target(
check-miral-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name miral
--version ${MIRAL_VERSION}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--external-headers-directory="${PROJECT_SOURCE_DIR}/include/miral"
--include-dirs "$<JOIN:$<TARGET_PROPERTY:miral,INCLUDE_DIRECTORIES>,:>"
--diff
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

configure_file(
Expand Down
32 changes: 0 additions & 32 deletions src/miral/symbols.map
Original file line number Diff line number Diff line change
Expand Up @@ -446,44 +446,12 @@ global:
typeinfo?for?miral::WindowSpecification;
typeinfo?for?miral::X11Support;
typeinfo?for?miral::Zone;
vtable?for?miral::AddInitCallback;
vtable?for?miral::AppendEventFilter;
vtable?for?miral::ApplicationAuthorizer;
vtable?for?miral::ApplicationCredentials;
vtable?for?miral::ApplicationInfo;
vtable?for?miral::BasicSetApplicationAuthorizer;
vtable?for?miral::CanonicalWindowManagerPolicy;
vtable?for?miral::ConfigurationOption;
vtable?for?miral::CursorTheme;
vtable?for?miral::DisplayConfiguration;
vtable?for?miral::ExternalClientLauncher;
vtable?for?miral::FdHandle;
vtable?for?miral::InternalClientLauncher;
vtable?for?miral::Keymap;
vtable?for?miral::MinimalWindowManager;
vtable?for?miral::MirRunner;
vtable?for?miral::Output::PhysicalSizeMM;
vtable?for?miral::Output;
vtable?for?miral::PrependEventFilter;
vtable?for?miral::SessionLockListener;
vtable?for?miral::SetCommandLineHandler;
vtable?for?miral::SetTerminator;
vtable?for?miral::SetWindowManagementPolicy;
vtable?for?miral::StartupInternalClient;
vtable?for?miral::WaylandExtensions::Builder;
vtable?for?miral::WaylandExtensions::Context;
vtable?for?miral::WaylandExtensions::EnableInfo;
vtable?for?miral::WaylandExtensions;
vtable?for?miral::Window;
vtable?for?miral::WindowInfo;
vtable?for?miral::WindowManagementPolicy;
vtable?for?miral::WindowManagerOption;
vtable?for?miral::WindowManagerOptions;
vtable?for?miral::WindowManagerTools;
vtable?for?miral::WindowSpecification::AspectRatio;
vtable?for?miral::WindowSpecification;
vtable?for?miral::X11Support;
vtable?for?miral::Zone;
};
local: *;
};
Expand Down
16 changes: 13 additions & 3 deletions src/miroil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,23 @@ endif()

add_custom_target(
generate-miroil-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/run.sh
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name miroil
--version ${MIROIL_VERSION}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--external-headers-directory="${PROJECT_SOURCE_DIR}/include/miroil"
--include_dirs "$<JOIN:$<TARGET_PROPERTY:miroil,INCLUDE_DIRECTORIES>,:>"
--output_symbols
--include-dirs "$<JOIN:$<TARGET_PROPERTY:miroil,INCLUDE_DIRECTORIES>,:>"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

add_custom_target(
check-miroil-symbols-map
COMMAND ${PROJECT_SOURCE_DIR}/tools/symbols_map_generator/main.py
--library-name miroil
--version ${MIROIL_VERSION}
--symbols-map-path="${CMAKE_CURRENT_SOURCE_DIR}/symbols.map"
--external-headers-directory="${PROJECT_SOURCE_DIR}/include/miroil"
--include-dirs "$<JOIN:$<TARGET_PROPERTY:miroil,INCLUDE_DIRECTORIES>,:>"
--diff
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")

install(TARGETS miroil LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
Expand Down
18 changes: 0 additions & 18 deletions src/miroil/symbols.map
Original file line number Diff line number Diff line change
Expand Up @@ -129,29 +129,11 @@ global:
typeinfo?for?miroil::Surface;
typeinfo?for?miroil::SurfaceObserver;
vtable?for?miroil::Compositor;
vtable?for?miroil::DisplayConfigurationControllerWrapper;
vtable?for?miroil::DisplayConfigurationOptions::DisplayMode;
vtable?for?miroil::DisplayConfigurationOptions;
vtable?for?miroil::DisplayConfigurationPolicy;
vtable?for?miroil::DisplayConfigurationStorage;
vtable?for?miroil::DisplayId;
vtable?for?miroil::DisplayListenerWrapper;
vtable?for?miroil::Edid::Descriptor;
vtable?for?miroil::Edid::PhysicalSizeMM;
vtable?for?miroil::Edid;
vtable?for?miroil::EventBuilder::EventInfo;
vtable?for?miroil::EventBuilder;
vtable?for?miroil::GLBuffer;
vtable?for?miroil::InputDevice;
vtable?for?miroil::InputDeviceObserver;
vtable?for?miroil::MirPromptSession;
vtable?for?miroil::MirServerHooks;
vtable?for?miroil::OpenGLContext;
vtable?for?miroil::PersistDisplayConfig;
vtable?for?miroil::PromptSessionListener;
vtable?for?miroil::PromptSessionManager;
vtable?for?miroil::SetCompositor;
vtable?for?miroil::Surface;
vtable?for?miroil::SurfaceObserver;
};
local: *;
Expand Down
4 changes: 2 additions & 2 deletions tools/symbols_map_generator/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Symbols Map Generator
This tool parses the header files of a library in the Mir project to extract symbols.
These symbols can then either be outputted to `stdout` to display a diff or to the
corresponding `symbols.map` file.
These symbols are outputted to a corresponding `symbols.map` file by default. If the `--diff`
option is provided, then the added and removed symbols will be printed to `stdout`.

## Usage
It is recommended that the script be run from a python venv:
Expand Down
Loading

0 comments on commit e39742d

Please sign in to comment.