Add .py file extension to Python
This commit is contained in:
10
.github/workflows/Linux_build.yml
vendored
10
.github/workflows/Linux_build.yml
vendored
@@ -63,7 +63,7 @@ jobs:
|
|||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get -y install clang-format-$LLVM_VERSION
|
sudo apt-get -y install clang-format-$LLVM_VERSION
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: ./xenia-build lint --all
|
run: ./xenia-build.py lint --all
|
||||||
|
|
||||||
build-clang:
|
build-clang:
|
||||||
name: Build (Clang ${{ matrix.LLVM_VERSION }})
|
name: Build (Clang ${{ matrix.LLVM_VERSION }})
|
||||||
@@ -85,12 +85,12 @@ jobs:
|
|||||||
sudo apt-add-repository "deb http://apt.llvm.org/${UBUNTU_BASE}/ llvm-toolchain-${UBUNTU_BASE}-${{ matrix.LLVM_VERSION }} main"
|
sudo apt-add-repository "deb http://apt.llvm.org/${UBUNTU_BASE}/ llvm-toolchain-${UBUNTU_BASE}-${{ matrix.LLVM_VERSION }} main"
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev clang-${{ matrix.LLVM_VERSION }} ninja-build
|
sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev clang-${{ matrix.LLVM_VERSION }} ninja-build
|
||||||
./xenia-build setup
|
./xenia-build.py setup
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
CC: clang-${{ matrix.LLVM_VERSION }}
|
CC: clang-${{ matrix.LLVM_VERSION }}
|
||||||
CXX: clang++-${{ matrix.LLVM_VERSION }}
|
CXX: clang++-${{ matrix.LLVM_VERSION }}
|
||||||
run: ./xenia-build build --config=Release
|
run: ./xenia-build.py build --config=Release
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
id: prepare_artifacts
|
id: prepare_artifacts
|
||||||
run: |
|
run: |
|
||||||
@@ -123,13 +123,13 @@ jobs:
|
|||||||
# run: |
|
# run: |
|
||||||
# sudo apt-get -y update
|
# sudo apt-get -y update
|
||||||
# sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev g++-${{ matrix.GCC_VERSION }}
|
# sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev g++-${{ matrix.GCC_VERSION }}
|
||||||
# ./xenia-build setup
|
# ./xenia-build.py setup
|
||||||
# - name: Build
|
# - name: Build
|
||||||
# env:
|
# env:
|
||||||
# CC: gcc-${{ matrix.GCC_VERSION }}
|
# CC: gcc-${{ matrix.GCC_VERSION }}
|
||||||
# CXX: g++-${{ matrix.GCC_VERSION }}
|
# CXX: g++-${{ matrix.GCC_VERSION }}
|
||||||
# # AR: ar
|
# # AR: ar
|
||||||
# run: ./xenia-build build --config=Release
|
# run: ./xenia-build.py build --config=Release
|
||||||
# - name: Prepare artifacts
|
# - name: Prepare artifacts
|
||||||
# id: prepare_artifacts
|
# id: prepare_artifacts
|
||||||
# run: |
|
# run: |
|
||||||
|
|||||||
6
.github/workflows/Windows_build.yml
vendored
6
.github/workflows/Windows_build.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@main
|
- uses: actions/checkout@main
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: .\xb lint --all
|
run: .\xenia-build.py lint --all
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
@@ -69,9 +69,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: .\xb setup
|
run: .\xenia-build.py setup
|
||||||
- name: Build
|
- name: Build
|
||||||
run: .\xb build --no_premake --config=Release --target=src\xenia-app
|
run: .\xenia-build.py build --no_premake --config=Release --target=src\xenia-app
|
||||||
- name: Prepare artifacts
|
- name: Prepare artifacts
|
||||||
id: prepare_artifacts
|
id: prepare_artifacts
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// This code was autogenerated by ./tools/ppc-table-gen. Do not modify!
|
// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify!
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifndef XENIA_CPU_PPC_PPC_OPCODE_H_
|
#ifndef XENIA_CPU_PPC_PPC_OPCODE_H_
|
||||||
#define XENIA_CPU_PPC_PPC_OPCODE_H_
|
#define XENIA_CPU_PPC_PPC_OPCODE_H_
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// This code was autogenerated by ./tools/ppc-table-gen. Do not modify!
|
// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify!
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -5407,7 +5407,7 @@ static constexpr PPCOpcodeDisasmInfo ppc_opcode_disasm_table[] = {
|
|||||||
INSTRUCTION(0x7c000278, "xorx" , kX , kI, kGeneral, "XOR" , (PPCOpcodeField::kRS,PPCOpcodeField::kRB), (PPCOpcodeField::kRA,PPCOpcodeField::kCRcond), PrintDisasm_xorx),
|
INSTRUCTION(0x7c000278, "xorx" , kX , kI, kGeneral, "XOR" , (PPCOpcodeField::kRS,PPCOpcodeField::kRB), (PPCOpcodeField::kRA,PPCOpcodeField::kCRcond), PrintDisasm_xorx),
|
||||||
};
|
};
|
||||||
#undef INSTRUCTION
|
#undef INSTRUCTION
|
||||||
static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen");
|
static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py");
|
||||||
|
|
||||||
const PPCOpcodeDisasmInfo& GetOpcodeDisasmInfo(PPCOpcode opcode) {
|
const PPCOpcodeDisasmInfo& GetOpcodeDisasmInfo(PPCOpcode opcode) {
|
||||||
return ppc_opcode_disasm_table[static_cast<int>(opcode)];
|
return ppc_opcode_disasm_table[static_cast<int>(opcode)];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// This code was autogenerated by ./tools/ppc-table-gen. Do not modify!
|
// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify!
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// This code was autogenerated by ./tools/ppc-table-gen. Do not modify!
|
// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify!
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -471,7 +471,7 @@ PPCOpcodeInfo ppc_opcode_table[] = {
|
|||||||
INSTRUCTION(0x7c000278, "xorx" , kX , kI, kGeneral),
|
INSTRUCTION(0x7c000278, "xorx" , kX , kI, kGeneral),
|
||||||
};
|
};
|
||||||
#undef INSTRUCTION
|
#undef INSTRUCTION
|
||||||
static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen");
|
static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py");
|
||||||
|
|
||||||
const PPCOpcodeInfo& GetOpcodeInfo(PPCOpcode opcode) {
|
const PPCOpcodeInfo& GetOpcodeInfo(PPCOpcode opcode) {
|
||||||
return ppc_opcode_table[static_cast<int>(opcode)];
|
return ppc_opcode_table[static_cast<int>(opcode)];
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ runner.
|
|||||||
|
|
||||||
Each test is structured as a source `[name].s` PPC assembly file and the
|
Each test is structured as a source `[name].s` PPC assembly file and the
|
||||||
generated outputs. The outputs are made using the custom build of binutils
|
generated outputs. The outputs are made using the custom build of binutils
|
||||||
setup when `xenia-build gentests` is called and are checked in to make it easier
|
setup when `xb gentests` is called and are checked in to make it easier
|
||||||
to run the tests on Windows.
|
to run the tests on Windows.
|
||||||
|
|
||||||
Tests are run using the `xenia-test` app or via `xenia-build test`.
|
Tests are run using the `xenia-test` app or via `xb test`.
|
||||||
|
|
||||||
## Execution
|
## Execution
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ def setup_premake_path_override():
|
|||||||
# its repository.
|
# its repository.
|
||||||
# On Termux, the home directory is in the internal storage - use it for
|
# On Termux, the home directory is in the internal storage - use it for
|
||||||
# executing.
|
# executing.
|
||||||
# If xenia-build doesn't have execute permissions, Xenia is in the external
|
# If xenia-build.py doesn't have execute permissions, Xenia is in the external
|
||||||
# storage now.
|
# storage now.
|
||||||
try:
|
try:
|
||||||
popen = subprocess.Popen(
|
popen = subprocess.Popen(
|
||||||
['uname', '-o'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
['uname', '-o'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
||||||
universal_newlines=True)
|
universal_newlines=True)
|
||||||
if popen.communicate()[0] == 'Android\n':
|
if popen.communicate()[0] == 'Android\n':
|
||||||
xb_file = os.path.join(root_path, 'xenia-build')
|
xb_file = os.path.join(root_path, 'xenia-build.py')
|
||||||
if (os.path.isfile(xb_file) and not os.access(xb_file, os.X_OK) and
|
if (os.path.isfile(xb_file) and not os.access(xb_file, os.X_OK) and
|
||||||
'HOME' in os.environ):
|
'HOME' in os.environ):
|
||||||
premake_path = os.path.join(
|
premake_path = os.path.join(
|
||||||
@@ -40,7 +40,7 @@ def main():
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Setup main argument parser and common arguments.
|
# Setup main argument parser and common arguments.
|
||||||
parser = argparse.ArgumentParser(prog='gpu-trace-diff',
|
parser = argparse.ArgumentParser(prog='gpu-trace-diff.py',
|
||||||
description='Run and diff GPU traces.')
|
description='Run and diff GPU traces.')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-x', '--executable',
|
'-x', '--executable',
|
||||||
@@ -217,7 +217,7 @@ def generate_table(insns):
|
|||||||
for i in insns:
|
for i in insns:
|
||||||
w1(fmt % (i.opcode, i.mnem, i.form, i.group, i.type))
|
w1(fmt % (i.opcode, i.mnem, i.form, i.group, i.type))
|
||||||
w0('};')
|
w0('};')
|
||||||
w0('static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen");')
|
w0('static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py");')
|
||||||
w0('')
|
w0('')
|
||||||
w0('const PPCOpcodeInfo& GetOpcodeInfo(PPCOpcode opcode) {')
|
w0('const PPCOpcodeInfo& GetOpcodeInfo(PPCOpcode opcode) {')
|
||||||
w1('return ppc_opcode_table[static_cast<int>(opcode)];')
|
w1('return ppc_opcode_table[static_cast<int>(opcode)];')
|
||||||
@@ -379,7 +379,7 @@ def generate_disasm(insns):
|
|||||||
('PrintDisasm_' + literal_mnem(i.mnem)) if i.disasm_str else 'nullptr',
|
('PrintDisasm_' + literal_mnem(i.mnem)) if i.disasm_str else 'nullptr',
|
||||||
))
|
))
|
||||||
w0('};')
|
w0('};')
|
||||||
w0('static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen");')
|
w0('static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast<int>(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py");')
|
||||||
w0('')
|
w0('')
|
||||||
w0('const PPCOpcodeDisasmInfo& GetOpcodeDisasmInfo(PPCOpcode opcode) {')
|
w0('const PPCOpcodeDisasmInfo& GetOpcodeDisasmInfo(PPCOpcode opcode) {')
|
||||||
w1('return ppc_opcode_disasm_table[static_cast<int>(opcode)];')
|
w1('return ppc_opcode_disasm_table[static_cast<int>(opcode)];')
|
||||||
6
xb.bat
6
xb.bat
@@ -1,5 +1,5 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
REM Copyright 2022 Ben Vanik. All Rights Reserved.
|
REM Copyright 2025 Ben Vanik. All Rights Reserved.
|
||||||
|
|
||||||
SET "DIR=%~dp0"
|
SET "DIR=%~dp0"
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@ IF %_RESULT% NEQ 0 (
|
|||||||
|
|
||||||
|
|
||||||
REM ============================================================================
|
REM ============================================================================
|
||||||
REM Trampoline into xenia-build
|
REM Trampoline into xenia-build.py
|
||||||
REM ============================================================================
|
REM ============================================================================
|
||||||
|
|
||||||
"%PYTHON_EXE%" "%DIR%\xenia-build" %*
|
"%PYTHON_EXE%" "%DIR%\xenia-build.py" %*
|
||||||
EXIT /b %ERRORLEVEL%
|
EXIT /b %ERRORLEVEL%
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
xb.ps1
2
xb.ps1
@@ -12,4 +12,4 @@ if (!$pythonPath) {
|
|||||||
Throw "ERROR: Python 3.9+ 64-bit must be installed and on PATH:`nhttps://www.python.org/"
|
Throw "ERROR: Python 3.9+ 64-bit must be installed and on PATH:`nhttps://www.python.org/"
|
||||||
}
|
}
|
||||||
|
|
||||||
& $pythonPath "$($PSScriptRoot)/xenia-build" $args
|
& $pythonPath "$($PSScriptRoot)/xenia-build.py" $args
|
||||||
|
|||||||
6
xenia-build → xenia-build.py
Executable file → Normal file
6
xenia-build → xenia-build.py
Executable file → Normal file
@@ -151,7 +151,7 @@ def main():
|
|||||||
f"https://github.com/xenia-canary/xenia-canary/blob/{default_branch}/docs/building.md")
|
f"https://github.com/xenia-canary/xenia-canary/blob/{default_branch}/docs/building.md")
|
||||||
|
|
||||||
# Setup main argument parser and common arguments.
|
# Setup main argument parser and common arguments.
|
||||||
parser = ArgumentParser(prog="xenia-build")
|
parser = ArgumentParser(prog="xenia-build.py")
|
||||||
|
|
||||||
# Grab all commands and populate the argument parser for each.
|
# Grab all commands and populate the argument parser for each.
|
||||||
subparsers = parser.add_subparsers(title="subcommands",
|
subparsers = parser.add_subparsers(title="subcommands",
|
||||||
@@ -504,7 +504,7 @@ def run_premake(target_os, action, cc=None):
|
|||||||
"""
|
"""
|
||||||
args = [
|
args = [
|
||||||
sys.executable,
|
sys.executable,
|
||||||
os.path.join("tools", "build", "premake"),
|
os.path.join("tools", "build", "premake.py"),
|
||||||
"--file=premake5.lua",
|
"--file=premake5.lua",
|
||||||
f"--os={target_os}",
|
f"--os={target_os}",
|
||||||
#"--test-suite-mode=combined",
|
#"--test-suite-mode=combined",
|
||||||
@@ -1386,7 +1386,7 @@ class GpuTestCommand(BaseBuildCommand):
|
|||||||
any_failed = False
|
any_failed = False
|
||||||
result = shell_call([
|
result = shell_call([
|
||||||
sys.executable,
|
sys.executable,
|
||||||
os.path.join(self_path, "tools", "gpu-trace-diff"),
|
os.path.join(self_path, "tools", "gpu-trace-diff.py"),
|
||||||
f"--executable={test_executables[0]}",
|
f"--executable={test_executables[0]}",
|
||||||
f"--trace_path={os.path.join(reference_trace_root, 'traces')}",
|
f"--trace_path={os.path.join(reference_trace_root, 'traces')}",
|
||||||
f"--output_path={output_path}",
|
f"--output_path={output_path}",
|
||||||
Reference in New Issue
Block a user