Skip to content

Commit 1f3f241

Browse files
committed
musl로 재빌드
1 parent 28fd054 commit 1f3f241

File tree

6 files changed

+188
-188
lines changed

6 files changed

+188
-188
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"ghcr.io/devcontainers/features/rust:1": {
1414
"version": "latest",
1515
"profile": "default",
16-
"targets": "i686-unknown-linux-gnu"
16+
"targets": "i686-unknown-linux-musl"
1717
}
1818
},
1919

.github/workflows/ci.yml

Lines changed: 134 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,134 @@
1-
name: CI
2-
3-
on:
4-
push:
5-
branches:
6-
- "main"
7-
tags:
8-
- 'v*.*.*'
9-
10-
jobs:
11-
build:
12-
strategy:
13-
matrix:
14-
os: [ubuntu-latest, windows-latest]
15-
arch: [x86, x86_64]
16-
include:
17-
- os: windows-latest
18-
arch: x86
19-
os_short: win
20-
compiler_cc: msvc
21-
rust-target: i686-pc-windows-msvc
22-
packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86.zip
23-
- os: windows-latest
24-
arch: x86_64
25-
os_short: win
26-
compiler_cc: msvc
27-
rust-target: x86_64-pc-windows-msvc
28-
packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86_64.zip
29-
- os: ubuntu-latest
30-
arch: x86
31-
os_short: linux
32-
compiler_cc: clang
33-
compiler_cxx: clang++
34-
rust-target: i686-unknown-linux-gnu
35-
packaging: cd package && zip -r ../timerex-linux-x86.zip addons
36-
- os: ubuntu-latest
37-
arch: x86_64
38-
os_short: linux
39-
compiler_cc: clang
40-
compiler_cxx: clang++
41-
rust-target: x86_64-unknown-linux-gnu
42-
packaging: cd package && zip -r ../timerex-linux-x86_64.zip addons
43-
runs-on: ${{ matrix.os }}
44-
name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}-${{ matrix.arch }}
45-
steps:
46-
- uses: actions/checkout@v4
47-
with:
48-
submodules: recursive
49-
path: timerex
50-
51-
- name: Install Rust
52-
uses: actions-rust-lang/setup-rust-toolchain@v1
53-
with:
54-
toolchain: nightly
55-
target: ${{ matrix.rust-target }}
56-
override: true
57-
58-
- uses: Swatinem/rust-cache@v1
59-
with:
60-
working-directory: timerex
61-
62-
- uses: actions/checkout@v4
63-
name: Checkout sourcemod
64-
with:
65-
repository: alliedmodders/sourcemod
66-
submodules: recursive
67-
path: sourcemod
68-
69-
- uses: actions/checkout@v4
70-
name: Checkout metamod-source
71-
with:
72-
repository: alliedmodders/metamod-source
73-
path: mmsource
74-
75-
- uses: actions/checkout@v4
76-
name: Checkout ambuild
77-
with:
78-
repository: alliedmodders/ambuild
79-
path: ambuild
80-
81-
# Setup Python for AMBuild
82-
- uses: actions/setup-python@v5
83-
name: Setup Python 3.13
84-
with:
85-
python-version: 3.13
86-
- name: Install Python dependencies
87-
run: |
88-
python -m pip install --upgrade pip setuptools wheel
89-
90-
- name: Install ambuild
91-
run: pip install ./ambuild
92-
93-
- name: Install Linux 64-bit dependencies
94-
if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86_64'
95-
run: |
96-
sudo apt-get update
97-
sudo apt-get install -y \
98-
libstdc++6 libc6-dev linux-libc-dev \
99-
${{ matrix.compiler_cc }}
100-
101-
- name: Install Linux 32-bit dependencies
102-
if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86'
103-
run: |
104-
sudo dpkg --add-architecture i386
105-
sudo apt-get update
106-
sudo apt-get install -y \
107-
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
108-
libc6-dev libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 \
109-
lib32z1-dev ${{ matrix.compiler_cc }}
110-
111-
- name: Select clang compiler
112-
if: startsWith(runner.os, 'Linux')
113-
run: |
114-
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
115-
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
116-
${{ matrix.compiler_cc }} --version
117-
${{ matrix.compiler_cxx }} --version
118-
119-
- name: Build
120-
working-directory: timerex
121-
run: |
122-
cargo build --target ${{ matrix.rust-target }} --release
123-
mkdir -p build && cd build
124-
python ../configure.py --enable-optimize --sm-path=${{ github.workspace }}/sourcemod/ --mms-path=${{ github.workspace }}/mmsource/ --targets ${{ matrix.arch }}
125-
ambuild
126-
${{ matrix.packaging }}
127-
128-
- name: Release
129-
uses: softprops/action-gh-release@v1
130-
if: startsWith(github.ref, 'refs/tags/')
131-
with:
132-
files: timerex/build/timerex-${{ matrix.os_short }}-${{ matrix.arch }}.zip
133-
env:
134-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- 'v*.*.*'
9+
10+
jobs:
11+
build:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-22.04, windows-latest]
15+
arch: [x86, x86_64]
16+
include:
17+
- os: windows-latest
18+
arch: x86
19+
os_short: win
20+
compiler_cc: msvc
21+
rust-target: i686-pc-windows-msvc
22+
packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86.zip
23+
- os: windows-latest
24+
arch: x86_64
25+
os_short: win
26+
compiler_cc: msvc
27+
rust-target: x86_64-pc-windows-msvc
28+
packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86_64.zip
29+
- os: ubuntu-22.04
30+
arch: x86
31+
os_short: linux
32+
compiler_cc: clang
33+
compiler_cxx: clang++
34+
rust-target: i686-unknown-linux-musl
35+
packaging: cd package && zip -r ../timerex-linux-x86.zip addons
36+
- os: ubuntu-22.04
37+
arch: x86_64
38+
os_short: linux
39+
compiler_cc: clang
40+
compiler_cxx: clang++
41+
rust-target: x86_64-unknown-linux-musl
42+
packaging: cd package && zip -r ../timerex-linux-x86_64.zip addons
43+
runs-on: ${{ matrix.os }}
44+
name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}-${{ matrix.arch }}
45+
steps:
46+
- uses: actions/checkout@v4
47+
with:
48+
submodules: recursive
49+
path: timerex
50+
51+
- name: Install Rust
52+
uses: actions-rust-lang/setup-rust-toolchain@v1
53+
with:
54+
toolchain: nightly
55+
target: ${{ matrix.rust-target }}
56+
override: true
57+
58+
- uses: Swatinem/rust-cache@v1
59+
with:
60+
working-directory: timerex
61+
62+
- uses: actions/checkout@v4
63+
name: Checkout sourcemod
64+
with:
65+
repository: alliedmodders/sourcemod
66+
submodules: recursive
67+
path: sourcemod
68+
69+
- uses: actions/checkout@v4
70+
name: Checkout metamod-source
71+
with:
72+
repository: alliedmodders/metamod-source
73+
path: mmsource
74+
75+
- uses: actions/checkout@v4
76+
name: Checkout ambuild
77+
with:
78+
repository: alliedmodders/ambuild
79+
path: ambuild
80+
81+
# Setup Python for AMBuild
82+
- uses: actions/setup-python@v5
83+
name: Setup Python 3.13
84+
with:
85+
python-version: 3.13
86+
- name: Install Python dependencies
87+
run: |
88+
python -m pip install --upgrade pip setuptools wheel
89+
90+
- name: Install ambuild
91+
run: pip install ./ambuild
92+
93+
- name: Install Linux 64-bit dependencies
94+
if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86_64'
95+
run: |
96+
sudo apt-get update
97+
sudo apt-get install -y \
98+
libstdc++6 libc6-dev linux-libc-dev \
99+
${{ matrix.compiler_cc }}
100+
101+
- name: Install Linux 32-bit dependencies
102+
if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86'
103+
run: |
104+
sudo dpkg --add-architecture i386
105+
sudo apt-get update
106+
sudo apt-get install -y \
107+
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
108+
libc6-dev libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 \
109+
lib32z1-dev ${{ matrix.compiler_cc }}
110+
111+
- name: Select clang compiler
112+
if: startsWith(runner.os, 'Linux')
113+
run: |
114+
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
115+
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
116+
${{ matrix.compiler_cc }} --version
117+
${{ matrix.compiler_cxx }} --version
118+
119+
- name: Build
120+
working-directory: timerex
121+
run: |
122+
cargo build --target ${{ matrix.rust-target }} --release
123+
mkdir -p build && cd build
124+
python ../configure.py --enable-optimize --sm-path=${{ github.workspace }}/sourcemod/ --mms-path=${{ github.workspace }}/mmsource/ --targets ${{ matrix.arch }}
125+
ambuild
126+
${{ matrix.packaging }}
127+
128+
- name: Release
129+
uses: softprops/action-gh-release@v1
130+
if: startsWith(github.ref, 'refs/tags/')
131+
with:
132+
files: timerex/build/timerex-${{ matrix.os_short }}-${{ matrix.arch }}.zip
133+
env:
134+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

AMBuilder

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
2-
import os
3-
4-
# Name of your extesion, this will also be it's file name.
5-
projectName = 'timerex'
6-
7-
# smsdk_ext.cpp will be automatically added later
8-
sourceFiles = [
9-
'timerex/extension.cpp',
10-
]
11-
12-
project = Extension.HL2Project(builder, projectName + '.ext')
13-
14-
if os.path.isfile(os.path.join(builder.currentSourcePath, 'sdk', 'smsdk_ext.cpp')):
15-
# Use the copy included in the project
16-
project.sources += [os.path.join('sdk', 'smsdk_ext.cpp')]
17-
else:
18-
# Use the copy included with SM 1.6 and newer
19-
project.sources += [os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp')]
20-
21-
project.sources += sourceFiles
22-
23-
for cxx in builder.targets:
24-
binary = Extension.HL2Config(builder, project, projectName + '.ext', cxx)
25-
arch = {'x86': 'i686', 'x86_64': 'x86_64'}[binary.compiler.target.arch]
26-
if builder.options.opt == '1':
27-
directory = 'release'
28-
else:
29-
directory = 'debug'
30-
31-
path = ''
32-
if binary.compiler.target.platform == 'linux':
33-
path = os.path.join(builder.currentSourcePath, 'target', f'{arch}-unknown-linux-gnu', directory, 'libtimerex.a')
34-
elif binary.compiler.target.platform == 'windows':
35-
path = os.path.join(builder.currentSourcePath, 'target', f'{arch}-pc-windows-msvc', directory, 'timerex.lib')
36-
else:
37-
raise
38-
binary.compiler.postlink += [path]
39-
40-
binary.compiler.cxxincludes += [os.path.join(builder.currentSourcePath, 'timerex')]
41-
42-
if binary.compiler.family == 'msvc':
43-
binary.compiler.linkflags += [
44-
'userenv.lib',
45-
'ws2_32.lib',
46-
"ntdll.lib",
47-
]
48-
49-
Extension.extensions = builder.Add(project)
1+
# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python:
2+
import os
3+
4+
# Name of your extesion, this will also be it's file name.
5+
projectName = 'timerex'
6+
7+
# smsdk_ext.cpp will be automatically added later
8+
sourceFiles = [
9+
'timerex/extension.cpp',
10+
]
11+
12+
project = Extension.HL2Project(builder, projectName + '.ext')
13+
14+
if os.path.isfile(os.path.join(builder.currentSourcePath, 'sdk', 'smsdk_ext.cpp')):
15+
# Use the copy included in the project
16+
project.sources += [os.path.join('sdk', 'smsdk_ext.cpp')]
17+
else:
18+
# Use the copy included with SM 1.6 and newer
19+
project.sources += [os.path.join(Extension.sm_root, 'public', 'smsdk_ext.cpp')]
20+
21+
project.sources += sourceFiles
22+
23+
for cxx in builder.targets:
24+
binary = Extension.HL2Config(builder, project, projectName + '.ext', cxx)
25+
arch = {'x86': 'i686', 'x86_64': 'x86_64'}[binary.compiler.target.arch]
26+
if builder.options.opt == '1':
27+
directory = 'release'
28+
else:
29+
directory = 'debug'
30+
31+
path = ''
32+
if binary.compiler.target.platform == 'linux':
33+
path = os.path.join(builder.currentSourcePath, 'target', f'{arch}-unknown-linux-musl', directory, 'libtimerex.a')
34+
elif binary.compiler.target.platform == 'windows':
35+
path = os.path.join(builder.currentSourcePath, 'target', f'{arch}-pc-windows-msvc', directory, 'timerex.lib')
36+
else:
37+
raise
38+
binary.compiler.postlink += [path]
39+
40+
binary.compiler.cxxincludes += [os.path.join(builder.currentSourcePath, 'timerex')]
41+
42+
if binary.compiler.family == 'msvc':
43+
binary.compiler.linkflags += [
44+
'userenv.lib',
45+
'ws2_32.lib',
46+
"ntdll.lib",
47+
]
48+
49+
Extension.extensions = builder.Add(project)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "timerex"
3-
version = "3.0.0"
3+
version = "3.0.1"
44
authors = ["CirnoV <cirnov59@gmail.com>"]
55
edition = "2024"
66

rust-toolchain.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[toolchain]
2-
targets = [ "i686-unknown-linux-gnu", "i686-pc-windows-msvc", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc" ]
1+
[toolchain]
2+
targets = [ "i686-unknown-linux-musl", "i686-pc-windows-msvc", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc" ]
33
channel = "nightly"

0 commit comments

Comments
 (0)