Skip to content
Open
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
37 changes: 34 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,27 @@
from pathlib import Path
from typing import Optional

# Reconfigure stdout/stderr to UTF-8 on Windows to avoid UnicodeEncodeError on emojis
if sys.stdout.encoding.lower() != 'utf-8':
try:
sys.stdout.reconfigure(encoding='utf-8')
except Exception:
pass
if sys.stderr.encoding.lower() != 'utf-8':
try:
sys.stderr.reconfigure(encoding='utf-8')
except Exception:
pass
Comment on lines +17 to +27

# Fix for encryptly failing/hanging on Windows if home path has spaces
if platform.system().lower() == "windows" and " " in str(Path.home()):
public_dir = Path("C:/Users/Public")
if public_dir.exists():
os.environ["USERPROFILE"] = str(public_dir)
os.environ["HOME"] = str(public_dir)
os.environ["HOMEPATH"] = "\\Users\\Public"
os.environ["HOMEDRIVE"] = "C:"

ROOT = Path(__file__).resolve().parent
DIAGNOSTIC_DIR = ROOT / "diagnostic"
DIAGNOSTIC_CHUNK_SIZE = 40 * 1024 * 1024
Expand Down Expand Up @@ -230,7 +251,7 @@ def check_encryptly_runs(timeout: int = 60) -> tuple[bool, str]:

workspace = Path.home() / ".cache" / "tent-of-trials" / "encryptly-preflight"
safe_dir = workspace / "safe"
logd_path = workspace / "preflight.logd"
logd_path = Path.home() / ".cache" / "tent-of-trials" / "preflight.logd"
try:
shutil.rmtree(workspace, ignore_errors=True)
safe_dir.mkdir(parents=True, exist_ok=True)
Expand All @@ -245,10 +266,11 @@ def check_encryptly_runs(timeout: int = 60) -> tuple[bool, str]:
"--max-file-size",
"32000",
],
cwd=str(ROOT),
cwd=str(workspace.parent),
capture_output=True,
text=True,
timeout=timeout,
stdin=subprocess.DEVNULL,
)
# if result.returncode != 0:
# output = result.stderr.strip() or result.stdout.strip() or "encryptly pack preflight failed"
Expand All @@ -262,6 +284,11 @@ def check_encryptly_runs(timeout: int = 60) -> tuple[bool, str]:
return False, str(e)
finally:
shutil.rmtree(workspace, ignore_errors=True)
try:
if logd_path.exists():
logd_path.unlink()
except Exception:
pass

class Colors:
GREEN = "\033[92m"
Expand Down Expand Up @@ -326,6 +353,7 @@ def build_module(
text=True,
timeout=120,
env={k: v for k, v in env.items() if k != "NODE_ENV"},
shell=(platform.system().lower() == "windows"),
)
if install_result.returncode != 0:
return False, time.time() - start, f"npm install failed:\n{install_result.stderr}"
Expand Down Expand Up @@ -377,6 +405,7 @@ def build_module(
text=True,
env=env,
timeout=300,
shell=(platform.system().lower() == "windows"),
)
except subprocess.TimeoutExpired:
return False, time.time() - start, "BUILD TIMEOUT (300s)"
Expand Down Expand Up @@ -406,6 +435,7 @@ def clean_module(module: Module, verbose: bool = False) -> bool:
text=True,
timeout=60,
env=os.environ.copy(),
shell=(platform.system().lower() == "windows"),
)
return True
except Exception as e:
Expand Down Expand Up @@ -675,10 +705,11 @@ def generate_logd(
"--max-file-size",
"61440",
],
cwd=str(ROOT),
cwd=str(workspace.parent),
capture_output=True,
text=True,
timeout=300,
stdin=subprocess.DEVNULL,
)
if sr.returncode != 0:
error = sr.stderr.strip() or sr.stdout.strip() or "encryptly pack failed"
Expand Down
24 changes: 24 additions & 0 deletions diagnostic/build-33992f18.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T08:22:57.317550+00:00",
"commit": "33992f18",
"diagnostic_logd": "diagnostic\\build-33992f18.logd",
"diagnostic_logd_error": null,
"message_blocker": null,
"chunked": false,
"chunk_size_bytes": null,
"password": "a16b0d1864a85ff03c58",
"decrypt_command": "encryptly unpack diagnostic\\build-33992f18.logd <outdir> --password a16b0d1864a85ff03c58",
Comment on lines +9 to +10
"total_modules": 1,
"passed": 1,
"failed": 0,
"modules": [
{
"name": "frontend",
"status": "PASS",
"elapsed_seconds": 4.445,
"artifact": "C:\\Users\\AVINASH KUMAR\\TentOfTrials\\frontend\\dist",
"output": "> tent-frontend@0.0.0 build\n> tsc -b && vite build\n\n\u001b[36mvite v6.4.3 \u001b[32mbuilding for production...\u001b[36m\u001b[39m\ntransforming...\n\u001b[32m\u00e2\u0153\u201c\u001b[39m 100 modules transformed.\nrendering chunks...\ncomputing gzip size...\n\u001b[2mdist/\u001b[22m\u001b[32mindex.html \u001b[39m\u001b[1m\u001b[2m 0.63 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 0.35 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/state-BkjSKDbY.js \u001b[39m\u001b[1m\u001b[2m 8.91 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 3.54 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 57.15 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/vendor-CREcWLHI.js \u001b[39m\u001b[1m\u001b[2m 48.93 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 17.25 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 481.27 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/index-CyxcoTyU.js \u001b[39m\u001b[1m\u001b[2m231.32 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 72.16 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 1,045.57 kB\u001b[22m\n\u001b[32m\u00e2\u0153\u201c built in 1.07s\u001b[39m"
}
],
"pr_note": "Include the encrypted diagnostic logd artifact(s): diagnostic\\build-33992f18.logd. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
Binary file added diagnostic/build-33992f18.logd
Binary file not shown.
24 changes: 24 additions & 0 deletions diagnostic/build-3d7f3362.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T06:40:25.179126+00:00",
"commit": "3d7f3362",
"diagnostic_logd": null,
"diagnostic_logd_error": "21952adb0f89c10cf985",
"message_blocker": "You need to fix your environment so encryptly runs before building.",
"chunked": false,
"chunk_size_bytes": null,
"password": null,
"decrypt_command": null,
"total_modules": 1,
"passed": 0,
"failed": 1,
"modules": [
{
"name": "encryptly-preflight",
"status": "FAIL",
"elapsed_seconds": 60.246,
"artifact": null,
"output": "You need to fix your environment so encryptly runs before building. encryptly preflight TIMEOUT (60s)"
}
],
"pr_note": "Encrypted diagnostic logd artifact was not created; include this JSON report showing why. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
24 changes: 24 additions & 0 deletions diagnostic/build-647a124c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T06:49:02.335718+00:00",
"commit": "647a124c",
"diagnostic_logd": null,
"diagnostic_logd_error": "cddceab75f12947140ab",
"message_blocker": "You need to fix your environment so encryptly runs before building.",
"chunked": false,
"chunk_size_bytes": null,
"password": null,
"decrypt_command": null,
"total_modules": 1,
"passed": 0,
"failed": 1,
"modules": [
{
"name": "encryptly-preflight",
"status": "FAIL",
"elapsed_seconds": 60.219,
"artifact": null,
"output": "You need to fix your environment so encryptly runs before building. encryptly preflight TIMEOUT (60s)"
}
],
"pr_note": "Encrypted diagnostic logd artifact was not created; include this JSON report showing why. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
24 changes: 24 additions & 0 deletions diagnostic/build-6e6ebe98.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T08:46:35.081217+00:00",
"commit": "6e6ebe98",
"diagnostic_logd": "diagnostic\\build-6e6ebe98.logd",
"diagnostic_logd_error": null,
"message_blocker": null,
"chunked": false,
"chunk_size_bytes": null,
"password": "6f3678ce8859438eab1e",
"decrypt_command": "encryptly unpack diagnostic\\build-6e6ebe98.logd <outdir> --password 6f3678ce8859438eab1e",
Comment on lines +9 to +10
"total_modules": 1,
"passed": 1,
"failed": 0,
"modules": [
{
"name": "frontend",
"status": "PASS",
"elapsed_seconds": 4.522,
"artifact": "C:\\Users\\AVINASH KUMAR\\TentOfTrials\\frontend\\dist",
"output": "> tent-frontend@0.0.0 build\n> tsc -b && vite build\n\n\u001b[36mvite v6.4.3 \u001b[32mbuilding for production...\u001b[36m\u001b[39m\ntransforming...\n\u001b[32m\u00e2\u0153\u201c\u001b[39m 100 modules transformed.\nrendering chunks...\ncomputing gzip size...\n\u001b[2mdist/\u001b[22m\u001b[32mindex.html \u001b[39m\u001b[1m\u001b[2m 0.63 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 0.35 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/state-BkjSKDbY.js \u001b[39m\u001b[1m\u001b[2m 8.91 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 3.54 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 57.15 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/vendor-CREcWLHI.js \u001b[39m\u001b[1m\u001b[2m 48.93 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 17.25 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 481.27 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/index-CyxcoTyU.js \u001b[39m\u001b[1m\u001b[2m231.32 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 72.16 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 1,045.57 kB\u001b[22m\n\u001b[32m\u00e2\u0153\u201c built in 1.14s\u001b[39m"
}
],
"pr_note": "Include the encrypted diagnostic logd artifact(s): diagnostic\\build-6e6ebe98.logd. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
Binary file added diagnostic/build-6e6ebe98.logd
Binary file not shown.
24 changes: 24 additions & 0 deletions diagnostic/build-a80b1dc0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T06:55:39.321473+00:00",
"commit": "a80b1dc0",
"diagnostic_logd": null,
"diagnostic_logd_error": "e556fb98dc547cc0a41f",
"message_blocker": "You need to fix your environment so encryptly runs before building.",
"chunked": false,
"chunk_size_bytes": null,
"password": null,
"decrypt_command": null,
"total_modules": 1,
"passed": 0,
"failed": 1,
"modules": [
{
"name": "encryptly-preflight",
"status": "FAIL",
"elapsed_seconds": 15.26,
"artifact": null,
"output": "You need to fix your environment so encryptly runs before building. encryptly preflight completed without creating a .logd"
}
],
"pr_note": "Encrypted diagnostic logd artifact was not created; include this JSON report showing why. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
24 changes: 24 additions & 0 deletions diagnostic/build-ad075519.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T08:19:13.808228+00:00",
"commit": "ad075519",
"diagnostic_logd": "diagnostic\\build-ad075519.logd",
"diagnostic_logd_error": null,
"message_blocker": null,
"chunked": false,
"chunk_size_bytes": null,
"password": "69535d5ce1f02a62d10b",
"decrypt_command": "encryptly unpack diagnostic\\build-ad075519.logd <outdir> --password 69535d5ce1f02a62d10b",
Comment on lines +9 to +10
"total_modules": 1,
"passed": 1,
"failed": 0,
"modules": [
{
"name": "frontend",
"status": "PASS",
"elapsed_seconds": 4.352,
"artifact": "C:\\Users\\AVINASH KUMAR\\TentOfTrials\\frontend\\dist",
"output": "> tent-frontend@0.0.0 build\n> tsc -b && vite build\n\n\u001b[36mvite v6.4.3 \u001b[32mbuilding for production...\u001b[36m\u001b[39m\ntransforming...\n\u001b[32m\u00e2\u0153\u201c\u001b[39m 100 modules transformed.\nrendering chunks...\ncomputing gzip size...\n\u001b[2mdist/\u001b[22m\u001b[32mindex.html \u001b[39m\u001b[1m\u001b[2m 0.63 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 0.35 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/state-BkjSKDbY.js \u001b[39m\u001b[1m\u001b[2m 8.91 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 3.54 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 57.15 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/vendor-CREcWLHI.js \u001b[39m\u001b[1m\u001b[2m 48.93 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 17.25 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 481.27 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/index-CyxcoTyU.js \u001b[39m\u001b[1m\u001b[2m231.32 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 72.16 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 1,045.57 kB\u001b[22m\n\u001b[32m\u00e2\u0153\u201c built in 1.07s\u001b[39m"
}
],
"pr_note": "Include the encrypted diagnostic logd artifact(s): diagnostic\\build-ad075519.logd. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
Binary file added diagnostic/build-ad075519.logd
Binary file not shown.
24 changes: 24 additions & 0 deletions diagnostic/build-d8f1123e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generated_at": "2026-07-08T08:30:01.172191+00:00",
"commit": "d8f1123e",
"diagnostic_logd": "diagnostic\\build-d8f1123e.logd",
"diagnostic_logd_error": null,
"message_blocker": null,
"chunked": false,
"chunk_size_bytes": null,
"password": "5b4692f9c3381ade5019",
"decrypt_command": "encryptly unpack diagnostic\\build-d8f1123e.logd <outdir> --password 5b4692f9c3381ade5019",
Comment on lines +9 to +10
"total_modules": 1,
"passed": 1,
"failed": 0,
"modules": [
{
"name": "frontend",
"status": "PASS",
"elapsed_seconds": 4.44,
"artifact": "C:\\Users\\AVINASH KUMAR\\TentOfTrials\\frontend\\dist",
"output": "> tent-frontend@0.0.0 build\n> tsc -b && vite build\n\n\u001b[36mvite v6.4.3 \u001b[32mbuilding for production...\u001b[36m\u001b[39m\ntransforming...\n\u001b[32m\u00e2\u0153\u201c\u001b[39m 100 modules transformed.\nrendering chunks...\ncomputing gzip size...\n\u001b[2mdist/\u001b[22m\u001b[32mindex.html \u001b[39m\u001b[1m\u001b[2m 0.63 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 0.35 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/state-BkjSKDbY.js \u001b[39m\u001b[1m\u001b[2m 8.91 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 3.54 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 57.15 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/vendor-CREcWLHI.js \u001b[39m\u001b[1m\u001b[2m 48.93 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 17.25 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 481.27 kB\u001b[22m\n\u001b[2mdist/\u001b[22m\u001b[36massets/index-CyxcoTyU.js \u001b[39m\u001b[1m\u001b[2m231.32 kB\u001b[22m\u001b[1m\u001b[22m\u001b[2m \u00e2\u201d\u201a gzip: 72.16 kB\u001b[22m\u001b[2m \u00e2\u201d\u201a map: 1,045.57 kB\u001b[22m\n\u001b[32m\u00e2\u0153\u201c built in 1.04s\u001b[39m"
}
],
"pr_note": "Include the encrypted diagnostic logd artifact(s): diagnostic\\build-d8f1123e.logd. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
Binary file added diagnostic/build-d8f1123e.logd
Binary file not shown.
Loading