From bcddbb17f3c7ab1ffbbb0486d7839c92c0c85996 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 25 Sep 2025 11:44:14 -0300 Subject: [PATCH 01/12] [ci] license-header.sh: Make it POSIX-compliant! Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 281 +++++++++++++++++++++++++----------------- 1 file changed, 171 insertions(+), 110 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 3d4929d1c1..9e70188971 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -1,145 +1,206 @@ #!/bin/sh -e -HEADER="$(cat "$PWD/.ci/license/header.txt")" -HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later -echo "Getting branch changes" +COPYRIGHT_YEAR="2025" +COPYRIGHT_OWNER="Eden Emulator Project" +COPYRIGHT_LICENSE="GPL-3.0-or-later" -# BRANCH=`git rev-parse --abbrev-ref HEAD` -# COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"` -# RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}" -# FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r` +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + echo + echo "license-header.sh: Eden License Headers Accreditation Script" + echo + echo "This script checks and optionally fixes license headers in source, CMake and shell script files." + echo + echo "Environment Variables:" + echo " FIX=true | Automatically add the correct license headers to offending files." + echo " UPDATE=true | Automatically update current license headers of offending files." + echo " COMMIT=true | If FIX=true, commit the changes automatically." + echo + echo "Usage Examples:" + echo " # Just check headers (will fail if headers are missing)" + echo " .ci/license-header.sh" + echo + echo " # Fix headers only" + echo " FIX=true .ci/license-header.sh" + echo + echo " # Update headers only" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true .ci/license-header.sh" + echo + echo " # Fix headers and commit changes" + echo " FIX=true COMMIT=true .ci/license-header.sh" + echo + echo " # Update headers and commit changes" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true COMMIT=true .ci/license-header.sh" + exit 0 +fi -BASE=`git merge-base master HEAD` -FILES=`git diff --name-only $BASE` +SRC_FILES="" +OTHER_FILES="" -#FILES=$(git diff --name-only master) +BASE=$(git merge-base master HEAD) +if git diff --quiet "$BASE"..HEAD; then + echo + echo "license-header.sh: No commits on this branch different from master." + exit 0 +fi +FILES=$(git diff --name-only "$BASE") -echo "Done" - -check_header() { - CONTENT="`head -n3 < $1`" - case "$CONTENT" in - "$HEADER"*) ;; - *) BAD_FILES="$BAD_FILES $1" ;; - esac +echo_header() { + COMMENT_TYPE="$1" + echo "$COMMENT_TYPE SPDX-FileCopyrightText: Copyright $COPYRIGHT_YEAR $COPYRIGHT_OWNER" + echo "$COMMENT_TYPE SPDX-License-Identifier: $COPYRIGHT_LICENSE" } -check_cmake_header() { - CONTENT="`head -n3 < $1`" - - case "$CONTENT" in - "$HEADER_HASH"*) ;; - *) - BAD_CMAKE="$BAD_CMAKE $1" ;; - esac -} for file in $FILES; do [ -f "$file" ] || continue - if [ `basename -- "$file"` = "CMakeLists.txt" ]; then - check_cmake_header "$file" + case "$(basename "$file")" in + CMakeLists.txt) + COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac ;; + esac + + HEADER=$(echo_header "$COMMENT_TYPE") + HEAD_LINES=$(head -n5 "$file") + + CORRECT_COPYRIGHT=$(echo "$HEAD_LINES" | awk \ + -v line1="$(echo "$HEADER" | sed -n '1p')" \ + -v line2="$(echo "$HEADER" | sed -n '2p')" \ + '($0==line1){getline; if($0==line2){f=1}else{f=0}} END{print (f?f:0)}') + + if [ "$CORRECT_COPYRIGHT" != "1" ]; then + case "$COMMENT_TYPE" in + "//") SRC_FILES="$SRC_FILES $file" ;; + "#") OTHER_FILES="$OTHER_FILES $file" ;; + esac + fi +done + +if [ -z "$SRC_FILES" ] && [ -z "$OTHER_FILES" ]; then + echo + echo "license-header.sh: All good!" + exit 0 +fi + +for TYPE in "SRC" "OTHER"; do + if [ "$TYPE" = "SRC" ] && [ -n "$SRC_FILES" ]; then + FILES_LIST="$SRC_FILES" + COMMENT_TYPE="//" + DESC="Source" + elif [ "$TYPE" = "OTHER" ] && [ -n "$OTHER_FILES" ]; then + FILES_LIST="$OTHER_FILES" + COMMENT_TYPE="#" + DESC="CMake and shell script" + else continue fi - EXTENSION="${file##*.}" - case "$EXTENSION" in - kts|kt|cpp|h) - check_header "$file" - ;; - cmake) - check_cmake_header "$file" - ;; - esac + echo + echo "------------------------------------------------------------" + echo "$DESC files" + echo "------------------------------------------------------------" + echo + echo " The following files contain incorrect license headers:" + for file in $FILES_LIST; do + echo " - $file" + done + + echo + echo " The correct license header to be added to all affected" + echo " '$DESC' files is:" + echo + echo "=== BEGIN ===" + echo_header "$COMMENT_TYPE" + echo "=== END ===" done -if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then - echo - echo "All good." - - exit -fi - -if [ "$BAD_FILES" != "" ]; then - echo "The following source files have incorrect license headers:" - echo - - for file in $BAD_FILES; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending SOURCE files: - -=== BEGIN === -$HEADER -=== END === - -EOF - -fi - -if [ "$BAD_CMAKE" != "" ]; then - echo "The following CMake files have incorrect license headers:" - echo - - for file in $BAD_CMAKE; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending CMake files: - -=== BEGIN === -$HEADER_HASH -=== END === - -EOF - -fi - cat << EOF -If some of the code in this PR is not being contributed by the original author, -the files which have been exclusively changed by that code can be ignored. -If this happens, this PR requirement can be bypassed once all other files are addressed. + +------------------------------------------------------------ + + If some of the code in this pull request was not contributed by the original + author, the files that have been modified exclusively by that code can be + safely ignored. In such cases, this PR requirement may be bypassed once all + other files have been reviewed and addressed. EOF -if [ "$FIX" = "true" ]; then - echo - echo "FIX set to true. Fixing headers." +TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo + echo "license-header.sh: FIX set to true, fixing headers..." - for file in $BAD_FILES; do - cat $file > $file.bak + for file in $SRC_FILES $OTHER_FILES; do + BASENAME=$(basename "$file") - cat .ci/license/header.txt > $file - echo >> $file - cat $file.bak >> $file + case "$BASENAME" in + CMakeLists.txt) COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac + ;; + esac - rm $file.bak + TMP="$TMP_DIR/$BASENAME.tmp" + UPDATED=0 + cp -p "$file" "$TMP" + > "$TMP" - git add $file + # this logic is bit hacky but sed don't work well with $VARIABLES + # it's this or complete remove this logic and keep only the old way + if [ "$UPDATE" = "true" ]; then + while IFS= read -r line || [ -n "$line" ]; do + if [ "$UPDATED" -eq 0 ] && echo "$line" | grep "$COPYRIGHT_OWNER" >/dev/null 2>&1; then + echo_header "$COMMENT_TYPE" >> "$TMP" + IFS= read -r _ || true + UPDATED=1 + else + echo "$line" >> "$TMP" + fi + done < "$file" + fi + + if [ "$UPDATED" -eq 0 ]; then + { + echo_header "$COMMENT_TYPE" + echo + cat "$TMP" + } > "$file" + else + mv "$TMP" "$file" + fi + + git add "$file" done - for file in $BAD_CMAKE; do - cat $file > $file.bak + rm -rf "$TMP_DIR" - cat .ci/license/header-hash.txt > $file - echo >> $file - cat $file.bak >> $file - - rm $file.bak - - git add $file - done - echo "License headers fixed." + echo + echo "license-header.sh: License headers fixed!" if [ "$COMMIT" = "true" ]; then echo - echo "COMMIT set to true. Committing changes." + echo "license-header.sh: COMMIT set to true, committing changes..." + + git commit -m "[license] Fix license headers [script]" + echo - - git commit -m "Fix license headers" - - echo "Changes committed. You may now push." + echo "license-header.sh: Changes committed. You may now push." fi else exit 1 From f6e35b4ff84d2ade6f92f36174d6787ac80234b7 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 26 Sep 2025 19:38:00 -0400 Subject: [PATCH 02/12] [ci] license-header.sh: add file exclusion capability Signed-off-by: crueter --- .ci/license-header.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 9e70188971..870555d533 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -3,6 +3,10 @@ # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later +# specify full path if dupes may exist +EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake" +EXCLUDE_FILES=$(echo "$EXCLUDE_FILES" | sed 's/ /|/g') + COPYRIGHT_YEAR="2025" COPYRIGHT_OWNER="Eden Emulator Project" COPYRIGHT_LICENSE="GPL-3.0-or-later" @@ -49,7 +53,7 @@ if git diff --quiet "$BASE"..HEAD; then echo "license-header.sh: No commits on this branch different from master." exit 0 fi -FILES=$(git diff --name-only "$BASE") +FILES=$(git diff --name-only "$BASE" | grep -E -v "$EXCLUDE_FILES") echo_header() { COMMENT_TYPE="$1" From 4300f65dc045c1d88a85c079ea14c931c82cd535 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sun, 28 Sep 2025 19:52:28 -0300 Subject: [PATCH 03/12] [ci] license-header.sh: Fix some shellcheck warnings Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 870555d533..ee775db01e 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -140,10 +140,10 @@ cat << EOF other files have been reviewed and addressed. EOF -TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +TMP_DIR=$(mktemp -d "/tmp/license-header.XXXXXX") || exit 1 if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo - echo "license-header.sh: FIX set to true, fixing headers..." + echo "license-header.sh: FIX or UPDATE set to true, fixing headers..." for file in $SRC_FILES $OTHER_FILES; do BASENAME=$(basename "$file") @@ -163,7 +163,7 @@ if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then TMP="$TMP_DIR/$BASENAME.tmp" UPDATED=0 cp -p "$file" "$TMP" - > "$TMP" + : > "$TMP" # this logic is bit hacky but sed don't work well with $VARIABLES # it's this or complete remove this logic and keep only the old way From 815d85677a78a1ea846a4da89a8df9ed3d060518 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Tue, 30 Sep 2025 02:51:48 +0200 Subject: [PATCH 04/12] CMake improvements: ccache, bundled Qt, MoltenVK, LTO, and Linux deps (#2622) - Fix YUZU_USE_BUNDLED_QT on Linux (correct path is gcc_64 for Qt 6.8.3). - Implement USE_CCACHE correctly (additional changes on #2580). - Categorize and organize CMake options for clarity. - Add missing Linux dependencies - Set CMP0069 (LTO) default behavior to NEW to reduce warnings. - Replace USE_SYSTEM_MOLTENVK with YUZU_APPLE_USE_BUNDLED_MONTENVK and remove duplicate download_moltenvk. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2622 Reviewed-by: MaranBr Reviewed-by: CamilleLaVey Co-authored-by: Caio Oliveira Co-committed-by: Caio Oliveira --- CMakeLists.txt | 124 +++++++++++------------ CMakeModules/DownloadExternals.cmake | 145 +++++++++++++++------------ docs/Deps.md | 2 +- docs/Options.md | 2 +- src/yuzu/CMakeLists.txt | 4 +- 5 files changed, 144 insertions(+), 133 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e48263063f..3599105020 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,65 +139,50 @@ endif() # Set bundled sdl2/qt as dependent options. # On Linux system SDL2 is likely to be lacking HIDAPI support which have drawbacks but is needed for SDL motion -CMAKE_DEPENDENT_OPTION(ENABLE_SDL2 "Enable the SDL2 frontend" ON "NOT ANDROID" OFF) - -set(EXT_DEFAULT OFF) - -if (MSVC OR ANDROID) - set(EXT_DEFAULT ON) -endif() +cmake_dependent_option(ENABLE_SDL2 "Enable the SDL2 frontend" ON "NOT ANDROID" OFF) if (ENABLE_SDL2) # TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system - CMAKE_DEPENDENT_OPTION(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "NOT MSVC" OFF) + cmake_dependent_option(YUZU_USE_EXTERNAL_SDL2 "Compile external SDL2" OFF "NOT MSVC" OFF) option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}") endif() +option(ENABLE_QT "Enable the Qt frontend" ON) +option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) +option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF) +cmake_dependent_option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF) +option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) +option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) +set(YUZU_QT_MIRROR "" CACHE STRING "What mirror to use for downloading the bundled Qt libraries") + +option(ENABLE_CUBEB "Enables the cubeb audio backend" ON) + +set(EXT_DEFAULT OFF) +if (MSVC OR ANDROID) + set(EXT_DEFAULT ON) +endif() +option(YUZU_USE_CPM "Use CPM to fetch system dependencies (fmt, boost, etc) if needed. Externals will still be fetched." ${EXT_DEFAULT}) + +option(YUZU_USE_BUNDLED_FFMPEG "Download bundled FFmpeg" ${EXT_DEFAULT}) +cmake_dependent_option(YUZU_USE_EXTERNAL_FFMPEG "Build FFmpeg from source" OFF "NOT WIN32 AND NOT ANDROID" OFF) + cmake_dependent_option(ENABLE_LIBUSB "Enable the use of LibUSB" ON "NOT ANDROID" OFF) cmake_dependent_option(ENABLE_OPENGL "Enable OpenGL" ON "NOT WIN32 OR NOT ARCHITECTURE_arm64" OFF) mark_as_advanced(FORCE ENABLE_OPENGL) -option(ENABLE_QT "Enable the Qt frontend" ON) -option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF) -option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF) - -CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF) - -option(YUZU_USE_CPM "Use CPM to fetch system dependencies (fmt, boost, etc) if needed. Externals will still be fetched." ${EXT_DEFAULT}) - option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF) -option(YUZU_USE_BUNDLED_FFMPEG "Download bundled FFmpeg" ${EXT_DEFAULT}) -cmake_dependent_option(YUZU_USE_EXTERNAL_FFMPEG "Build FFmpeg from source" OFF "NOT WIN32 AND NOT ANDROID" OFF) - -option(YUZU_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) - -option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) - -set(YUZU_QT_MIRROR "" CACHE STRING "What mirror to use for downloading the bundled Qt libraries") - -option(ENABLE_CUBEB "Enables the cubeb audio backend" ON) - -CMAKE_DEPENDENT_OPTION(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF "ENABLE_QT" OFF) +cmake_dependent_option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF "ENABLE_QT" OFF) option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}") -option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ${EXT_DEFAULT}) - -# TODO(crueter): CI this? -option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON) - - -CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Enable dedicated room functionality" ON "NOT ANDROID" OFF) - -CMAKE_DEPENDENT_OPTION(YUZU_ROOM_STANDALONE "Enable standalone room executable" ON "YUZU_ROOM" OFF) - -CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL2;NOT ANDROID" OFF) - -CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF) - +option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF) +if (YUZU_USE_PRECOMPILED_HEADERS) + message(STATUS "Using Precompiled Headers.") + set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) +endif() option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF) if(YUZU_ENABLE_LTO) include(CheckIPOSupported) @@ -205,17 +190,42 @@ if(YUZU_ENABLE_LTO) if(NOT COMPILER_SUPPORTS_LTO) message(FATAL_ERROR "Your compiler does not support interprocedural optimization (IPO). Re-run CMake with -DYUZU_ENABLE_LTO=OFF.") endif() + set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ${COMPILER_SUPPORTS_LTO}) endif() +option(USE_CCACHE "Use ccache for compilation" OFF) +set(CCACHE_PATH "ccache" CACHE STRING "Path to ccache binary") +if(USE_CCACHE) + find_program(CCACHE_BINARY ${CCACHE_PATH}) + if(CCACHE_BINARY) + message(STATUS "Found ccache at: ${CCACHE_BINARY}") + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_BINARY}) + if (YUZU_USE_PRECOMPILED_HEADERS) + message(FATAL_ERROR "Precompiled headers are incompatible with ccache. Re-run CMake with -DYUZU_USE_PRECOMPILED_HEADERS=OFF.") + endif() + else() + message(WARNING "USE_CCACHE enabled, but no executable found at: ${CCACHE_PATH}") + endif() +endif() + +# TODO(crueter): CI this? +option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON) + +cmake_dependent_option(YUZU_ROOM "Enable dedicated room functionality" ON "NOT ANDROID" OFF) +cmake_dependent_option(YUZU_ROOM_STANDALONE "Enable standalone room executable" ON "YUZU_ROOM" OFF) + +cmake_dependent_option(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL2;NOT ANDROID" OFF) + +cmake_dependent_option(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF) option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" ON) - -CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "LINUX" OFF) - -CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF) - set(YUZU_TZDB_PATH "" CACHE STRING "Path to a pre-downloaded timezone database") +cmake_dependent_option(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "LINUX" OFF) + +cmake_dependent_option(YUZU_APPLE_USE_BUNDLED_MONTENVK "Download bundled MoltenVK lib" ON "APPLE" OFF) + option(YUZU_DISABLE_LLVM "Disable LLVM (useful for CI)" OFF) set(DEFAULT_ENABLE_OPENSSL ON) @@ -228,15 +238,12 @@ if (ANDROID OR WIN32 OR APPLE OR PLATFORM_SUN) # your own copy of it. set(DEFAULT_ENABLE_OPENSSL OFF) endif() - if (ENABLE_WEB_SERVICE) set(DEFAULT_ENABLE_OPENSSL ON) endif() - option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) - if (ENABLE_OPENSSL) - CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_OPENSSL "Download bundled OpenSSL build" "${MSVC}" "NOT ANDROID" ON) + cmake_dependent_option(YUZU_USE_BUNDLED_OPENSSL "Download bundled OpenSSL build" "${MSVC}" "NOT ANDROID" ON) endif() if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL) @@ -263,21 +270,6 @@ if (ANDROID) set(CMAKE_POLICY_VERSION_MINIMUM 3.5) # Workaround for Oboe endif() -if (YUZU_USE_PRECOMPILED_HEADERS) - if (MSVC AND CCACHE) - # buildcache does not properly cache PCH files, leading to compilation errors. - # See https://github.com/mbitsnbites/buildcache/discussions/230 - message(WARNING "buildcache does not properly support Precompiled Headers. Disabling PCH") - set(DYNARMIC_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE) - set(YUZU_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "" FORCE) - endif() -endif() - -if (YUZU_USE_PRECOMPILED_HEADERS) - message(STATUS "Using Precompiled Headers.") - set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON) -endif() - # Default to a Release build get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if (NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) diff --git a/CMakeModules/DownloadExternals.cmake b/CMakeModules/DownloadExternals.cmake index 6c4afc03be..f6e3aaa4ad 100644 --- a/CMakeModules/DownloadExternals.cmake +++ b/CMakeModules/DownloadExternals.cmake @@ -10,6 +10,7 @@ function(download_bundled_external remote_path lib_name cpm_key prefix_var versi set(package_base_url "https://github.com/eden-emulator/") set(package_repo "no_platform") set(package_extension "no_platform") + set(CACHE_KEY "") # TODO(crueter): Need to convert ffmpeg to a CI. if (WIN32 OR FORCE_WIN_ARCHIVES) @@ -33,8 +34,9 @@ function(download_bundled_external remote_path lib_name cpm_key prefix_var versi else() message(FATAL_ERROR "No package available for this platform") endif() - set(package_url "${package_base_url}${package_repo}") - set(full_url ${package_url}${remote_path}${lib_name}${package_extension}) + string(CONCAT package_url "${package_base_url}" "${package_repo}") + string(CONCAT full_url "${package_url}" "${remote_path}" "${lib_name}" "${package_extension}") + message(STATUS "Resolved bundled URL: ${full_url}") # TODO(crueter): DELETE THIS ENTIRELY, GLORY BE TO THE CI! AddPackage( @@ -47,26 +49,12 @@ function(download_bundled_external remote_path lib_name cpm_key prefix_var versi # TODO(crueter): hash ) - set(${prefix_var} "${${cpm_key}_SOURCE_DIR}" PARENT_SCOPE) - message(STATUS "Using bundled binaries at ${${cpm_key}_SOURCE_DIR}") -endfunction() - -function(download_moltenvk_external platform version) - set(MOLTENVK_DIR "${CMAKE_BINARY_DIR}/externals/MoltenVK") - set(MOLTENVK_TAR "${CMAKE_BINARY_DIR}/externals/MoltenVK.tar") - if (NOT EXISTS ${MOLTENVK_DIR}) - if (NOT EXISTS ${MOLTENVK_TAR}) - file(DOWNLOAD https://github.com/KhronosGroup/MoltenVK/releases/download/${version}/MoltenVK-${platform}.tar - ${MOLTENVK_TAR} SHOW_PROGRESS) - endif() - - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${MOLTENVK_TAR}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") + if (DEFINED ${cpm_key}_SOURCE_DIR) + set(${prefix_var} "${${cpm_key}_SOURCE_DIR}" PARENT_SCOPE) + message(STATUS "Using bundled binaries at ${${cpm_key}_SOURCE_DIR}") + else() + message(FATAL_ERROR "AddPackage did not set ${cpm_key}_SOURCE_DIR") endif() - - # Add the MoltenVK library path to the prefix so find_library can locate it. - list(APPEND CMAKE_PREFIX_PATH "${MOLTENVK_DIR}/MoltenVK/dylib/${platform}") - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE) endfunction() # Determine installation parameters for OS, architecture, and compiler @@ -108,7 +96,7 @@ function(determine_qt_parameters target host_out type_out arch_out arch_path_out set(host "linux") set(type "desktop") set(arch "linux_gcc_64") - set(arch_path "linux") + set(arch_path "gcc_64") endif() set(${host_out} "${host}" PARENT_SCOPE) @@ -143,56 +131,79 @@ function(download_qt_configuration prefix_out target host type arch arch_path ba set(install_args -c "${CURRENT_MODULE_DIR}/aqt_config.ini") if (tool) set(prefix "${base_path}/Tools") - set(install_args ${install_args} install-tool --outputdir ${base_path} ${host} desktop ${target}) + list(APPEND install_args install-tool --outputdir "${base_path}" "${host}" desktop "${target}") else() set(prefix "${base_path}/${target}/${arch_path}") - set(install_args ${install_args} install-qt --outputdir ${base_path} ${host} ${type} ${target} ${arch} -m qt_base) + list(APPEND install_args install-qt --outputdir "${base_path}" "${host}" "${type}" "${target}" "${arch}" -m qt_base) if (YUZU_USE_QT_MULTIMEDIA) - set(install_args ${install_args} qtmultimedia) + list(APPEND install_args qtmultimedia) endif() if (YUZU_USE_QT_WEB_ENGINE) - set(install_args ${install_args} qtpositioning qtwebchannel qtwebengine) + list(APPEND install_args qtpositioning qtwebchannel qtwebengine) endif() - if (NOT ${YUZU_QT_MIRROR} STREQUAL "") + if (NOT "${YUZU_QT_MIRROR}" STREQUAL "") message(STATUS "Using Qt mirror ${YUZU_QT_MIRROR}") - set(install_args ${install_args} -b ${YUZU_QT_MIRROR}) + list(APPEND install_args -b "${YUZU_QT_MIRROR}") endif() endif() - message(STATUS "Install Args ${install_args}") + message(STATUS "Install Args: ${install_args}") + if (NOT EXISTS "${prefix}") message(STATUS "Downloading Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path}") set(AQT_PREBUILD_BASE_URL "https://github.com/miurahr/aqtinstall/releases/download/v3.3.0") if (WIN32) set(aqt_path "${base_path}/aqt.exe") if (NOT EXISTS "${aqt_path}") - file(DOWNLOAD - ${AQT_PREBUILD_BASE_URL}/aqt.exe - ${aqt_path} SHOW_PROGRESS) + file(DOWNLOAD "${AQT_PREBUILD_BASE_URL}/aqt.exe" "${aqt_path}" SHOW_PROGRESS) + endif() + execute_process(COMMAND "${aqt_path}" ${install_args} + WORKING_DIRECTORY "${base_path}" + RESULT_VARIABLE aqt_res + OUTPUT_VARIABLE aqt_out + ERROR_VARIABLE aqt_err) + if (NOT aqt_res EQUAL 0) + message(FATAL_ERROR "aqt.exe failed: ${aqt_err}") endif() - execute_process(COMMAND ${aqt_path} ${install_args} - WORKING_DIRECTORY ${base_path}) elseif (APPLE) set(aqt_path "${base_path}/aqt-macos") if (NOT EXISTS "${aqt_path}") - file(DOWNLOAD - ${AQT_PREBUILD_BASE_URL}/aqt-macos - ${aqt_path} SHOW_PROGRESS) + file(DOWNLOAD "${AQT_PREBUILD_BASE_URL}/aqt-macos" "${aqt_path}" SHOW_PROGRESS) + endif() + execute_process(COMMAND chmod +x "${aqt_path}") + execute_process(COMMAND "${aqt_path}" ${install_args} + WORKING_DIRECTORY "${base_path}" + RESULT_VARIABLE aqt_res + ERROR_VARIABLE aqt_err) + if (NOT aqt_res EQUAL 0) + message(FATAL_ERROR "aqt-macos failed: ${aqt_err}") endif() - execute_process(COMMAND chmod +x ${aqt_path}) - execute_process(COMMAND ${aqt_path} ${install_args} - WORKING_DIRECTORY ${base_path}) else() + find_program(PYTHON3_EXECUTABLE python3) + if (NOT PYTHON3_EXECUTABLE) + message(FATAL_ERROR "python3 is required to install Qt using aqt (pip mode).") + endif() set(aqt_install_path "${base_path}/aqt") file(MAKE_DIRECTORY "${aqt_install_path}") - execute_process(COMMAND python3 -m pip install --target=${aqt_install_path} aqtinstall - WORKING_DIRECTORY ${base_path}) - execute_process(COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${aqt_install_path} python3 -m aqt ${install_args} - WORKING_DIRECTORY ${base_path}) + execute_process(COMMAND "${PYTHON3_EXECUTABLE}" -m pip install --target="${aqt_install_path}" aqtinstall + WORKING_DIRECTORY "${base_path}" + RESULT_VARIABLE pip_res + ERROR_VARIABLE pip_err) + if (NOT pip_res EQUAL 0) + message(FATAL_ERROR "pip install aqtinstall failed: ${pip_err}") + endif() + + execute_process(COMMAND "${CMAKE_COMMAND}" -E env PYTHONPATH="${aqt_install_path}" "${PYTHON3_EXECUTABLE}" -m aqt ${install_args} + WORKING_DIRECTORY "${base_path}" + RESULT_VARIABLE aqt_res + ERROR_VARIABLE aqt_err) + if (NOT aqt_res EQUAL 0) + message(FATAL_ERROR "aqt (python) failed: ${aqt_err}") + endif() endif() message(STATUS "Downloaded Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path} to ${prefix}") @@ -210,7 +221,7 @@ endfunction() function(download_qt target) determine_qt_parameters("${target}" host type arch arch_path host_type host_arch host_arch_path) - get_external_prefix(qt base_path) + set(base_path "${CMAKE_BINARY_DIR}/externals/qt") file(MAKE_DIRECTORY "${base_path}") download_qt_configuration(prefix "${target}" "${host}" "${type}" "${arch}" "${arch_path}" "${base_path}") @@ -227,26 +238,34 @@ function(download_qt target) set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE) endfunction() -function(download_moltenvk) -set(MOLTENVK_PLATFORM "macOS") +function(download_moltenvk version platform) + if(NOT version) + message(FATAL_ERROR "download_moltenvk: version argument is required") + endif() + if(NOT platform) + message(FATAL_ERROR "download_moltenvk: platform argument is required") + endif() -set(MOLTENVK_DIR "${CMAKE_BINARY_DIR}/externals/MoltenVK") -set(MOLTENVK_TAR "${CMAKE_BINARY_DIR}/externals/MoltenVK.tar") -if (NOT EXISTS ${MOLTENVK_DIR}) -if (NOT EXISTS ${MOLTENVK_TAR}) - file(DOWNLOAD https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.10-rc2/MoltenVK-all.tar - ${MOLTENVK_TAR} SHOW_PROGRESS) -endif() + set(MOLTENVK_DIR "${CMAKE_BINARY_DIR}/externals/MoltenVK") + set(MOLTENVK_TAR "${CMAKE_BINARY_DIR}/externals/MoltenVK.tar") -execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${MOLTENVK_TAR}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") -endif() + if(NOT EXISTS "${MOLTENVK_DIR}") + if(NOT EXISTS "${MOLTENVK_TAR}") + file(DOWNLOAD "https://github.com/KhronosGroup/MoltenVK/releases/download/${version}/MoltenVK-${platform}.tar" + "${MOLTENVK_TAR}" SHOW_PROGRESS) + endif() -# Add the MoltenVK library path to the prefix so find_library can locate it. -list(APPEND CMAKE_PREFIX_PATH "${MOLTENVK_DIR}/MoltenVK/dylib/${MOLTENVK_PLATFORM}") -set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE) + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xf "${MOLTENVK_TAR}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals" + RESULT_VARIABLE tar_res + ERROR_VARIABLE tar_err + ) + if(NOT tar_res EQUAL 0) + message(FATAL_ERROR "Extracting MoltenVK failed: ${tar_err}") + endif() + endif() + list(APPEND CMAKE_PREFIX_PATH "${MOLTENVK_DIR}/MoltenVK/dylib/${platform}") + set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE) endfunction() -function(get_external_prefix lib_name prefix_var) - set(${prefix_var} "${CMAKE_BINARY_DIR}/externals/${lib_name}" PARENT_SCOPE) -endfunction() diff --git a/docs/Deps.md b/docs/Deps.md index 0e7b7cff62..573d1fe14a 100644 --- a/docs/Deps.md +++ b/docs/Deps.md @@ -101,7 +101,7 @@ sudo pacman -Syu --needed base-devel boost catch2 cmake enet ffmpeg fmt git glsl Ubuntu, Debian, Mint Linux ```sh -sudo apt-get install autoconf cmake g++ gcc git glslang-tools libasound2 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build qt6-base-private-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev pkg-config zlib1g-dev libva-dev libvdpau-dev qt6-tools-dev libzydis-dev zydis-tools libzycore-dev +sudo apt-get install autoconf cmake g++ gcc git glslang-tools libasound2t64 libboost-context-dev libglu1-mesa-dev libhidapi-dev libpulse-dev libtool libudev-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxext-dev libxkbcommon-x11-0 mesa-common-dev nasm ninja-build qt6-base-private-dev libmbedtls-dev catch2 libfmt-dev liblz4-dev nlohmann-json3-dev libzstd-dev libssl-dev libavfilter-dev libavcodec-dev libswscale-dev pkg-config zlib1g-dev libva-dev libvdpau-dev qt6-tools-dev libzydis-dev zydis-tools libzycore-dev vulkan-utility-libraries-dev libvulkan-dev spirv-tools spirv-headers libusb-1.0-0-dev libxbyak-dev ``` * Ubuntu 22.04, Linux Mint 20, or Debian 12 or later is required. diff --git a/docs/Options.md b/docs/Options.md index d19aab63f6..6af91e4918 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -31,7 +31,7 @@ Notes: * Currently, build fails without this - `YUZU_USE_FASTER_LD` (ON) Check if a faster linker is available * Only available on UNIX -- `USE_SYSTEM_MOLTENVK` (OFF, macOS only) Use the system MoltenVK lib (instead of the bundled one) +- `YUZU_APPLE_USE_BUNDLED_MONTENVK` (ON, macOS only) Download bundled MoltenVK lib) - `YUZU_TZDB_PATH` (string) Path to a pre-downloaded timezone database (useful for nixOS) - `ENABLE_OPENSSL` (ON for Linux and *BSD) Enable OpenSSL backend for the ssl service * Always enabled if the web service is enabled diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index b16c1d99ce..c3d8f5387a 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -366,10 +366,10 @@ if (APPLE) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE TRUE) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) - if (NOT USE_SYSTEM_MOLTENVK) + if (YUZU_APPLE_USE_BUNDLED_MONTENVK) set(MOLTENVK_PLATFORM "macOS") set(MOLTENVK_VERSION "v1.3.0") - download_moltenvk_external(${MOLTENVK_PLATFORM} ${MOLTENVK_VERSION}) + download_moltenvk(${MOLTENVK_PLATFORM} ${MOLTENVK_VERSION}) endif() find_library(MOLTENVK_LIBRARY MoltenVK REQUIRED) message(STATUS "Using MoltenVK at ${MOLTENVK_LIBRARY}.") From 2e0a4163cf55fea260d641600b5a1452da27d373 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Tue, 30 Sep 2025 04:25:29 +0200 Subject: [PATCH 05/12] common: include missing headers after PCH disable (#2626) Signed-off-by: Caio Oliveira Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2626 Reviewed-by: crueter Co-authored-by: Caio Oliveira Co-committed-by: Caio Oliveira --- src/common/fs/file.cpp | 1 + src/common/fs/path_util.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/common/fs/file.cpp b/src/common/fs/file.cpp index b0b25eb432..722ba41949 100644 --- a/src/common/fs/file.cpp +++ b/src/common/fs/file.cpp @@ -3,6 +3,7 @@ #include +#include "common/assert.h" #include "common/fs/file.h" #include "common/fs/fs.h" #ifdef ANDROID diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 318f311891..a095e0c239 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp @@ -9,6 +9,7 @@ #include #include +#include "common/assert.h" #include "common/fs/fs.h" #ifdef ANDROID #include "common/fs/fs_android.h" From dfca07f4e3df72b243828268d0a3c4a49279ff9f Mon Sep 17 00:00:00 2001 From: xbzk Date: Wed, 1 Oct 2025 00:10:59 +0200 Subject: [PATCH 06/12] Initial a9 (minsdk=28) support (#2600) Minimal changes to make android 10 installable and emulationFragment not immediately crashable. Testers (mainly android 10) NEEDED!!! Co-authored-by: Allison Cunha Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2600 Reviewed-by: Lizzie Co-authored-by: xbzk Co-committed-by: xbzk --- src/android/app/build.gradle.kts | 2 +- .../org/yuzu/yuzu_emu/views/CarouselRecyclerView.kt | 5 +++-- src/common/host_memory.cpp | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index d3a05cf3e2..e8d8141711 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -59,7 +59,7 @@ android { defaultConfig { // TODO If this is ever modified, change application_id in strings.xml applicationId = "dev.eden.eden_emulator" - minSdk = 30 + minSdk = 28 targetSdk = 36 versionName = getGitVersion() diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/CarouselRecyclerView.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/CarouselRecyclerView.kt index 8a66ebf11f..2c35e7349a 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/CarouselRecyclerView.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/CarouselRecyclerView.kt @@ -19,6 +19,7 @@ import org.yuzu.yuzu_emu.adapters.GameAdapter import androidx.core.view.doOnNextLayout import org.yuzu.yuzu_emu.YuzuApplication import androidx.preference.PreferenceManager +import androidx.core.view.WindowInsetsCompat /** * CarouselRecyclerView encapsulates all carousel logic for the games UI. @@ -205,8 +206,8 @@ class CarouselRecyclerView @JvmOverloads constructor( if (enabled) { useCustomDrawingOrder = true - val insets = rootWindowInsets - val bottomInset = insets?.getInsets(android.view.WindowInsets.Type.systemBars())?.bottom ?: 0 + val insets = rootWindowInsets?.let { WindowInsetsCompat.toWindowInsetsCompat(it, this) } + val bottomInset = insets?.getInsets(WindowInsetsCompat.Type.systemBars())?.bottom ?: 0 val internalFactor = resources.getFraction(R.fraction.carousel_card_size_factor, 1, 1) val userFactor = preferences.getFloat(CAROUSEL_CARD_SIZE_FACTOR, internalFactor).coerceIn( 0f, diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 2e36d59569..3838c12903 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -56,6 +56,16 @@ #include "common/host_memory.h" #include "common/logging/log.h" +#if defined(__ANDROID__) && __ANDROID_API__ < 30 +#include +#ifndef MFD_CLOEXEC +#define MFD_CLOEXEC 0x0001U +#endif +static int memfd_create(const char* name, unsigned int flags) { + return syscall(__NR_memfd_create, name, flags); +} +#endif + namespace Common { constexpr size_t PageAlignment = 0x1000; From 43a7470a7d09ad412c7d9815ae23402f4bb7acb0 Mon Sep 17 00:00:00 2001 From: Gamer64 Date: Wed, 1 Oct 2025 01:21:12 +0200 Subject: [PATCH 07/12] [Maxwell]: Fix shaders compilation memory leak (#2606) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: collecting "The ObjectPool was never being cleared after use. When compiling complex shaders, this would allocate gigabytes of memory, causing the emulator to run out of RAM and be killed by the operating system. This is a critical fix that prevents out-of-memory crashes on all operating systems when playing games with complex shaders." Co-authored-by: Gamer64 <76565986+Gamer64ytb@users.noreply.github.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2606 Reviewed-by: MaranBr Reviewed-by: Shinmegumi Co-authored-by: Gamer64 Co-committed-by: Gamer64 --- .../frontend/maxwell/structured_control_flow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp index b5e1e70b4c..6d325b4aad 100644 --- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp @@ -991,6 +991,7 @@ IR::AbstractSyntaxList BuildASL(ObjectPool& inst_pool, ObjectPool Date: Wed, 1 Oct 2025 05:07:59 +0200 Subject: [PATCH 08/12] [meta] allow customisation of auto-updater, remove hardcoded title names and fix dup title names (#2588) Right now on all platforms, sdl2 will display something like "Eden Eden | master-8gd8fg8", this fixes so it only displays `Eden` (the REPO_NAME) once. Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2588 Reviewed-by: crueter Co-authored-by: lizzie Co-committed-by: lizzie --- CMakeModules/GenerateSCMRev.cmake | 6 +++++- src/common/scm_rev.cpp.in | 7 +++++++ src/common/scm_rev.h | 3 +++ src/yuzu/about_dialog.cpp | 9 +++++---- src/yuzu/main.cpp | 20 ++++++++++--------- src/yuzu/update_checker.cpp | 8 ++++++-- src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 2 +- .../emu_window/emu_window_sdl2_gl.cpp | 7 +++++-- 8 files changed, 43 insertions(+), 19 deletions(-) diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake index 2d7081b7db..1ae608c085 100644 --- a/CMakeModules/GenerateSCMRev.cmake +++ b/CMakeModules/GenerateSCMRev.cmake @@ -31,7 +31,11 @@ set(GIT_DESC ${BUILD_VERSION}) set(REPO_NAME "Eden") set(BUILD_ID ${GIT_REFSPEC}) set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") - set(CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") +# Auto-updater metadata! Must somewhat mirror GitHub API endpoint +set(BUILD_AUTO_UPDATE_WEBSITE "https://github.com") +set(BUILD_AUTO_UPDATE_API "http://api.github.com") +set(BUILD_AUTO_UPDATE_REPO "eden-emulator/Releases") + configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY) diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index 1630ceae83..08b8c68835 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in @@ -18,6 +18,9 @@ #define TITLE_BAR_FORMAT_RUNNING "@TITLE_BAR_FORMAT_RUNNING@" #define IS_DEV_BUILD @IS_DEV_BUILD@ #define COMPILER_ID "@CXX_COMPILER@" +#define BUILD_AUTO_UPDATE_WEBISTE "@BUILD_AUTO_UPDATE_WEBISTE@" +#define BUILD_AUTO_UPDATE_API "@BUILD_AUTO_UPDATE_API@" +#define BUILD_AUTO_UPDATE_REPO "@BUILD_AUTO_UPDATE_REPO@" namespace Common { @@ -34,4 +37,8 @@ constexpr const char g_title_bar_format_running[] = TITLE_BAR_FORMAT_RUNNING; constexpr const char g_compiler_id[] = COMPILER_ID; constexpr const bool g_is_dev_build = IS_DEV_BUILD; +constexpr const char g_build_auto_update_website[] = BUILD_AUTO_UPDATE_WEBISTE; +constexpr const char g_build_auto_update_api[] = BUILD_AUTO_UPDATE_API; +constexpr const char g_build_auto_update_repo[] = BUILD_AUTO_UPDATE_REPO; + } // namespace Common diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 8f48241557..b89de95a3d 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h @@ -21,5 +21,8 @@ extern const char g_title_bar_format_running[]; extern const char g_shader_cache_version[]; extern const char g_compiler_id[]; extern const bool g_is_dev_build; +extern const char g_build_auto_update_website[]; +extern const char g_build_auto_update_api[]; +extern const char g_build_auto_update_repo[]; } // namespace Common diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp index b7c0cd58d5..9f7597f471 100644 --- a/src/yuzu/about_dialog.cpp +++ b/src/yuzu/about_dialog.cpp @@ -14,11 +14,12 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent) , ui{std::make_unique()} { - static const std::string description = std::string{Common::g_build_version}; static const std::string build_id = std::string{Common::g_build_id}; - static const std::string compiler = std::string{Common::g_compiler_id}; - - static const std::string yuzu_build = fmt::format("Eden | {} | {}", description, compiler); + static const std::string yuzu_build = fmt::format("{} | {} | {}", + std::string{Common::g_build_name}, + std::string{Common::g_build_version}, + std::string{Common::g_compiler_id} + ); const auto override_build = fmt::format(fmt::runtime( std::string(Common::g_title_bar_format_idle)), diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d2c12c9d40..71cc0a7e6b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -4192,23 +4192,25 @@ void GMainWindow::OnEmulatorUpdateAvailable() { update_prompt.addButton(QMessageBox::Yes); update_prompt.addButton(QMessageBox::Ignore); update_prompt.setText( - tr("Update %1 for Eden is available.\nWould you like to download it?").arg(version_string)); + tr("Download the %1 update?").arg(version_string)); update_prompt.exec(); if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) { - QDesktopServices::openUrl( - QUrl(QString::fromStdString("https://github.com/eden-emulator/Releases/releases/tag/") + - version_string)); + auto const full_url = fmt::format("{}/{}/releases/tag/", + std::string{Common::g_build_auto_update_website}, + std::string{Common::g_build_auto_update_repo} + ); + QDesktopServices::openUrl(QUrl(QString::fromStdString(full_url) + version_string)); } } #endif void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_view title_version, std::string_view gpu_vendor) { - static const std::string description = std::string{Common::g_build_version}; - static const std::string build_id = std::string{Common::g_build_id}; - static const std::string compiler = std::string{Common::g_compiler_id}; - - static const std::string yuzu_title = fmt::format("Eden | {} | {}", description, compiler); + static const std::string yuzu_title = fmt::format("{} | {} | {}", + std::string{Common::g_build_name}, + std::string{Common::g_build_version}, + std::string{Common::g_compiler_id} + ); const auto override_title = fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id); diff --git a/src/yuzu/update_checker.cpp b/src/yuzu/update_checker.cpp index 8291987d73..76b436d1d1 100644 --- a/src/yuzu/update_checker.cpp +++ b/src/yuzu/update_checker.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // Copyright Citra Emulator Project / Azahar Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -12,6 +15,7 @@ #include #include #include +#include "common/scm_rev.h" std::optional UpdateChecker::GetResponse(std::string url, std::string path) { @@ -54,8 +58,8 @@ std::optional UpdateChecker::GetResponse(std::string url, std::stri std::optional UpdateChecker::GetLatestRelease(bool include_prereleases) { - constexpr auto update_check_url = "http://api.github.com"; - std::string update_check_path = "/repos/eden-emulator/Releases"; + constexpr auto update_check_url = std::string{Common::g_build_auto_update_api}; + std::string update_check_path = fmt::format("/repos/{}", std::string{Common::g_build_auto_update_repo}); try { if (include_prereleases) { // This can return either a prerelease or a stable release, // whichever is more recent. diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 9ec6b1d594..4b56f3794b 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -229,7 +229,7 @@ void EmuWindow_SDL2::WaitEvent() { const u32 current_time = SDL_GetTicks(); if (current_time > last_time + 2000) { const auto results = system.GetAndResetPerfStats(); - const auto title = fmt::format("Eden {} | {}-{} | FPS: {:.0f} ({:.0f}%)", + const auto title = fmt::format("{} | {}-{} | FPS: {:.0f} ({:.0f}%)", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc, diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 4b012fe134..32f365e0d0 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -90,7 +93,7 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste } SDL_GL_SetSwapInterval(0); - std::string window_title = fmt::format("Eden {} | {}-{}", Common::g_build_fullname, + std::string window_title = fmt::format("{} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc); render_window = SDL_CreateWindow(window_title.c_str(), @@ -138,7 +141,7 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste OnResize(); OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size); SDL_PumpEvents(); - LOG_INFO(Frontend, "Eden Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, + LOG_INFO(Frontend, "Build string: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc); Settings::LogSettings(); } From 9a098441def2cfc4281ab1af6b2e8b34200800c0 Mon Sep 17 00:00:00 2001 From: MaranBr Date: Wed, 1 Oct 2025 05:33:37 +0200 Subject: [PATCH 09/12] [audio_core] Fix audio issue in The Legend of Zelda - Echoes of Wisdom (#2594) This fixes the audio issue in The Legend of Zelda - Echoes of Wisdom on Windows. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2594 Reviewed-by: CamilleLaVey Co-authored-by: MaranBr Co-committed-by: MaranBr --- src/audio_core/renderer/behavior/info_updater.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/audio_core/renderer/behavior/info_updater.cpp b/src/audio_core/renderer/behavior/info_updater.cpp index 3dae6069f7..48fe1f8975 100644 --- a/src/audio_core/renderer/behavior/info_updater.cpp +++ b/src/audio_core/renderer/behavior/info_updater.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -162,6 +165,12 @@ Result InfoUpdater::UpdateEffectsVersion1(EffectContext& effect_context, const b reinterpret_cast(output), effect_count}; for (u32 i = 0; i < effect_count; i++) { +#ifdef _WIN32 + // There's a bug in Windows where using this effect causes extreme noise. So let's skip it. + if (in_params[i].type == EffectInfoBase::Type::Reverb) { + continue; + } +#endif auto effect_info{&effect_context.GetInfo(i)}; if (effect_info->GetType() != in_params[i].type) { effect_info->ForceUnmapBuffers(pool_mapper); @@ -209,6 +218,12 @@ Result InfoUpdater::UpdateEffectsVersion2(EffectContext& effect_context, const b reinterpret_cast(output), effect_count}; for (u32 i = 0; i < effect_count; i++) { +#ifdef _WIN32 + // There's a bug in Windows where using this effect causes extreme noise. So let's skip it. + if (in_params[i].type == EffectInfoBase::Type::Reverb) { + continue; + } +#endif auto effect_info{&effect_context.GetInfo(i)}; if (effect_info->GetType() != in_params[i].type) { effect_info->ForceUnmapBuffers(pool_mapper); From aafe25529501c98e752f63ee9332515b6f66006c Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 25 Sep 2025 11:44:14 -0300 Subject: [PATCH 10/12] [ci] license-header.sh: Make it POSIX-compliant! Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 281 +++++++++++++++++++++++++----------------- 1 file changed, 171 insertions(+), 110 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 3d4929d1c1..9e70188971 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -1,145 +1,206 @@ #!/bin/sh -e -HEADER="$(cat "$PWD/.ci/license/header.txt")" -HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" +# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +# SPDX-License-Identifier: GPL-3.0-or-later -echo "Getting branch changes" +COPYRIGHT_YEAR="2025" +COPYRIGHT_OWNER="Eden Emulator Project" +COPYRIGHT_LICENSE="GPL-3.0-or-later" -# BRANCH=`git rev-parse --abbrev-ref HEAD` -# COMMITS=`git log ${BRANCH} --not master --pretty=format:"%h"` -# RANGE="${COMMITS[${#COMMITS[@]}-1]}^..${COMMITS[0]}" -# FILES=`git diff-tree --no-commit-id --name-only ${RANGE} -r` +if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then + echo + echo "license-header.sh: Eden License Headers Accreditation Script" + echo + echo "This script checks and optionally fixes license headers in source, CMake and shell script files." + echo + echo "Environment Variables:" + echo " FIX=true | Automatically add the correct license headers to offending files." + echo " UPDATE=true | Automatically update current license headers of offending files." + echo " COMMIT=true | If FIX=true, commit the changes automatically." + echo + echo "Usage Examples:" + echo " # Just check headers (will fail if headers are missing)" + echo " .ci/license-header.sh" + echo + echo " # Fix headers only" + echo " FIX=true .ci/license-header.sh" + echo + echo " # Update headers only" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true .ci/license-header.sh" + echo + echo " # Fix headers and commit changes" + echo " FIX=true COMMIT=true .ci/license-header.sh" + echo + echo " # Update headers and commit changes" + echo " # if COPYRIGHT_OWNER is '$COPYRIGHT_OWNER'" + echo " # or else will have 'FIX=true' behavior)" + echo " UPDATE=true COMMIT=true .ci/license-header.sh" + exit 0 +fi -BASE=`git merge-base master HEAD` -FILES=`git diff --name-only $BASE` +SRC_FILES="" +OTHER_FILES="" -#FILES=$(git diff --name-only master) +BASE=$(git merge-base master HEAD) +if git diff --quiet "$BASE"..HEAD; then + echo + echo "license-header.sh: No commits on this branch different from master." + exit 0 +fi +FILES=$(git diff --name-only "$BASE") -echo "Done" - -check_header() { - CONTENT="`head -n3 < $1`" - case "$CONTENT" in - "$HEADER"*) ;; - *) BAD_FILES="$BAD_FILES $1" ;; - esac +echo_header() { + COMMENT_TYPE="$1" + echo "$COMMENT_TYPE SPDX-FileCopyrightText: Copyright $COPYRIGHT_YEAR $COPYRIGHT_OWNER" + echo "$COMMENT_TYPE SPDX-License-Identifier: $COPYRIGHT_LICENSE" } -check_cmake_header() { - CONTENT="`head -n3 < $1`" - - case "$CONTENT" in - "$HEADER_HASH"*) ;; - *) - BAD_CMAKE="$BAD_CMAKE $1" ;; - esac -} for file in $FILES; do [ -f "$file" ] || continue - if [ `basename -- "$file"` = "CMakeLists.txt" ]; then - check_cmake_header "$file" + case "$(basename "$file")" in + CMakeLists.txt) + COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac ;; + esac + + HEADER=$(echo_header "$COMMENT_TYPE") + HEAD_LINES=$(head -n5 "$file") + + CORRECT_COPYRIGHT=$(echo "$HEAD_LINES" | awk \ + -v line1="$(echo "$HEADER" | sed -n '1p')" \ + -v line2="$(echo "$HEADER" | sed -n '2p')" \ + '($0==line1){getline; if($0==line2){f=1}else{f=0}} END{print (f?f:0)}') + + if [ "$CORRECT_COPYRIGHT" != "1" ]; then + case "$COMMENT_TYPE" in + "//") SRC_FILES="$SRC_FILES $file" ;; + "#") OTHER_FILES="$OTHER_FILES $file" ;; + esac + fi +done + +if [ -z "$SRC_FILES" ] && [ -z "$OTHER_FILES" ]; then + echo + echo "license-header.sh: All good!" + exit 0 +fi + +for TYPE in "SRC" "OTHER"; do + if [ "$TYPE" = "SRC" ] && [ -n "$SRC_FILES" ]; then + FILES_LIST="$SRC_FILES" + COMMENT_TYPE="//" + DESC="Source" + elif [ "$TYPE" = "OTHER" ] && [ -n "$OTHER_FILES" ]; then + FILES_LIST="$OTHER_FILES" + COMMENT_TYPE="#" + DESC="CMake and shell script" + else continue fi - EXTENSION="${file##*.}" - case "$EXTENSION" in - kts|kt|cpp|h) - check_header "$file" - ;; - cmake) - check_cmake_header "$file" - ;; - esac + echo + echo "------------------------------------------------------------" + echo "$DESC files" + echo "------------------------------------------------------------" + echo + echo " The following files contain incorrect license headers:" + for file in $FILES_LIST; do + echo " - $file" + done + + echo + echo " The correct license header to be added to all affected" + echo " '$DESC' files is:" + echo + echo "=== BEGIN ===" + echo_header "$COMMENT_TYPE" + echo "=== END ===" done -if [ "$BAD_FILES" = "" ] && [ "$BAD_CMAKE" = "" ]; then - echo - echo "All good." - - exit -fi - -if [ "$BAD_FILES" != "" ]; then - echo "The following source files have incorrect license headers:" - echo - - for file in $BAD_FILES; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending SOURCE files: - -=== BEGIN === -$HEADER -=== END === - -EOF - -fi - -if [ "$BAD_CMAKE" != "" ]; then - echo "The following CMake files have incorrect license headers:" - echo - - for file in $BAD_CMAKE; do echo $file; done - - cat << EOF - -The following license header should be added to the start of all offending CMake files: - -=== BEGIN === -$HEADER_HASH -=== END === - -EOF - -fi - cat << EOF -If some of the code in this PR is not being contributed by the original author, -the files which have been exclusively changed by that code can be ignored. -If this happens, this PR requirement can be bypassed once all other files are addressed. + +------------------------------------------------------------ + + If some of the code in this pull request was not contributed by the original + author, the files that have been modified exclusively by that code can be + safely ignored. In such cases, this PR requirement may be bypassed once all + other files have been reviewed and addressed. EOF -if [ "$FIX" = "true" ]; then - echo - echo "FIX set to true. Fixing headers." +TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo + echo "license-header.sh: FIX set to true, fixing headers..." - for file in $BAD_FILES; do - cat $file > $file.bak + for file in $SRC_FILES $OTHER_FILES; do + BASENAME=$(basename "$file") - cat .ci/license/header.txt > $file - echo >> $file - cat $file.bak >> $file + case "$BASENAME" in + CMakeLists.txt) COMMENT_TYPE="#" ;; + *) + EXT="${file##*.}" + case "$EXT" in + kts|kt|cpp|h) COMMENT_TYPE="//" ;; + cmake|sh|ps1) COMMENT_TYPE="#" ;; + *) continue ;; + esac + ;; + esac - rm $file.bak + TMP="$TMP_DIR/$BASENAME.tmp" + UPDATED=0 + cp -p "$file" "$TMP" + > "$TMP" - git add $file + # this logic is bit hacky but sed don't work well with $VARIABLES + # it's this or complete remove this logic and keep only the old way + if [ "$UPDATE" = "true" ]; then + while IFS= read -r line || [ -n "$line" ]; do + if [ "$UPDATED" -eq 0 ] && echo "$line" | grep "$COPYRIGHT_OWNER" >/dev/null 2>&1; then + echo_header "$COMMENT_TYPE" >> "$TMP" + IFS= read -r _ || true + UPDATED=1 + else + echo "$line" >> "$TMP" + fi + done < "$file" + fi + + if [ "$UPDATED" -eq 0 ]; then + { + echo_header "$COMMENT_TYPE" + echo + cat "$TMP" + } > "$file" + else + mv "$TMP" "$file" + fi + + git add "$file" done - for file in $BAD_CMAKE; do - cat $file > $file.bak + rm -rf "$TMP_DIR" - cat .ci/license/header-hash.txt > $file - echo >> $file - cat $file.bak >> $file - - rm $file.bak - - git add $file - done - echo "License headers fixed." + echo + echo "license-header.sh: License headers fixed!" if [ "$COMMIT" = "true" ]; then echo - echo "COMMIT set to true. Committing changes." + echo "license-header.sh: COMMIT set to true, committing changes..." + + git commit -m "[license] Fix license headers [script]" + echo - - git commit -m "Fix license headers" - - echo "Changes committed. You may now push." + echo "license-header.sh: Changes committed. You may now push." fi else exit 1 From 5f5ca83991bc9a6f55a0a3c015858dd7f14371b9 Mon Sep 17 00:00:00 2001 From: crueter Date: Fri, 26 Sep 2025 19:38:00 -0400 Subject: [PATCH 11/12] [ci] license-header.sh: add file exclusion capability Signed-off-by: crueter --- .ci/license-header.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 9e70188971..870555d533 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -3,6 +3,10 @@ # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later +# specify full path if dupes may exist +EXCLUDE_FILES="CPM.cmake CPMUtil.cmake GetSCMRev.cmake" +EXCLUDE_FILES=$(echo "$EXCLUDE_FILES" | sed 's/ /|/g') + COPYRIGHT_YEAR="2025" COPYRIGHT_OWNER="Eden Emulator Project" COPYRIGHT_LICENSE="GPL-3.0-or-later" @@ -49,7 +53,7 @@ if git diff --quiet "$BASE"..HEAD; then echo "license-header.sh: No commits on this branch different from master." exit 0 fi -FILES=$(git diff --name-only "$BASE") +FILES=$(git diff --name-only "$BASE" | grep -E -v "$EXCLUDE_FILES") echo_header() { COMMENT_TYPE="$1" From 8efba93294dbab876499820073fb050698afa7d5 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sun, 28 Sep 2025 19:52:28 -0300 Subject: [PATCH 12/12] [ci] license-header.sh: Fix some shellcheck warnings Signed-off-by: Caio Oliveira --- .ci/license-header.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 870555d533..ee775db01e 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -140,10 +140,10 @@ cat << EOF other files have been reviewed and addressed. EOF -TMP_DIR=$(mktemp -d /tmp/license-header.XXXXXX) || exit 1 +TMP_DIR=$(mktemp -d "/tmp/license-header.XXXXXX") || exit 1 if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then echo - echo "license-header.sh: FIX set to true, fixing headers..." + echo "license-header.sh: FIX or UPDATE set to true, fixing headers..." for file in $SRC_FILES $OTHER_FILES; do BASENAME=$(basename "$file") @@ -163,7 +163,7 @@ if [ "$FIX" = "true" ] || [ "$UPDATE" = "true" ]; then TMP="$TMP_DIR/$BASENAME.tmp" UPDATED=0 cp -p "$file" "$TMP" - > "$TMP" + : > "$TMP" # this logic is bit hacky but sed don't work well with $VARIABLES # it's this or complete remove this logic and keep only the old way