Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdb61af358 | |||
| 8155d78230 | |||
| b052497701 | |||
| ea71e0d8b2 | |||
| c6e74909b4 | |||
| a9643c78e7 | |||
| 57133b71ee | |||
| 00ddcbd9ff | |||
| eb29dfe1f9 | |||
| a731bedad0 | |||
| 1aa358a78f | |||
| 505c9a609f | |||
| bfd4cff9ff | |||
| 002b7b4d54 |
@@ -139,11 +139,8 @@ jobs:
|
|||||||
/^## / && index($0, ver) { found=1; next }
|
/^## / && index($0, ver) { found=1; next }
|
||||||
found && /^## / { exit }
|
found && /^## / { exit }
|
||||||
found { print }
|
found { print }
|
||||||
' CHANGELOG.md > release_body.md
|
' CHANGELOG.md > release_body.md echo "" >> release_body.md
|
||||||
# Append Gitea notice
|
echo "--" >> release_body.md
|
||||||
echo "" >> release_body.md
|
|
||||||
echo "---" >> release_body.md
|
|
||||||
echo "_Repository primario: vedi link Gitea nel README. Il mirror GitHub è generato automaticamente._" >> release_body.md
|
|
||||||
|
|
||||||
- name: Package plugins ZIP
|
- name: Package plugins ZIP
|
||||||
id: pkg
|
id: pkg
|
||||||
@@ -211,7 +208,8 @@ jobs:
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
with urllib.request.urlopen(req) as resp:
|
with urllib.request.urlopen(req) as resp:
|
||||||
return json.loads(resp.read().decode("utf-8"))
|
raw = resp.read()
|
||||||
|
return json.loads(raw) if raw else {}
|
||||||
|
|
||||||
def upload_asset(rid, path, auth_scheme):
|
def upload_asset(rid, path, auth_scheme):
|
||||||
p = Path(path)
|
p = Path(path)
|
||||||
@@ -234,7 +232,8 @@ jobs:
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
with urllib.request.urlopen(req) as resp:
|
with urllib.request.urlopen(req) as resp:
|
||||||
return json.loads(resp.read().decode("utf-8"))
|
raw = resp.read()
|
||||||
|
return json.loads(raw) if raw else {}
|
||||||
|
|
||||||
auth_scheme = None
|
auth_scheme = None
|
||||||
last_error = None
|
last_error = None
|
||||||
@@ -291,7 +290,7 @@ jobs:
|
|||||||
upload_names = {zip_name, "SHA256SUMS.txt"}
|
upload_names = {zip_name, "SHA256SUMS.txt"}
|
||||||
for asset in existing:
|
for asset in existing:
|
||||||
if asset["name"] in upload_names:
|
if asset["name"] in upload_names:
|
||||||
request("DELETE", f"/repos/{repo}/releases/assets/{asset['id']}", auth_scheme=auth_scheme)
|
request("DELETE", f"/repos/{repo}/releases/{rid}/assets/{asset['id']}", auth_scheme=auth_scheme)
|
||||||
print(f"Deleted existing asset: {asset['name']}")
|
print(f"Deleted existing asset: {asset['name']}")
|
||||||
|
|
||||||
# Carica ZIP e SHA256SUMS
|
# Carica ZIP e SHA256SUMS
|
||||||
@@ -303,3 +302,21 @@ jobs:
|
|||||||
print(f"WARNING: {f} not found, skipping upload")
|
print(f"WARNING: {f} not found, skipping upload")
|
||||||
PY
|
PY
|
||||||
|
|
||||||
|
- name: Push back dist/ DLLs to Gitea
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
run: |
|
||||||
|
tag="${{ steps.tag.outputs.tag }}"
|
||||||
|
# Copia le DLL compilate in dist/
|
||||||
|
for dir in amd64-unicode x86-ansi x86-unicode; do
|
||||||
|
mkdir -p "dist/$dir"
|
||||||
|
cp "dll-bundle/$dir/nsis7z.dll" "dist/$dir/nsis7z.dll"
|
||||||
|
done
|
||||||
|
# Configura git con le credenziali Gitea
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git remote add gitea "https://x-token:${GITEA_TOKEN}@gitea.emulab.it/Simone/nsis-plugin-ns7zip.git"
|
||||||
|
git add dist/
|
||||||
|
git diff --cached --quiet || git commit -m "chore: update dist/ DLLs for ${tag}"
|
||||||
|
git push gitea HEAD:main
|
||||||
|
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -141,7 +141,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
str(_VSWHERE_PATH),
|
str(_VSWHERE_PATH),
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -747,10 +749,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -763,10 +765,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -766,6 +768,8 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Find MSBuild early (needed for project path selection)
|
# Find MSBuild early (needed for project path selection)
|
||||||
@@ -777,6 +781,9 @@ Examples:
|
|||||||
|
|
||||||
# Get project paths (project file depends on toolset)
|
# Get project paths (project file depends on toolset)
|
||||||
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -630,6 +632,9 @@ Examples:
|
|||||||
help='Disable additional build optimizations')
|
help='Disable additional build optimizations')
|
||||||
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
||||||
help='Visual Studio version to use (default: auto)')
|
help='Visual Studio version to use (default: auto)')
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead '
|
||||||
|
'of <repo>/plugins/<config>')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -642,6 +647,9 @@ Examples:
|
|||||||
|
|
||||||
# Get project paths
|
# Get project paths
|
||||||
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect the output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
if not project_file.exists():
|
if not project_file.exists():
|
||||||
|
|||||||
@@ -146,7 +146,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
str(_VSWHERE_PATH),
|
str(_VSWHERE_PATH),
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -747,10 +749,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -763,10 +765,15 @@ Examples:
|
|||||||
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
help='Visual Studio version to use (default: auto - tries 2026 then 2022)'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Get project paths early for list-project
|
# Get project paths early for list-project
|
||||||
project_dir, project_file, plugins_dir = get_project_paths()
|
project_dir, project_file, plugins_dir = get_project_paths()
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
# List project configurations
|
# List project configurations
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
|
|||||||
@@ -150,7 +150,9 @@ def _find_msbuild_via_vswhere(vs_version: str) -> 'Optional[Tuple[Path, str, str
|
|||||||
'-products', '*',
|
'-products', '*',
|
||||||
'-version', _VS_VERSION_RANGE[ver],
|
'-version', _VS_VERSION_RANGE[ver],
|
||||||
'-latest',
|
'-latest',
|
||||||
|
'-prerelease',
|
||||||
'-requires', 'Microsoft.Component.MSBuild',
|
'-requires', 'Microsoft.Component.MSBuild',
|
||||||
|
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||||
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
'-find', r'MSBuild\**\Bin\MSBuild.exe',
|
||||||
],
|
],
|
||||||
capture_output=True, text=True, timeout=15,
|
capture_output=True, text=True, timeout=15,
|
||||||
@@ -631,6 +633,8 @@ Examples:
|
|||||||
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
parser.add_argument('--vs-version', choices=['auto', '2026', '2022'], default='auto',
|
||||||
help='Visual Studio version to use (default: auto)')
|
help='Visual Studio version to use (default: auto)')
|
||||||
|
|
||||||
|
parser.add_argument('--dist', action='store_true',
|
||||||
|
help='Copy built DLLs to <repo>/dist/<config> instead of <repo>/plugins/<config>')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Find MSBuild
|
# Find MSBuild
|
||||||
@@ -642,6 +646,9 @@ Examples:
|
|||||||
|
|
||||||
# Get project paths
|
# Get project paths
|
||||||
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
project_dir, project_file, plugins_dir = get_project_paths(platform_toolset)
|
||||||
|
# --dist: redirect output root from <repo>/plugins to <repo>/dist.
|
||||||
|
if args.dist:
|
||||||
|
plugins_dir = plugins_dir.parent / 'dist'
|
||||||
|
|
||||||
if args.list_project:
|
if args.list_project:
|
||||||
if not project_file.exists():
|
if not project_file.exists():
|
||||||
|
|||||||
@@ -15,8 +15,15 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import threading
|
||||||
|
import time
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Symlink creation is shared across configs; serialize it so parallel
|
||||||
|
# per-config builds don't race recreating the bundle symlinks.
|
||||||
|
_SYMLINK_LOCK = threading.Lock()
|
||||||
|
|
||||||
ROOT = Path(__file__).resolve().parents[2]
|
ROOT = Path(__file__).resolve().parents[2]
|
||||||
|
|
||||||
OVERLAY = ROOT / "tools" / "linux" / "overlay"
|
OVERLAY = ROOT / "tools" / "linux" / "overlay"
|
||||||
@@ -151,13 +158,16 @@ def _build_one(
|
|||||||
jobs: int,
|
jobs: int,
|
||||||
clean: bool,
|
clean: bool,
|
||||||
cleanup_artifacts: bool,
|
cleanup_artifacts: bool,
|
||||||
|
dist: bool = False,
|
||||||
) -> int:
|
) -> int:
|
||||||
layout = VERSION_LAYOUT[zip_version]
|
layout = VERSION_LAYOUT[zip_version]
|
||||||
vendor_7zip = layout["vendor_7zip"]
|
vendor_7zip = layout["vendor_7zip"]
|
||||||
bundle_dir = layout["bundle_dir"]
|
bundle_dir = layout["bundle_dir"]
|
||||||
|
|
||||||
# Symlinks are not committed to git; recreate them on Linux if missing.
|
# Symlinks are not committed to git; recreate them on Linux if missing.
|
||||||
|
# Serialized: concurrent per-config builds would race here.
|
||||||
if zip_version in VERSION_LAYOUT:
|
if zip_version in VERSION_LAYOUT:
|
||||||
|
with _SYMLINK_LOCK:
|
||||||
_ensure_bundle_symlinks(zip_version, bundle_dir, vendor_7zip)
|
_ensure_bundle_symlinks(zip_version, bundle_dir, vendor_7zip)
|
||||||
|
|
||||||
cfg = CONFIGS[cfg_name]
|
cfg = CONFIGS[cfg_name]
|
||||||
@@ -243,7 +253,10 @@ def _build_one(
|
|||||||
print(f"ERROR: expected artifact not found: {built}", file=sys.stderr)
|
print(f"ERROR: expected artifact not found: {built}", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
dest = ROOT / cfg["dest"]
|
rel_dest = cfg["dest"]
|
||||||
|
if dist and rel_dest.startswith("plugins/"):
|
||||||
|
rel_dest = "dist/" + rel_dest[len("plugins/"):]
|
||||||
|
dest = ROOT / rel_dest
|
||||||
dest.parent.mkdir(parents=True, exist_ok=True)
|
dest.parent.mkdir(parents=True, exist_ok=True)
|
||||||
shutil.copy2(built, dest)
|
shutil.copy2(built, dest)
|
||||||
|
|
||||||
@@ -257,6 +270,26 @@ def _build_one(
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def _print_timing(
|
||||||
|
order: list[str],
|
||||||
|
codes: dict[str, int],
|
||||||
|
durations: dict[str, float],
|
||||||
|
wall: float,
|
||||||
|
) -> None:
|
||||||
|
"""Per-config + total wall-clock timing summary."""
|
||||||
|
print("\n" + "=" * 50)
|
||||||
|
print("[linux] Build timing")
|
||||||
|
print("-" * 50)
|
||||||
|
for cfg in order:
|
||||||
|
status = "OK " if codes.get(cfg) == 0 else "FAIL"
|
||||||
|
secs = durations.get(cfg)
|
||||||
|
secs_s = f"{secs:6.1f}s" if secs is not None else " N/A"
|
||||||
|
print(f" {status} {cfg:<13} {secs_s}")
|
||||||
|
print("-" * 50)
|
||||||
|
print(f" TOTAL wall clock {wall:6.1f}s")
|
||||||
|
print("=" * 50)
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
parser = argparse.ArgumentParser(description="Linux build path for nsis7z")
|
parser = argparse.ArgumentParser(description="Linux build path for nsis7z")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@@ -303,6 +336,24 @@ def main() -> int:
|
|||||||
help="Keep per-config build artifact directories (_o_*)",
|
help="Keep per-config build artifact directories (_o_*)",
|
||||||
)
|
)
|
||||||
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
parser.add_argument("--verbose", action="store_true", help="Verbose output")
|
||||||
|
parser.add_argument(
|
||||||
|
"--dist",
|
||||||
|
action="store_true",
|
||||||
|
help="Copy built DLLs to <repo>/dist/<config> instead of "
|
||||||
|
"<repo>/plugins/<config>",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--parallel",
|
||||||
|
action="store_true",
|
||||||
|
default=True,
|
||||||
|
help="Build configs concurrently (default: True)",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--no-parallel",
|
||||||
|
action="store_false",
|
||||||
|
dest="parallel",
|
||||||
|
help="Build configs one at a time",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
_require_tool("make")
|
_require_tool("make")
|
||||||
@@ -319,17 +370,61 @@ def main() -> int:
|
|||||||
|
|
||||||
wanted = list(CONFIGS.keys()) if "all" in args.configs else args.configs
|
wanted = list(CONFIGS.keys()) if "all" in args.configs else args.configs
|
||||||
|
|
||||||
|
if args.parallel and len(wanted) > 1:
|
||||||
|
# Each config gets the FULL make -j (no //nconfigs split). The
|
||||||
|
# configs are independent; mild CPU oversubscription is handled
|
||||||
|
# by the scheduler and is still far faster than serial — this is
|
||||||
|
# exactly what the Windows (MSBuild) parallel build does, which
|
||||||
|
# finishes in ~2min on the same vCPU/RAM. Splitting -j across
|
||||||
|
# configs neutered intra-config parallelism (on a 4-vCPU VM it
|
||||||
|
# became make -j1) and gave no speedup.
|
||||||
|
per_jobs = jobs
|
||||||
|
print(
|
||||||
|
f"[linux] Building {len(wanted)} configs in parallel "
|
||||||
|
f"(make -j{per_jobs} each)"
|
||||||
|
)
|
||||||
|
codes: dict[str, int] = {}
|
||||||
|
durations: dict[str, float] = {}
|
||||||
|
|
||||||
|
def _timed(cfg: str, jb: int) -> None:
|
||||||
|
t0 = time.perf_counter()
|
||||||
|
codes[cfg] = _build_one(
|
||||||
|
args.zip_version, cfg, args.verbose, jb,
|
||||||
|
args.clean, args.cleanup_artifacts, args.dist,
|
||||||
|
)
|
||||||
|
durations[cfg] = time.perf_counter() - t0
|
||||||
|
|
||||||
|
wall0 = time.perf_counter()
|
||||||
|
with ThreadPoolExecutor(max_workers=len(wanted)) as ex:
|
||||||
|
futs = [ex.submit(_timed, c, per_jobs) for c in wanted]
|
||||||
|
for fut in futs:
|
||||||
|
fut.result()
|
||||||
|
wall = time.perf_counter() - wall0
|
||||||
|
_print_timing(wanted, codes, durations, wall)
|
||||||
|
for name in wanted:
|
||||||
|
if codes[name] != 0:
|
||||||
|
return codes[name]
|
||||||
|
else:
|
||||||
|
codes = {}
|
||||||
|
durations = {}
|
||||||
|
wall0 = time.perf_counter()
|
||||||
for cfg_name in wanted:
|
for cfg_name in wanted:
|
||||||
code = _build_one(
|
t0 = time.perf_counter()
|
||||||
|
codes[cfg_name] = _build_one(
|
||||||
args.zip_version,
|
args.zip_version,
|
||||||
cfg_name,
|
cfg_name,
|
||||||
args.verbose,
|
args.verbose,
|
||||||
jobs,
|
jobs,
|
||||||
args.clean,
|
args.clean,
|
||||||
args.cleanup_artifacts,
|
args.cleanup_artifacts,
|
||||||
|
args.dist,
|
||||||
)
|
)
|
||||||
if code != 0:
|
durations[cfg_name] = time.perf_counter() - t0
|
||||||
return code
|
if codes[cfg_name] != 0:
|
||||||
|
_print_timing(wanted, codes, durations,
|
||||||
|
time.perf_counter() - wall0)
|
||||||
|
return codes[cfg_name]
|
||||||
|
_print_timing(wanted, codes, durations, time.perf_counter() - wall0)
|
||||||
|
|
||||||
print("[linux] Build completed")
|
print("[linux] Build completed")
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user