-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/mirtest-internal-dev
- Loading branch information
Showing
36 changed files
with
689 additions
and
463 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Refresh downstreams | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Refresh: | ||
runs-on: ubuntu-latest | ||
|
||
timeout-minutes: 5 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ref: | ||
- core24 | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
# so that we know what to cherry-pick from | ||
fetch-depth: 2 | ||
|
||
- name: Update `${{ matrix.ref }}` | ||
env: | ||
GIT_COMMITTER_NAME: "Mir CI Bot" | ||
GIT_COMMITTER_EMAIL: "[email protected]" | ||
run: | | ||
# bring downstream changes on top of HEAD | ||
git fetch origin ${{ matrix.ref }} | ||
git cherry-pick HEAD..origin/${{ matrix.ref }} | ||
# and force-push to downstream | ||
git push --force origin HEAD:${{ matrix.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
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: | | ||
# work around https://github.com/actions/runner-images/issues/8846 | ||
sudo rm /etc/apt/sources.list.d/microsoft-prod.list | ||
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=$? | ||
cmake --build build --target check-mirserver-symbols-map || RET=$? | ||
exit $RET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,4 @@ cmake-* | |
build | ||
benchmarks/build | ||
|
||
tools/bot-data.tar.xz | ||
tools/symbols_map_generator/venv | ||
tools/bot-data.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
usr/lib/*/libmirserver.so.61 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright © Canonical Ltd. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 or 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef MIR_SIGNAL_H_ | ||
#define MIR_SIGNAL_H_ | ||
|
||
#include <atomic> | ||
|
||
namespace mir | ||
{ | ||
/** | ||
* A thread-synchronisation barrier. | ||
* | ||
* The expected usage is that one thread sits in `wait()` until | ||
* signalled from another thread with `raise()`. | ||
* | ||
* This mechanism does not attempt to ensure that only one thread | ||
* is released per `raise()` or that each `raise()` unblocks only | ||
* one `wait()`. The only guarantees are that: | ||
* 1) At least one call to `raise()` strongly-happens-before | ||
* a call to `wait()` returns, and | ||
* 2) `wait()` will block until a call to `raise()` that | ||
* happens-after the most recent return from `wait()`. | ||
* | ||
* The primary use-case for such a barrier is to signal a | ||
* worker thread to run the next iteration of work. | ||
* | ||
* This is very similar to a `std::binary_semaphore` but | ||
* without the precondition that `raise()` is not called | ||
* if the Signal is already raised. | ||
*/ | ||
class Signal | ||
{ | ||
public: | ||
Signal(); | ||
|
||
/** | ||
* Raise the signal, releasing any thread in `wait()` | ||
* | ||
* This does not synchronise with any other call to `raise()` | ||
* This synchronises-with a subsequent call to `wait()`, but does | ||
* not guarantee that each call to `raise()` releases at least one | ||
* `wait()`. | ||
* | ||
* Two unsynchronised calls to `raise()` may result in either one | ||
* or two calls to `wait()` being unblocked, depending on timing. | ||
*/ | ||
void raise(); | ||
|
||
/** | ||
* Wait for the signal to be raised | ||
* | ||
* This synchronises-with a previous call to `raise()`, and | ||
* then resets the signal. | ||
*/ | ||
void wait(); | ||
private: | ||
std::atomic<bool> raised; | ||
}; | ||
} | ||
|
||
#endif // MIR_SIGNAL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright © Canonical Ltd. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 or 3 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef MIRAL_CUSTOM_RENDERER_H | ||
#define MIRAL_CUSTOM_RENDERER_H | ||
|
||
#include <memory> | ||
#include <functional> | ||
|
||
namespace mir | ||
{ | ||
class Server; | ||
namespace graphics | ||
{ | ||
class GLRenderingProvider; | ||
namespace gl | ||
{ | ||
class OutputSurface; | ||
} | ||
} | ||
namespace renderer | ||
{ | ||
class Renderer; | ||
} | ||
} | ||
|
||
namespace miral | ||
{ | ||
|
||
class CustomRenderer | ||
{ | ||
public: | ||
using Builder = std::function< | ||
std::unique_ptr<mir::renderer::Renderer>( | ||
std::unique_ptr<mir::graphics::gl::OutputSurface>, std::shared_ptr<mir::graphics::GLRenderingProvider>) | ||
>; | ||
|
||
explicit CustomRenderer(Builder&& renderer); | ||
void operator()(mir::Server& server) const; | ||
private: | ||
struct Self; | ||
std::shared_ptr<Self> self; | ||
}; | ||
} | ||
|
||
#endif //MIRAL_CUSTOM_RENDERER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright © Canonical Ltd. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 or 3, | ||
* as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "mir/signal.h" | ||
|
||
mir::Signal::Signal() | ||
: raised{false} | ||
{ | ||
} | ||
|
||
void mir::Signal::raise() | ||
{ | ||
raised = true; | ||
raised.notify_all(); | ||
} | ||
|
||
void mir::Signal::wait() | ||
{ | ||
raised.wait(false); | ||
raised = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.