Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/filter-support/filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ git filter-branch -f --tree-filter 'rm -rf .github hardware i18n resources .vsco

# Need to delete submodules actively.
# Done in two passes for speed.
git filter-branch -f --tree-filter 'find third_party -maxdepth 1 -type d -and -not -name third_party -and -not -path third_party/cueparser* -and -not -path third_party/ELFIO\* -and -not -path third_party/expected\* -and -not -path third_party/fmt\* -and -not -path third_party/googletest\* -and -not -path third_party/iec-60908b\* -and -not -path third_party/magic_enum\* -and -not -path third_party/ucl\* -exec rm -rf {} \; || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find third_party -maxdepth 1 -type d -and -not -name third_party -and -not -path third_party/cueparser* -and -not -path third_party/ELFIO\* -and -not -path third_party/expected\* -and -not -path third_party/fmt\* -and -not -path third_party/googletest\* -and -not -path third_party/iec-60908b\* -and -not -path third_party/magic_enum\* -and -not -path third_party/ucl\* -exec git rm -f {} \; || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find third_party -maxdepth 1 -type d -and -not -name third_party -and -not -path third_party/cueparser* -and -not -path third_party/ELFIO\* -and -not -path third_party/expected\* -and -not -path third_party/fmt\* -and -not -path third_party/googletest\* -and -not -path third_party/iec-60908b\* -and -not -path third_party/magic_enum\* -and -not -path third_party/PEGTL\* -and -not -path third_party/ucl\* -exec rm -rf {} \; || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find third_party -maxdepth 1 -type d -and -not -name third_party -and -not -path third_party/cueparser* -and -not -path third_party/ELFIO\* -and -not -path third_party/expected\* -and -not -path third_party/fmt\* -and -not -path third_party/googletest\* -and -not -path third_party/iec-60908b\* -and -not -path third_party/magic_enum\* -and -not -path third_party/PEGTL\* -and -not -path third_party/ucl\* -exec git rm -f {} \; || true' --tag-name-filter cat --prune-empty
Comment on lines +23 to +24

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Discover submodules from the index, not the working tree.

Submodules are gitlink entries, and this workflow does not initialize submodules during checkout. Their directories can therefore be absent from the tree-filter worktree, causing find to skip them and leaving unwanted third_party gitlinks in the exported history. Enumerate mode 160000 entries with git ls-files -s (while applying the same exclusions), then remove those paths with git rm -f.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/filter-support/filter.sh around lines 23 - 24, Update the second
filter-branch tree-filter command to enumerate third_party submodules from the
Git index using git ls-files -s, selecting mode 160000 entries while preserving
the existing exclusions. Remove each matching gitlink path with git rm -f,
rather than relying on find to discover directories in the worktree; keep the
existing tag filtering and prune-empty options unchanged.


# Delete ffmpeg, versionning, Lua, and libuv-related source code
git filter-branch -f --tree-filter 'find src -type f -name \*lua\* -delete || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find src -type f -name \*lua\* -and -not -name xmake.lua -delete || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find src -type f -name assembler.\* -delete || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find src -type f -name ffmpeg\* -delete || true' --tag-name-filter cat --prune-empty
git filter-branch -f --tree-filter 'find src -type f -name uv\* -delete || true' --tag-name-filter cat --prune-empty
Expand Down
22 changes: 22 additions & 0 deletions src/support/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local support_root = path.join(os.scriptdir(), "..", "..")

add_rules("mode.debug", "mode.release")

add_requires("fmt", "zlib")
set_languages("c++26")

target("pcsx.support")
set_kind("static")

if is_plat("windows") then
add_cxflags("/bigobj")
end

add_packages("fmt", "zlib")
add_includedirs(
path.join(support_root, "src"),
path.join(support_root, "third_party"),
path.join(support_root, "third_party", "PEGTL", "include")
)

add_files("*.cc")
28 changes: 28 additions & 0 deletions src/supportpsx/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local support_root = path.join(os.scriptdir(), "..", "..")

add_rules("mode.debug", "mode.release")

add_requires("fmt", "zlib")
set_languages("c11", "c++26")

target("pcsx.supportpsx")
set_kind("static")

add_packages("fmt", "zlib")
add_defines(
"ACC_CONFIG_AUTO_NO_FUNCTIONS"
)
add_includedirs(
path.join(support_root, "src"),
path.join(support_root, "third_party"),
path.join(support_root, "third_party", "ELFIO"),
path.join(support_root, "third_party", "ucl"),
path.join(support_root, "third_party", "ucl", "include")
)

add_files("*.c", "*.cc")

add_files(
path.join(support_root, "third_party", "ucl", "src", "alloc.c"),
path.join(support_root, "third_party", "ucl", "src", "n2e_99.c")
)
47 changes: 47 additions & 0 deletions tools/ps1-packer/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
local support_root = path.join(os.scriptdir(), "..", "..")

add_rules("mode.debug", "mode.release")

includes(
path.join(support_root, "src", "support"),
path.join(support_root, "src", "supportpsx")
)

add_requires("fmt", "zlib")
set_languages("c++26")

target("ps1-packer")
set_kind("binary")

add_packages("fmt", "zlib")
add_deps("pcsx.support", "pcsx.supportpsx")
add_includedirs(
path.join(support_root, "src"),
path.join(support_root, "third_party")
)

add_files("*.cc")

rule("ps1-packer.psexe")
set_extensions(".elf")
on_load(function(target)
local extension = target:values("psx.extension")
if extension == nil then
extension = ".psexe"
end
local targetdir = target:targetdir()
local targetname = target:basename()
local outfile = path.join(targetdir, targetname .. extension)
target:add("deps", "ps1-packer", {inherit = false})
target:add("values", "ps1-packer.psexe.postlink.outfile", outfile)
target:add("values", "psexe", false)
end)
after_link(function(target)
local ps1packer = target:dep("ps1-packer")
local outfile = target:values("ps1-packer.psexe.postlink.outfile")
os.run("%s %s -o %s", ps1packer:targetfile(), target:targetfile(), outfile)
end)
on_clean(function(target)
local outfile = target:values("ps1-packer.psexe.postlink.outfile")
os.tryrm(outfile)
end)
Loading