Skip to content

Commit

Permalink
[MED] ALPHA 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
nots1dd committed Jan 29, 2025
1 parent 9f84cd0 commit d2a51e6
Show file tree
Hide file tree
Showing 17 changed files with 876 additions and 604 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/inLimbo-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Building the inLimbo project (x86 arch - GCC) (x86 arch - Clang) in Ubuntu"

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v2

# Install dependencies
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake libtag1-dev git libglib2.0-dev imagemagick libx11-dev libpng-dev libcereal-dev libgtest-dev ffmpeg
- name: Build the inLimbo project ==> (x86 arch - GCC)
run: |
make build-all CMAKE_EXTRA_FLAGS="-D CMAKE_CXX_COMPILER=c++"
- name: Build the inLimbo project ==> (x86 arch - Clang)
run: |
make build-all CMAKE_EXTRA_FLAGS="-D CMAKE_CXX_COMPILER=clang++"
- name: Clean up
run: rm -rf build
19 changes: 19 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ You can build the inLimbo in two ways:
1. Makefile (uses CMake)
2. Manually building using CMake commands

> [!NOTE]
>
> If you want to use a custom compiler rather than the default compiler defined in:
> `CMAKE_CXX_COMPILER` macro by CMake,
>
> Append `CMAKE_EXTRA_FLAGS="-D CMAKE_CXX_COMPILER=/path/to/your/compiler"` to the make command like so:
>
> ```bash
> # Let us say I want to compile using clang++:
> make build CMAKE_EXTRA_FLAGS="-D CMAKE_CXX_COMPILER=clang++"
> # To rebuild
> make rebuild
> ```
>
> The CMAKE_EXTRA_FLAGS macro is passable to `build`, `build-all`, `asan`, `build-test`, `build-test-all`, `tsan`.
>
> There is some issue where clang++ starts a scratch compilation even though the build files are present and only a few source files are changed.
>
## Available Build Targets
### 1. **all**
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -918,3 +918,40 @@ Small commit with some neat build changes that makes life pretty easy
- Centering of the image_view (NOT THAT BIG)

---

## [ALPHA 2.8] --- 29-01-2025

### Added
- New workflow to build in g++ and clang++ (x86 arch)

### Changed
- Makefile now gives the option to compile to any desired c++ compiler

- General code refactor + minor issues fix mainly in ui_handler

- UI overhaul + updates to several render functions

- New function in miniaudio class to show case more details regarding the miniaudio engine, device config etc..

- Artist menu is now a scroller base component not a menu anymore

- New colors and keybinds fields (more updates soon)

### Fixed
- Minor issue of a song first loading with full volume by default before getting updated (would sound weird and jarring)

### Removed
-

Medium commit with some refactoring and small, nice QOL changes

### Known Issues to fix in immediate commits
- Holding the keybind for PlayNextSong() / PlayPrevSong() doesnt break anything, but MiniAudioPlayer class is not as responsive as the UI, so it lags behind (MAJOR ISSUE)

(The outcome of the above issue would be that if you hold PlayNextSong() func call and it goes to Song A, the MiniAudioPlayer might still be playing Song B, which appears BEFORE Song A)

- Centering of the image_view (NOT THAT BIG)

- Fixing current_position bug when run refresh thread is woken up a lot of times (BIG)

---
51 changes: 24 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,41 +64,38 @@ add_executable(${EXECUTABLE_NAME}
target_include_directories(${EXECUTABLE_NAME} PRIVATE src)

# --- Debugging Flags --------------------------------------------------------
# Add debugging flags for better error reporting, debugging, and sanitization

if(CMAKE_BUILD_TYPE STREQUAL "Debug-ASan")
# Enable AddressSanitizer
set(INLIMBO_DEBUG_BUILD ON)
message(STATUS "Enabling AddressSanitizer for Debug-AddressSanitizer build")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")

target_compile_options(${EXECUTABLE_NAME} PRIVATE
-fsanitize=address
-fsanitize=undefined
-g
-Wall
-Wextra
)

target_link_options(${EXECUTABLE_NAME} PRIVATE
-fsanitize=address
)

# Enable UndefinedBehaviorSanitizer (UBSan)
message(STATUS "Enabling UndefinedBehaviorSanitizer for Debug-AddressSanitizer build")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")

# Enable Debug Symbols
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

# Enable all warnings and treat them as errors
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")

elseif(CMAKE_BUILD_TYPE STREQUAL "Debug-TSan")
set(INLIMBO_DEBUG_BUILD ON)
# Enable ThreadSanitizer
message(STATUS "Enabling ThreadSanitizer for Debug-ThreadSanitizer build")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")

# Enable UndefinedBehaviorSanitizer (UBSan)
message(STATUS "Enabling UndefinedBehaviorSanitizer for Debug-ThreadSanitizer build")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")

# Enable Debug Symbols
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

# Enable all warnings and treat them as errors
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")

target_compile_options(${EXECUTABLE_NAME} PRIVATE
-fsanitize=thread
-fsanitize=undefined
-g
-Wall
-Wextra
)

target_link_options(${EXECUTABLE_NAME} PRIVATE
-fsanitize=thread
)

else()
message(STATUS "Skipping Sanitizers for Release build")
Expand Down
40 changes: 20 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Makefile for the inLimbo Project
# Makefile for the inLimbo project

# Variables
BUILD_DIR := build
BUILD_DIR_DBG_ASAN := build-dbg-asan
BUILD_DIR_DBG_TSAN := build-dbg-tsan
BUILD_DBG_ASAN_DIR := build-dbg-asan
BUILD_DBG_TSAN_DIR := build-dbg-tsan
BUILD_GLOBAL := GLOBAL_BUILD
EXECUTABLE := inLimbo
CMAKE := cmake
CMAKE_BUILD_TYPE := Release
SCRIPT := ./init.sh
TEST_SUITE_SCRIPT := ./run_tests.sh
VERBOSE_FLAG := VERBOSE=1
TESTING_FLAG := INLIMBO_TESTING
TESTING_FLAG := -DINLIMBO_TESTING
GLOBAL_FLAG := -DBUILD_GLOBAL
CLANG_FLAG := -DUSE_CLANG
INSTALL_MANIFEST := $(BUILD_DIR)/install_manifest.txt
CMAKE_EXTRA_FLAGS ?= # Default empty, set dynamically

# Targets
.PHONY: all build clean rebuild build-all init asan tsan build-global build-test build-test-all build-global-uninstall
Expand All @@ -24,20 +23,21 @@ all: build-all
build-test-all:
@echo "==> Building inLimbo with script and tests using GTest..."
$(SCRIPT)
$(MAKE) build-test
$(MAKE) build-test CMAKE_EXTRA_FLAGS="$(CMAKE_EXTRA_FLAGS)"

build-test:
$(CMAKE) -S . -B $(BUILD_DIR) -D $(TESTING_FLAG)=ON -D $(BUILD_GLOBAL)=OFF
$(CMAKE) -S . -B $(BUILD_DIR) $(TESTING_FLAG)=ON $(GLOBAL_FLAG)=OFF $(CMAKE_EXTRA_FLAGS)
$(CMAKE) --build $(BUILD_DIR)

build-all:
@echo "==> Running initialization script..."
$(SCRIPT)
$(MAKE) build
@echo "==> Running initialization script..."
$(SCRIPT)
$(MAKE) build CMAKE_EXTRA_FLAGS="$(CMAKE_EXTRA_FLAGS)"

build:
@echo "==> Fresh Building inLimbo with $(CMAKE_BUILD_TYPE)..."
$(CMAKE) -S . -B build $(BUILD_DIR) -D $(TESTING_FLAG)=OFF -D $(BUILD_GLOBAL)=OFF
rm -rf $(BUILD_DIR)
$(CMAKE) -S . -B $(BUILD_DIR) $(TESTING_FLAG)=OFF $(GLOBAL_FLAG)=OFF $(CMAKE_EXTRA_FLAGS)
$(CMAKE) --build $(BUILD_DIR)

rebuild:
Expand All @@ -48,35 +48,35 @@ asan:
@echo "==> Building in AddressSanitizer mode..."
$(MAKE) init
mkdir -p $(BUILD_DIR_DBG_ASAN)
cmake -S . -B $(BUILD_DIR_DBG_ASAN) -DCMAKE_BUILD_TYPE=Debug-ASan
cmake -S . -B $(BUILD_DIR_DBG_ASAN) -DCMAKE_BUILD_TYPE=Debug-ASan $(CMAKE_EXTRA_FLAGS)
cmake --build $(BUILD_DIR_DBG_ASAN)

asan_run: asan
@echo "==> Running AddressSanitizer build..."
$(BUILD_DIR)/inLimbo-DBG-Asan
$(BUILD_DIR_DBG_ASAN)/$(EXECUTABLE)

tsan:
@echo "==> Building in ThreadSanitizer mode..."
$(MAKE) init
mkdir -p $(BUILD_DIR_DBG_TSAN)
cmake -S . -B $(BUILD_DIR_DBG_TSAN) -DCMAKE_BUILD_TYPE=Debug-TSan
cmake -S . -B $(BUILD_DIR_DBG_TSAN) -DCMAKE_BUILD_TYPE=Debug-TSan $(CMAKE_EXTRA_FLAGS)
cmake --build $(BUILD_DIR_DBG_TSAN)

tsan_run: tsan
@echo "==> Running ThreadSanitizer build..."
$(BUILD_DIR)/inLimbo-DBG-TSan
$(BUILD_DIR_DBG_TSAN)/$(EXECUTABLE)

clean:
@echo "==> Cleaning build directory..."
rm -rf $(BUILD_DIR)
rm -rf $(BUILD_DIR) $(BUILD_DIR_DBG_ASAN) $(BUILD_DIR_DBG_TSAN)

init:
@echo "==> Running initialization script..."
$(SCRIPT)

build-global:
@echo "==> Building inLimbo GLOBALLY and installing..."
$(CMAKE) -S . -B build $(BUILD_DIR) -D $(TESTING_FLAG)=OFF -D $(BUILD_GLOBAL)=ON
$(CMAKE) -S . -B $(BUILD_DIR) $(TESTING_FLAG)=OFF $(GLOBAL_FLAG)=ON $(CMAKE_EXTRA_FLAGS)
$(CMAKE) --build $(BUILD_DIR)
cd $(BUILD_DIR) && sudo $(MAKE) install

Expand All @@ -92,8 +92,8 @@ build-global-uninstall:

verbose:
@echo "==> Building with verbose output..."
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && $(CMAKE) -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) .. && $(NINJA) $(VERBOSE_FLAG)
cmake -S . -B $(BUILD_DIR) $(CMAKE_EXTRA_FLAGS) --trace
cmake --build $(BUILD_DIR) -v

run-tests:
$(TEST_SUITE_SCRIPT)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7 - ALPHA
2.8 - ALPHA
5 changes: 3 additions & 2 deletions src/arg-handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

// Constants
constexpr const char* DBUS_SERVICE_NAME =
"org.mpris.MediaPlayer2.inLimbo"; ///< DBus service name used by inLimbo.
constexpr const char* VERSION = "2.7 (ALPHA)"; ///< Current version of the application.
"org.mpris.MediaPlayer2.inLimbo"; ///< DBus service name used by inLimbo.
constexpr const char* VERSION = "2.7 (ALPHA)"; ///< Current version of the application.
constexpr const char* REPOSITORY_URL = "https://github.com/nots1dd/inLimbo";

bool shouldRunApp =
false; ///< Indicates if the application should proceed to run after handling arguments.
Expand Down
Loading

0 comments on commit d2a51e6

Please # to comment.