Skip to content

Commit 10b6414

Browse files
authored
Linux fixes (#190)
This pull-request fixes all issues and problems found during work on WSL2 Ubuntu Linux 24.04, making it now possible to work on Linux targets. Because of the huge number of linux based systems, it might take additional changes or setup to work on this project. Features: * Enabled and test all binaries on Linux (Including asset compilers) * Enabled and tested Asset pipelines for Mobile and Android targets. (other targets are also possible) * Implemented support for rendering to X11 (tested) and Wayland (untested) surfaces. * Implemented support for XDG user dirs config to be queried to access standardized or user-defined directory paths. Changes: * Changed 'Unix' platform enum to 'Linux', since unix is just a superset. * Removed hardcoded 'EMSDK_PYTHON' env variable in the 'source/fbuild.bff' script. * Implemented naming of threads on Linux development targets. * Implemented 'ice::current_thread::sleep' function. Fixes * Fixed crash in 'ResourceProviderFilelist' due to improperly destroying resources. * Fixed crash in VulkanAllocator due to poor implementation. * Fixed memory access issued detected by Address Sanitizer. (asan) * Fixed memory leak when creating resources from baked data. * Fixed logging inconsistencies in 'hsc_reader' project. * Fixed graphics graphs sometimes accessing deleted data when window is being resized. * Fixed CLI11 to not strip quotes around path arguments. (manually stripping quotes from values using a transform function) Updates to 3rdParty libraries: * Updated FMT to version 11.2.0 and fixed compatibility issues. * Updated rapidjson to version 1.1.0.patched which is based on a commit from April 2025. Others: * Workflows now validate both Windows and Linux targets. * Updated build options for Linux to always set '-fPIC'. * Updated 'start' script to handle much more complex cases. * Updated 3rdParty license information. Known issues: * Allocators are no longer checking if allocation size is above '0', and some allocators might not handle that scenario properly.
1 parent 3baf9be commit 10b6414

File tree

139 files changed

+2579
-1361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+2579
-1361
lines changed

.github/workflows/build-dispatch.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
description: "Target to be build. (separated by spaces)"
1212
required: true
1313
type: string
14+
clang-version:
15+
description: "Clang tools version to be installed"
16+
required: false
17+
type: string
1418

1519
jobs:
1620
build:
@@ -20,12 +24,24 @@ jobs:
2024
- name: Checkout Source Code
2125
uses: actions/checkout@v4
2226

27+
- name: Setup Clang ${{ inputs.clang-version }} (ubuntu-only)
28+
if: ${{ inputs.host-platform == 'ubuntu-latest' }}
29+
run: |
30+
wget https://apt.llvm.org/llvm.sh
31+
chmod +x llvm.sh
32+
sudo ./llvm.sh ${{ inputs.clang-version }}
33+
sudo apt install libc++-${{ inputs.clang-version }}-dev libc++abi-${{ inputs.clang-version }}-dev
34+
2335
- name: Setup Conan2
2436
uses: iceshard-engine/.github/.github/actions/conan2@main
2537
with:
2638
conan-cache: true
2739
conan-cache-version: 'v1'
2840
conan-config-url: https://github.com/iceshard-engine/conan-config.git
41+
conan-profile-compiler: 'clang'
42+
conan-profile-compiler-version: '${{ inputs.clang-version }}'
43+
conan-profile-cppstd: '20'
44+
conan-profile-libcxx: 'libc++'
2945

3046
- name: Setup IBT
3147
uses: iceshard-engine/.github/.github/actions/ibt-wks@main
@@ -38,5 +54,5 @@ jobs:
3854

3955
# Building the actual target
4056
- name: Build Target (${{ inputs.target }})
41-
shell: powershell
57+
shell: pwsh
4258
run: ./ibt-ci build -t ${{ inputs.target }}

.github/workflows/build-validate-code.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@ on:
55
push:
66
paths:
77
- 'source/**'
8+
- '.github/workflows/build-dispatch.yaml'
9+
- '.github/workflows/build-validate-code.yaml'
810
- '!source/data/**'
11+
workflow_dispatch:
912

1013
jobs:
1114
validate:
1215
name: Validate (${{ matrix.project }}-${{ matrix.pipeline }}-${{ matrix.config }}, ${{ matrix.host }})
1316
uses: ./.github/workflows/build-dispatch.yaml
1417
strategy:
1518
matrix:
19+
host: [windows-latest, ubuntu-latest]
1620
project: [all]
1721
pipeline: [x64]
1822
config: [Debug,Develop,Profile,Release]
1923
include:
20-
- host: windows-latest
24+
- host: ubuntu-latest
25+
clang-version: '20'
2126
with:
2227
host-platform: ${{ matrix.host }}
2328
target: "${{ matrix.project }}-${{ matrix.pipeline }}-${{ matrix.config }}"
29+
clang-version: ${{ matrix.clang-version || '' }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
# Local data
1111
/source/data/temp
1212
/source/data/local
13-
/tools/scripts/generate_version.moon
13+
/tools/scripts/*
14+
15+
# Specific scripts that would be nice to have in the repository
16+
!/tools/scripts/start.moon
1417

1518
# Temporary files to ignore
1619
compile_commands.json

source/asset_compiler.bff

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
1+
/// Copyright 2024 - 2025, Dandielo <dandielo@iceshard.net>
2+
/// SPDX-License-Identifier: MIT
23

34
.PlatformRule_GameAssets_ShadersMobile =
45
[
56
.Name = 'Assets-Shaders-Mobile'
67
.Requires = { 'assets-mobile', 'Step-Bake-Shaders' }
78
.BuildOptions = {
9+
#if __WINDOWS__
810
'-c shader_tools.dll'
11+
#else // __LINUX__
12+
'-c libshader_tools.so'
13+
#endif
914
'--param shader:target GLSL'
1015
}
1116
]
@@ -15,7 +20,11 @@
1520
.Name = 'Assets-Shaders-Web'
1621
.Requires = { 'assets-web', 'Step-Bake-Shaders' }
1722
.BuildOptions = {
23+
#if __WINDOWS__
1824
'-c shader_tools.dll'
25+
#else // __LINUX__
26+
'-c libshader_tools.so'
27+
#endif
1928
'--param shader:target WGSL'
2029
}
2130
]

source/code/core/collections/public/ice/container/impl/array_impl.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
1+
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
22
/// SPDX-License-Identifier: MIT
33

44
namespace ice

source/code/core/collections/public/ice/shard_container.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// Copyright 2022 - 2024, Dandielo <dandielo@iceshard.net>
1+
/// Copyright 2022 - 2025, Dandielo <dandielo@iceshard.net>
22
/// SPDX-License-Identifier: MIT
33

44
#pragma once

source/code/core/core/public/ice/assert_core.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
(_wassert(_CRT_WIDE(#expression), _CRT_WIDE(__FILE__), (unsigned)(__LINE__)), 0) \
1717
); } } while(false)
1818

19-
#elif ISP_WEBAPP
19+
#elif ISP_WEBAPP || ISP_LINUX
2020

2121
#define ICE_ASSERT_CORE(expression) ((expression) \
2222
? (void)0 \

source/code/core/core/public/ice/build/build.hxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ namespace ice::build
2222

2323
static constexpr bool is_windows = current_platform == System::Windows;
2424

25-
static constexpr bool is_unix = current_platform == System::Unix;
25+
static constexpr bool is_linux = current_platform == System::Linux;
2626

2727
static constexpr bool is_android = current_platform == System::Android;
2828

2929
static constexpr bool is_webapp = current_platform == System::WebApp;
3030

31+
static constexpr bool is_unix = is_linux || is_android || is_webapp;
32+
3133

3234
static constexpr bool is_x64 = current_platform == Architecture::x86_x64 || current_platform == Architecture::Arm64;
3335

source/code/core/core/public/ice/build/info.hxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// Copyright 2025 - 2025, Dandielo <dandielo@iceshard.net>
2+
/// SPDX-License-Identifier: MIT
3+
14
#pragma once
25
#include <ice/types.hxx>
36

source/code/core/core/public/ice/build/platform.hxx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace ice::build
1313
UWP,
1414
Windows,
1515
Android,
16-
Unix,
16+
Linux,
1717
WebApp
1818
};
1919

@@ -109,20 +109,13 @@ namespace ice::build
109109
.compiler = Compiler::Clang
110110
};
111111

112-
static constexpr Platform platform_unix_x64_clang = {
113-
.name = "unix-x64-clang",
114-
.system = System::Unix,
112+
static constexpr Platform platform_linux_x64_clang = {
113+
.name = "linux-x64-clang",
114+
.system = System::Linux,
115115
.architecture = Architecture::x86_x64,
116116
.compiler = Compiler::Clang
117117
};
118118

119-
static constexpr Platform platform_unix_x64_gcc = {
120-
.name = "unix-x64-gcc",
121-
.system = System::Unix,
122-
.architecture = Architecture::x86_x64,
123-
.compiler = Compiler::GCC
124-
};
125-
126119
static constexpr Platform platform_webapp_webasm32_clang = {
127120
.name = "webapp-webasm32-clang",
128121
.system = System::WebApp,
@@ -136,8 +129,7 @@ namespace ice::build
136129
platform_windows_x64_clang,
137130
platform_android_arm64_clang,
138131
platform_android_x64_clang,
139-
platform_unix_x64_clang,
140-
platform_unix_x64_gcc,
132+
platform_linux_x64_clang,
141133
platform_webapp_webasm32_clang
142134
};
143135

@@ -152,6 +144,7 @@ namespace ice::build
152144

153145
#if defined(_WIN64)
154146
# define ISP_UNIX 0
147+
# define ISP_LINUX 0
155148
# define ISP_WINDOWS 1
156149
# define ISP_ANDROID 0
157150
# define ISP_WEBAPP 0
@@ -173,6 +166,7 @@ namespace ice::build
173166
# define ISP_ARCHFAM_WEBASM 0
174167
#elif defined(__ANDROID__)
175168
# define ISP_UNIX 1
169+
# define ISP_LINUX 0
176170
# define ISP_WINDOWS 0
177171
# define ISP_ANDROID __ANDROID_API__
178172
# define ISP_WEBAPP 0
@@ -193,6 +187,7 @@ namespace ice::build
193187
# endif
194188
#elif defined(EMSCRIPTEN)
195189
# define ISP_UNIX 1
190+
# define ISP_LINUX 0
196191
# define ISP_WINDOWS 0
197192
# define ISP_ANDROID 0
198193
# define ISP_WEBAPP 1
@@ -207,6 +202,7 @@ namespace ice::build
207202
static constexpr Platform current_platform = platform_webapp_webasm32_clang;
208203
#elif __unix__ && !__clang__
209204
# define ISP_UNIX 1
205+
# define ISP_LINUX 1
210206
# define ISP_WINDOWS 0
211207
# define ISP_ANDROID 0
212208
# define ISP_WEBAPP 0
@@ -220,6 +216,7 @@ namespace ice::build
220216
static constexpr Platform current_platform = platform_unix_x64_gcc;
221217
#elif __unix__ && __clang__
222218
# define ISP_UNIX 1
219+
# define ISP_LINUX 1
223220
# define ISP_WINDOWS 0
224221
# define ISP_ANDROID 0
225222
# define ISP_WEBAPP 0
@@ -230,7 +227,7 @@ namespace ice::build
230227
# define ISP_ARCHFAM_ARM 0
231228
# define ISP_ARCHFAM_WEBASM 0
232229

233-
static constexpr Platform current_platform = platform_unix_x64_clang;
230+
static constexpr Platform current_platform = platform_linux_x64_clang;
234231
#else
235232
# define ISP_UNIX 0
236233
# define ISP_WINDOWS 0
@@ -321,8 +318,8 @@ namespace ice::build
321318
return "windows";
322319
case ice::build::System::Android:
323320
return "android";
324-
case ice::build::System::Unix:
325-
return "unix";
321+
case ice::build::System::Linux:
322+
return "linux";
326323
default:
327324
return "<invalid>";
328325
}

0 commit comments

Comments
 (0)