Fix root docs abxpkg lib ownership

This commit is contained in:
Nick Sweeting 2026-07-25 16:04:59 -07:00
parent 64d8e4ea4e
commit d5050ffc08
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View File

@ -145,7 +145,6 @@ jobs:
- name: Run the root documentation lane
if: ${{ matrix.environment == 'root' }}
run: |
"$SUDO_BINARY" chown -R archivebox:archivebox "$ABXPKG_LIB_DIR"
"$SUDO_BINARY" \
--preserve-env=PATH,ABXPKG_LIB_DIR,BASH_BINARY,PYTHON_BINARY,SUDO_BINARY,UV_BINARY \
"$UV_BINARY" run --no-sync python docs/test_codeblocks_manifest.py run-environment root

View File

@ -10,18 +10,18 @@ from __future__ import annotations
import argparse
import ast
import configparser
from dataclasses import dataclass
from hashlib import sha256
from html import unescape
import json
import os
from pathlib import Path
import re
import sqlite3
import subprocess
import sys
import tempfile
import tomllib
from dataclasses import dataclass
from hashlib import sha256
from html import unescape
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
MANIFEST = ROOT / "docs" / "codeblocks.toml"
@ -403,8 +403,6 @@ def run_snippets(snippet_ids: tuple[str, ...]) -> None:
},
)
system_lib_dir = Path(snippet_env["ABXPKG_LIB_DIR"])
system_lib_dir.mkdir(parents=True, exist_ok=True)
system_lib_dir.chmod(0o777)
if record["environment"] == "root":
snippet_env["PATH"] = os.pathsep.join(
[
@ -419,6 +417,8 @@ def run_snippets(snippet_ids: tuple[str, ...]) -> None:
],
)
else:
system_lib_dir.mkdir(parents=True, exist_ok=True)
system_lib_dir.chmod(0o777)
excluded_path_dirs = {Path(sys.executable).parent.resolve()}
if env.get("ABXPKG_LIB_DIR"):
excluded_path_dirs.add((Path(env["ABXPKG_LIB_DIR"]) / "env" / "bin").resolve())