team-ljyzipelo

공개

잠금 의존성 라이선스 원문 생성과 패키지 누락 차단을 추가함

작성자
호시노 히나타
작성 시각
커밋
5c9b48eff953e9c1d1136b7711e047f853d1d99d
부모
8bfa254
이 시점의 파일 보기

변경된 파일 11개

+407-14
수정experiments/rust-ui-memory-app/THIRD-PARTY-NOTICES.txt+6-11
@@ -1,11 +1,6 @@
1삭제: Zipelo 합성 메모리 UI 후보
2삭제: 자체 코드: MIT. LICENSE에 원문을 포함함.
3삭제: 직접 의존성: 고정 PR42의 zipelo-app-core-memory와 선택적 eframe 0.37.0임.
4삭제: eframe feature: accesskit, clipboard, glow, system_fonts, wayland, x11임.
5삭제: 기존 PR34 및 PR42 lock에 있는 package/version/checksum만 사용함.
6삭제: 플랫폼별 선택 feature, SPDX license, 캐시 archive checksum, 라이선스 파일의 상대 경로와 SHA256은 tests/rust-ui-memory-app/dependencies.json에 기록함.
7삭제: 원문 출처는 해당 checksum의 crates.io crate archive와 그 archive에서 풀린 registry source임.
8삭제: Linux headless/GUI 빌드만 수행함. Windows GNU/MSVC는 선택 그래프 분석이며 빌드/실행을 뜻하지 않음.
9삭제: 설치된 Noto CJK 폰트는 런타임 경로에서 읽으며 이 후보에 재배포하지 않음.
10삭제: 이 기록은 최종 설치기/배포용 전체 고지를 완료했다는 뜻이 아님.
11삭제: crate에 원문이 없는 GUI package의 고정 upstream 보충 원문은 기존 PR34에서 보존한 tests/rust-ui-memory-app/license-supplement.json을 사용함. 원래 URL과 원문을 그대로 보존하며 새로운 네트워크 조회를 하지 않음.
1추가: Zipelo 의존성 고지 생성 안내
2추가:
3추가: 최종 배포 고지는 packaging/licenses.py가 빌드할 때 생성하는 THIRD-PARTY-LICENSES.txt임.
4추가: 앱과 작업자의 Cargo.lock 전체 항목을 오프라인 cargo metadata와 대조함.
5추가: 로컬 registry의 원문과 잠금 체크섬을 확인하며 누락 시 패키지 생성을 중단함.
6추가: 이 안내 파일과 과거 시험용 보충 원문은 최종 배포 고지를 대신하지 않음.
추가packaging/licenses.py+139-0
@@ -0,0 +1,139 @@
1추가: """잠금 의존성의 로컬 원문을 모으고 누락 시 배포를 중단함."""
2추가:
3추가: import argparse
4추가: import hashlib
5추가: import json
6추가: from pathlib import Path
7추가: import subprocess
8추가: import tarfile
9추가: import tomllib
10추가:
11추가: ROOT = Path(__file__).resolve().parents[1]
12추가:
13추가:
14추가: def identity(package):
15추가: return package["name"], package["version"], package.get("source") or "workspace"
16추가:
17추가:
18추가: def metadata(manifest):
19추가: result = subprocess.run(
20추가: ["cargo", "+1.99.1", "metadata", "--format-version", "1", "--locked", "--offline",
21추가: "--all-features", "--manifest-path", str(manifest)],
22추가: check=True, capture_output=True, text=True,
23추가: )
24추가: return json.loads(result.stdout)["packages"]
25추가:
26추가:
27추가: def is_license(path):
28추가: path = Path(path)
29추가: name = path.name.upper()
30추가: return (
31추가: name.startswith(("LICENSE", "LICENCE", "COPYING", "COPYRIGHT", "NOTICE", "UNLICENSE", "OFL"))
32추가: or any(part.lower() in {"license", "licenses", "licence", "licences"} for part in path.parts[:-1])
33추가: ) and path.suffix.lower() not in {".rs", ".c", ".h", ".cpp", ".py", ".json"}
34추가:
35추가:
36추가: def registry_files(package, locked):
37추가: root = Path(package["manifest_path"]).parent.resolve()
38추가: archive = root.parents[2] / "cache" / root.parent.name / (root.name + ".crate")
39추가: if hashlib.sha256(archive.read_bytes()).hexdigest() != locked["checksum"]:
40추가: raise ValueError(f"crate 체크섬 불일치: {root.name}")
41추가: explicit = package.get("license_file")
42추가: if explicit:
43추가: explicit = Path(explicit)
44추가: if not explicit.is_absolute():
45추가: explicit = root / explicit
46추가: explicit = explicit.resolve().relative_to(root).as_posix()
47추가: records = []
48추가: with tarfile.open(archive, "r:gz") as source:
49추가: for member in sorted(source.getmembers(), key=lambda member: member.name):
50추가: name = Path(member.name)
51추가: if name.parts[0] != root.name or ".." in name.parts:
52추가: raise ValueError(f"crate 경로 오류: {root.name}")
53추가: relative = Path(*name.parts[1:])
54추가: if not (is_license(relative) or relative.as_posix() == explicit):
55추가: continue
56추가: if not member.isfile():
57추가: if member.isdir():
58추가: continue
59추가: raise ValueError(f"라이선스가 일반 파일이 아님: {member.name}")
60추가: local = root / relative
61추가: if local.is_symlink() or not local.resolve().is_relative_to(root):
62추가: raise ValueError(f"라이선스 경로 이탈: {relative}")
63추가: content = local.read_bytes()
64추가: if content != source.extractfile(member).read():
65추가: raise ValueError(f"라이선스 원문 변경: {root.name}/{relative}")
66추가: records.append({
67추가: "path": relative.as_posix(),
68추가: "sha256": hashlib.sha256(content).hexdigest(),
69추가: "text": content.decode("utf-8"),
70추가: })
71추가: return records
72추가:
73추가:
74추가: def inventory(manifests, project_root=ROOT):
75추가: locked = {}
76추가: packages = {}
77추가: for manifest in manifests:
78추가: manifest = Path(manifest).resolve(strict=True)
79추가: lock = tomllib.loads(manifest.with_name("Cargo.lock").read_text())
80추가: locked.update({identity(package): package for package in lock["package"]})
81추가: packages.update({identity(package): package for package in metadata(manifest)})
82추가: if set(locked) != set(packages):
83추가: raise ValueError(f"Cargo.lock/metadata 불일치: 누락 {sorted(set(locked) - set(packages))}, "
84추가: f"추가 {sorted(set(packages) - set(locked))}")
85추가: records = []
86추가: for key, package in sorted(packages.items()):
87추가: if package.get("source"):
88추가: if not package["source"].startswith("registry+"):
89추가: raise ValueError(f"지원하지 않는 원문 저장소: {key}")
90추가: files = registry_files(package, locked[key])
91추가: else:
92추가: root = Path(project_root).resolve()
93추가: if package["license"] != "MIT" or not Path(package["manifest_path"]).resolve().is_relative_to(root):
94추가: raise ValueError(f"프로젝트 라이선스 범위 확인 필요: {key}")
95추가: content = (root / "LICENSE").read_bytes()
96추가: files = [{"path": "project/LICENSE", "sha256": hashlib.sha256(content).hexdigest(),
97추가: "text": content.decode("utf-8")}]
98추가: records.append({"name": key[0], "version": key[1], "source": key[2],
99추가: "license": package["license"], "files": files})
100추가: return records
101추가:
102추가:
103추가: def render(records):
104추가: missing = [f'{record["name"]}@{record["version"]}' for record in records if not record["files"]]
105추가: if missing:
106추가: raise ValueError(f"라이선스 원문 누락 {len(missing)}개: " + ", ".join(missing))
107추가: lines = ["Zipelo third-party licenses", "Cargo.lock 전체 의존성의 로컬 원문 고지", ""]
108추가: for record in records:
109추가: lines.extend(["=" * 72, f'Crate: {record["name"]} {record["version"]}',
110추가: f'Source: {record["source"]}', f'License: {record["license"]}', ""])
111추가: for file in record["files"]:
112추가: lines.extend([f'File: {file["path"]}', f'SHA-256: {file["sha256"]}', "", file["text"], ""])
113추가: return "\n".join(lines)
114추가:
115추가:
116추가: def generate(manifests, output, audit=None):
117추가: records = inventory(manifests)
118추가: if audit:
119추가: Path(audit).write_text(json.dumps(records, ensure_ascii=False, indent=4) + "\n", encoding="utf-8")
120추가: text = render(records)
121추가: Path(output).write_text(text, encoding="utf-8")
122추가: return records
123추가:
124추가:
125추가: def main():
126추가: parser = argparse.ArgumentParser(description=__doc__)
127추가: parser.add_argument("--manifest", type=Path, action="append", required=True)
128추가: parser.add_argument("--output", type=Path, required=True)
129추가: parser.add_argument("--audit", type=Path)
130추가: args = parser.parse_args()
131추가: try:
132추가: records = generate(args.manifest, args.output, args.audit)
133추가: except (ValueError, OSError, subprocess.CalledProcessError) as error:
134추가: parser.exit(1, str(error) + "\n")
135추가: print(f"라이선스 {len(records)}개, 누락 0개")
136추가:
137추가:
138추가: if __name__ == "__main__":
139추가: main()
수정packaging/ubuntu/rust/README.md+5-0
@@ -14,3 +14,8 @@ Rust 1.99.1, dpkg-deb와 desktop-file-validate가 필요합니다. 출력은 새
1414sudo로 처음 설치하면 postinst가 SUDO_USER의 ZIP, 7z, TAR.GZ, GZ, TAR 기본 앱을 xdg-mime으로 적용합니다. 최초 설치에서 기존 기본 앱 선택을 바꿉니다. 업그레이드와 재설정에서는 사용자의 기본 앱 선택을 유지합니다. 다른 패키지 관리자로 설치해 SUDO_USER가 없으면 사용자 설정을 추측하지 않고 연결 후보만 등록합니다. 이 경우 사용자 계정에서 xdg-mime default zipelo.desktop application/zip 등을 실행해야 합니다. 제거는 사용자 MIME 설정을 지우지 않으며 다른 앱을 기본 앱으로 다시 선택할 수 있습니다.
1515
1616이 패키지의 검사 범위는 Ubuntu 26.04입니다. 다른 Ubuntu 버전과 Windows 실기는 별도 확인이 필요합니다.
17추가:
18추가:
19추가: 앱과 작업자의 Cargo.lock 전체 항목을 cargo metadata --locked --offline --all-features와 대조한 뒤 packaging/licenses.py로 THIRD-PARTY-LICENSES.txt를 생성합니다. 로컬 registry 원문과 캐시 crate의 잠금 체크섬을 확인하며 LICENSE, COPYING, NOTICE 등의 원문을 함께 보존합니다. 원문이 없거나 변조됐거나 metadata 대조에서 누락되면 패키지 생성을 중단합니다.
20추가:
21추가: 처음 준비할 때 각 manifest에 cargo +1.99.1 fetch --locked --manifest-path 명령으로 모든 플랫폼의 의존성을 캐시에 받아 두어야 합니다. 고지 생성 중에는 네트워크를 사용하지 않습니다. Windows에는 설치 폴더에, Ubuntu에는 /usr/share/doc/zipelo/THIRD-PARTY-LICENSES.txt에 포함합니다. 파일 동봉 자체가 별도 라이선스 준수 검토를 대신하지는 않습니다.
수정packaging/ubuntu/rust/build.py+6-2
@@ -22,6 +22,12 @@ def build(args):
2222 lib = stage / "usr/lib/zipelo"
2323 lib.mkdir(parents=True)
2424 records = {}
25추가: docs = stage / "usr/share/doc/zipelo"
26추가: docs.mkdir(parents=True)
27추가: WINDOWS.LICENSES.generate(
28추가: [ROOT / "experiments/rust-ui-memory-app/Cargo.toml", ROOT / "experiments/rust-archive-worker/Cargo.toml"],
29추가: docs / "THIRD-PARTY-LICENSES.txt",
30추가: )
2531 for name, manifest, binary, features in (
2632 ("Zipelo", ROOT / "experiments/rust-ui-memory-app/Cargo.toml", "zipelo-ui-memory-app", ("ui",)),
2733 ("zipelo-archive-worker", ROOT / "experiments/rust-archive-worker/Cargo.toml", "zipelo-archive-worker", ()),
@@ -38,8 +44,6 @@ def build(args):
3844 desktop.mkdir(parents=True)
3945 shutil.copyfile(Path(__file__).with_name("zipelo.desktop"), desktop / "zipelo.desktop")
4046 subprocess.run(["desktop-file-validate", str(desktop / "zipelo.desktop")], check=True)
41삭제: docs = stage / "usr/share/doc/zipelo"
42삭제: docs.mkdir(parents=True)
4347 shutil.copyfile(ROOT / "LICENSE", docs / "copyright")
4448 control = stage / "DEBIAN"
4549 control.mkdir()
수정packaging/windows/rust/README.md+5-0
@@ -45,3 +45,8 @@ Windows 실행 검증 전에는 README 다운로드 버튼이나 release에 배
4545Capabilities/RegisteredApplications 구조를 사용하며,
4646[Windows 기본 앱 설정 열기](https://learn.microsoft.com/en-us/windows/apps/develop/launch/launch-default-apps-settings)의
4747ms-settings URI를 사용합니다.
48추가:
49추가:
50추가: 앱과 작업자의 Cargo.lock 전체 항목을 cargo metadata --locked --offline --all-features와 대조한 뒤 packaging/licenses.py로 THIRD-PARTY-LICENSES.txt를 생성합니다. 로컬 registry 원문과 캐시 crate의 잠금 체크섬을 확인하며 LICENSE, COPYING, NOTICE 등의 원문을 함께 보존합니다. 원문이 없거나 변조됐거나 metadata 대조에서 누락되면 패키지 생성을 중단합니다.
51추가:
52추가: 처음 준비할 때 각 manifest에 cargo +1.99.1 fetch --locked --manifest-path 명령으로 모든 플랫폼의 의존성을 캐시에 받아 두어야 합니다. 고지 생성 중에는 네트워크를 사용하지 않습니다. Windows에는 설치 폴더에, Ubuntu에는 /usr/share/doc/zipelo/THIRD-PARTY-LICENSES.txt에 포함합니다. 파일 동봉 자체가 별도 라이선스 준수 검토를 대신하지는 않습니다.
수정packaging/windows/rust/build.py+5-0
@@ -2,6 +2,7 @@
22
33import argparse
44import hashlib
5추가: import importlib.util
56import json
67import os
78from pathlib import Path
@@ -11,6 +12,9 @@ import subprocess
1112
1213ROOT = Path(__file__).resolve().parents[3]
1314TARGET = "x86_64-pc-windows-gnu"
15추가: SPEC = importlib.util.spec_from_file_location("licenses", ROOT / "packaging/licenses.py")
16추가: LICENSES = importlib.util.module_from_spec(SPEC)
17추가: SPEC.loader.exec_module(LICENSES)
1418
1519
1620def pe_machine(path):
@@ -72,6 +76,7 @@ def build(args):
7276 records = {}
7377 payload = output / "payload"
7478 payload.mkdir()
79추가: LICENSES.generate([args.app_manifest, args.worker_manifest], payload / "THIRD-PARTY-LICENSES.txt")
7580 for name, manifest, binary, features in (
7681 ("Zipelo.exe", args.app_manifest, "zipelo-ui-memory-app", ("ui",)),
7782 ("zipelo-archive-worker.exe", args.worker_manifest, "zipelo-archive-worker", ()),
수정packaging/windows/rust/installer.nsi+3-0
@@ -99,6 +99,7 @@ Section "Zipelo"
9999 File "payload\Zipelo.exe"
100100 File "payload\zipelo-archive-worker.exe"
101101 File "payload\LICENSE"
102추가: File "payload\THIRD-PARTY-LICENSES.txt"
102103 File "payload\BUILD-INFO.json"
103104 IfErrors failed
104105 WriteUninstaller "$INSTDIR\Uninstall.exe"
@@ -141,6 +142,7 @@ Function Rollback
141142 Delete "$INSTDIR\Zipelo.exe"
142143 Delete "$INSTDIR\zipelo-archive-worker.exe"
143144 Delete "$INSTDIR\LICENSE"
145추가: Delete "$INSTDIR\THIRD-PARTY-LICENSES.txt"
144146 Delete "$INSTDIR\BUILD-INFO.json"
145147 Delete "$INSTDIR\install.ini"
146148 Delete "$INSTDIR\Uninstall.exe"
@@ -225,6 +227,7 @@ Section "Uninstall"
225227 Delete "$INSTDIR\zipelo-archive-worker.exe"
226228 IfErrors uninstall_failed
227229 Delete "$INSTDIR\LICENSE"
230추가: Delete "$INSTDIR\THIRD-PARTY-LICENSES.txt"
228231 Delete "$INSTDIR\BUILD-INFO.json"
229232 Delete "$SMPROGRAMS\Zipelo 개발판.lnk"
230233 IfErrors uninstall_failed
수정tests/ci/test_windows_installer.py+1-1
@@ -57,7 +57,7 @@ class InstallerInputTests(unittest.TestCase):
5757 def test_nsis_compiles_payloads_and_finish_callbacks(self):
5858 payload = self.root / "payload"
5959 payload.mkdir()
60삭제: for name in ("Zipelo.exe", "zipelo-archive-worker.exe", "LICENSE", "BUILD-INFO.json"):
60추가: for name in ("Zipelo.exe", "zipelo-archive-worker.exe", "LICENSE", "BUILD-INFO.json", "THIRD-PARTY-LICENSES.txt"):
6161 (payload / name).write_bytes(b"compile-only test fixture")
6262 shutil.copyfile(ROOT / "packaging/windows/rust/installer.nsi", self.root / "installer.nsi")
6363 completed = subprocess.run(["makensis", "-WX", "installer.nsi"], cwd=self.root,
수정tests/release-packages/README.md+10-0
@@ -13,3 +13,13 @@ Ubuntu 실기 스모크는 이 패키지를 sudo로 설치하고 ZIP, 7z, TAR.GZ
1313sudo 비대화형 권한, Xvfb, xdotool과 ImageMagick import가 필요합니다. 이 검사는 실제 시스템 패키지를 설치하고 사용자 기본 앱을 임시로 바꾸므로 실행 전에 해당 작업의 승인이 필요합니다. 출력은 runs/에 남고 Git에는 포함하지 않습니다.
1414
1515Windows 설치와 설정 화면, 제거의 실기 검증은 이 Linux 시험에 포함되지 않습니다. release 게시와 다운로드 버튼 갱신도 수행하지 않습니다.
16추가:
17추가:
18추가: ## 라이선스 대조
19추가:
20추가: ```sh
21추가: python3 -m unittest discover -s tests/release-packages -p "test_*.py"
22추가: python3 packaging/licenses.py --manifest experiments/rust-ui-memory-app/Cargo.toml --manifest experiments/rust-archive-worker/Cargo.toml --output tests/release-packages/runs/THIRD-PARTY-LICENSES.txt --audit tests/release-packages/runs/license-inventory.json
23추가: ```
24추가:
25추가: 고지의 crate 목록은 두 Cargo.lock과 metadata의 합집합을 기준으로 합니다. 플랫폼이나 활성 기능을 기준으로 항목을 줄이지 않습니다. 원문 파일이 없는 crate는 라이선스 식만으로 대체하지 않으며 최종 파일을 생성하지 않습니다. audit JSON은 누락 원인 확인용이며 배포 고지가 아닙니다. 대조 시험은 원문 보존, 변경된 캐시 거부, metadata 누락과 두 패키지의 조기 중단을 검증합니다.
추가tests/release-packages/test_licenses.py+130-0
@@ -0,0 +1,130 @@
1추가: """원문 무결성과 고지 누락 시 패키지 생성 차단을 검증함."""
2추가:
3추가: import hashlib
4추가: import importlib.util
5추가: import io
6추가: import json
7추가: from pathlib import Path
8추가: import subprocess
9추가: import tarfile
10추가: import tempfile
11추가: import unittest
12추가: from types import SimpleNamespace
13추가: from unittest.mock import patch
14추가:
15추가: ROOT = Path(__file__).resolve().parents[2]
16추가:
17추가:
18추가: def load(name, path):
19추가: spec = importlib.util.spec_from_file_location(name, ROOT / path)
20추가: module = importlib.util.module_from_spec(spec)
21추가: spec.loader.exec_module(module)
22추가: return module
23추가:
24추가:
25추가: LICENSES = load("license_tests", "packaging/licenses.py")
26추가: WINDOWS = load("windows_license_tests", "packaging/windows/rust/build.py")
27추가: UBUNTU = load("ubuntu_license_tests", "packaging/ubuntu/rust/build.py")
28추가:
29추가:
30추가: class LicenseTests(unittest.TestCase):
31추가: def setUp(self):
32추가: runs = ROOT / "tests/release-packages/runs"
33추가: runs.mkdir(parents=True, exist_ok=True)
34추가: temporary = tempfile.TemporaryDirectory(dir=runs)
35추가: self.addCleanup(temporary.cleanup)
36추가: self.root = Path(temporary.name)
37추가: self.manifest = self.root / "Cargo.toml"
38추가: self.manifest.write_text("")
39추가: (self.root / "LICENSE").write_text("Project fixture license\n")
40추가: self.registry = self.root / "registry/src/index/sample-1.0.0"
41추가: self.registry.mkdir(parents=True)
42추가: self.package = {
43추가: "name": "sample", "version": "1.0.0", "source": "registry+https://example.invalid/index",
44추가: "license": "MIT", "license_file": None, "manifest_path": str(self.registry / "Cargo.toml"),
45추가: }
46추가: self.archive = self.root / "registry/cache/index/sample-1.0.0.crate"
47추가: self.archive.parent.mkdir(parents=True)
48추가:
49추가: def fixture(self, files):
50추가: with tarfile.open(self.archive, "w:gz") as archive:
51추가: for relative, content in files.items():
52추가: destination = self.registry / relative
53추가: destination.parent.mkdir(parents=True, exist_ok=True)
54추가: destination.write_bytes(content)
55추가: member = tarfile.TarInfo("sample-1.0.0/" + relative)
56추가: member.size = len(content)
57추가: archive.addfile(member, io.BytesIO(content))
58추가: checksum = hashlib.sha256(self.archive.read_bytes()).hexdigest()
59추가: self.manifest.with_name("Cargo.lock").write_text(
60추가: 'version = 4\n[[package]]\nname = "sample"\nversion = "1.0.0"\n'
61추가: 'source = "registry+https://example.invalid/index"\n' + f'checksum = "{checksum}"\n'
62추가: )
63추가: return {"checksum": checksum}
64추가:
65추가: def test_inventory_matches_metadata_and_preserves_all_texts(self):
66추가: originals = {"LICENSE-MIT": b"Fixture MIT text\r\n", "data/NOTICE": b"Fixture attribution\n"}
67추가: self.fixture(originals)
68추가: with patch.object(LICENSES, "metadata", return_value=[self.package]):
69추가: records = LICENSES.inventory([self.manifest], self.root)
70추가: text = LICENSES.render(records)
71추가: self.assertEqual([(r["name"], r["version"]) for r in records], [("sample", "1.0.0")])
72추가: self.assertEqual(text.count("Crate: sample 1.0.0\n"), 1)
73추가: for content in originals.values():
74추가: self.assertIn(content.decode(), text)
75추가: self.assertIn(hashlib.sha256(content).hexdigest(), text)
76추가:
77추가: def test_missing_license_prevents_output(self):
78추가: self.fixture({"README.md": b"No license text in fixture"})
79추가: output = self.root / "THIRD-PARTY-LICENSES.txt"
80추가: with patch.object(LICENSES, "metadata", return_value=[self.package]):
81추가: with self.assertRaisesRegex(ValueError, "원문 누락 1개"):
82추가: LICENSES.generate([self.manifest], output)
83추가: self.assertFalse(output.exists())
84추가:
85추가: def test_metadata_omission_is_not_silently_ignored(self):
86추가: self.fixture({"LICENSE": b"Fixture license"})
87추가: with patch.object(LICENSES, "metadata", return_value=[]):
88추가: with self.assertRaisesRegex(ValueError, "Cargo.lock/metadata 불일치"):
89추가: LICENSES.inventory([self.manifest], self.root)
90추가:
91추가: def test_modified_registry_license_is_rejected(self):
92추가: locked = self.fixture({"LICENSE": b"Fixture license"})
93추가: (self.registry / "LICENSE").write_bytes(b"Modified license")
94추가: with self.assertRaisesRegex(ValueError, "원문 변경"):
95추가: LICENSES.registry_files(self.package, locked)
96추가:
97추가: def test_wrong_archive_checksum_is_rejected(self):
98추가: self.fixture({"LICENSE": b"Fixture license"})
99추가: with self.assertRaisesRegex(ValueError, "체크섬 불일치"):
100추가: LICENSES.registry_files(self.package, {"checksum": "0" * 64})
101추가:
102추가: def test_license_file_cannot_escape_package(self):
103추가: locked = self.fixture({"LICENSE": b"Fixture license"})
104추가: self.package["license_file"] = str(self.root / "LICENSE")
105추가: with self.assertRaises(ValueError):
106추가: LICENSES.registry_files(self.package, locked)
107추가:
108추가: def test_metadata_command_is_locked_and_offline(self):
109추가: with patch.object(LICENSES.subprocess, "run", return_value=subprocess.CompletedProcess([], 0, '{"packages": []}')) as run:
110추가: self.assertEqual(LICENSES.metadata(self.manifest), [])
111추가: command = run.call_args.args[0]
112추가: self.assertIn("--locked", command)
113추가: self.assertIn("--offline", command)
114추가: self.assertIn("--all-features", command)
115추가:
116추가: def test_both_packagers_stop_before_build_on_missing_licenses(self):
117추가: for builder, binaries in [(WINDOWS, WINDOWS), (UBUNTU, UBUNTU.WINDOWS)]:
118추가: with self.subTest(builder=builder.__name__):
119추가: output = self.root / builder.__name__
120추가: args = SimpleNamespace(output=output, target_dir=self.root / "target", profile="release",
121추가: app_manifest=self.manifest, worker_manifest=self.manifest)
122추가: with patch.object(binaries.LICENSES, "generate", side_effect=ValueError("원문 누락")):
123추가: with patch.object(binaries, "build_binary") as build_binary:
124추가: with self.assertRaisesRegex(ValueError, "원문 누락"):
125추가: builder.build(args)
126추가: build_binary.assert_not_called()
127추가:
128추가:
129추가: if __name__ == "__main__":
130추가: unittest.main()
수정tests/release-packages/validation.json+97-0
@@ -99,5 +99,102 @@
9999 "tests/release-packages/runs/lifecycle-regression.log",
100100 "tests/release-packages/runs/local-lifecycle.log"
101101 ]
102추가: },
103추가: "third_party_licenses": {
104추가: "status": "blocked-missing-registry-originals",
105추가: "base_remote_main": "8bfa25456b936346b4f1808233afb4551e769718",
106추가: "tested_source_local_commit": "6b601591663f937a642d134e248b76e6a8dc20cc",
107추가: "tested_code_tree": "d71bfec8a53025376405fce2ee36de6012e428fa",
108추가: "metadata_locked_crates": 403,
109추가: "registry_crates": 397,
110추가: "workspace_crates": 6,
111추가: "metadata_lock_mismatches": 0,
112추가: "crates_with_original_files": 345,
113추가: "missing_originals": [
114추가: "[email protected]",
115추가: "[email protected]",
116추가: "[email protected]",
117추가: "[email protected]",
118추가: "[email protected]",
119추가: "[email protected]",
120추가: "[email protected]",
121추가: "[email protected]",
122추가: "[email protected]",
123추가: "[email protected]",
124추가: "[email protected]",
125추가: "[email protected]",
126추가: "[email protected]",
127추가: "[email protected]",
128추가: "[email protected]",
129추가: "[email protected]",
130추가: "[email protected]",
131추가: "[email protected]",
132추가: "[email protected]",
133추가: "[email protected]",
134추가: "[email protected]",
135추가: "[email protected]",
136추가: "[email protected]",
137추가: "[email protected]",
138추가: "[email protected]",
139추가: "[email protected]",
140추가: "[email protected]",
141추가: "[email protected]",
142추가: "[email protected]",
143추가: "[email protected]+11769913",
144추가: "[email protected]",
145추가: "[email protected]",
146추가: "[email protected]",
147추가: "[email protected]",
148추가: "[email protected]",
149추가: "[email protected]",
150추가: "[email protected]",
151추가: "[email protected]",
152추가: "[email protected]",
153추가: "[email protected]",
154추가: "[email protected]",
155추가: "[email protected]",
156추가: "[email protected]",
157추가: "[email protected]",
158추가: "[email protected]",
159추가: "[email protected]",
160추가: "[email protected]",
161추가: "[email protected]",
162추가: "[email protected]",
163추가: "[email protected]",
164추가: "[email protected]",
165추가: "[email protected]",
166추가: "[email protected]",
167추가: "[email protected]",
168추가: "[email protected]",
169추가: "[email protected]",
170추가: "[email protected]",
171추가: "[email protected]"
172추가: ],
173추가: "unit_command": "python3 -m unittest discover -s tests/release-packages -p \"test_*.py\" -v",
174추가: "package_unit_tests_passed": 15,
175추가: "new_license_tests_passed": 8,
176추가: "local_command": "python3 tests/ci/run_rust.py local",
177추가: "local_exit_code": 0,
178추가: "rust_tests_passed": 953,
179추가: "runner_tests_passed": 34,
180추가: "linux_build_targets_passed": 21,
181추가: "linux_test_targets_passed": 21,
182추가: "windows_cross_targets_passed": 21,
183추가: "windows_builder_exit_code": 1,
184추가: "ubuntu_builder_exit_code": 1,
185추가: "builder_failure_reason": "라이선스 원문 누락 58개",
186추가: "final_packages_created": false,
187추가: "package_contents_verified": false,
188추가: "registry_preparation": "누락된 다른 플랫폼용 crate는 cargo fetch --locked로 캐시에 준비함. 생성은 cargo metadata --offline과 로컬 원문만 사용함.",
189추가: "required_decision": "로컬 registry에 원문이 없는 crate에 대해 고정 upstream 보충 원문을 저장소에 포함할 수 있는지 확인 필요",
190추가: "source_policy": "기존 시험용 보충 JSON이나 일반 라이선스 템플릿을 원문 대신 사용하지 않음",
191추가: "local_logs": [
192추가: "tests/release-packages/runs/licenses/unit.log",
193추가: "tests/release-packages/runs/licenses/local-fixed.log",
194추가: "tests/release-packages/runs/licenses/generator.log",
195추가: "tests/release-packages/runs/licenses/blocked-builds.json"
196추가: ],
197추가: "initial_local_failure": "NSIS 필수 고지 파일 추가로 기존 시험 payload가 실패하여 시험 입력에 해당 파일을 추가함. 이후 전체 local 통과.",
198추가: "evidence_note": "코드 검증 뒤 이 검증 JSON만 갱신함"
102199 }
103200}