Skip to content

fix(infra): Windows Kotlin 빌드 실패 수정 #46#47

Open
kusuri12-09 wants to merge 2 commits into
developfrom
bug/46-fail-to-build-kotlin
Open

fix(infra): Windows Kotlin 빌드 실패 수정 #46#47
kusuri12-09 wants to merge 2 commits into
developfrom
bug/46-fail-to-build-kotlin

Conversation

@kusuri12-09

@kusuri12-09 kusuri12-09 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Windows 환경에서 bazel build //systems/identity/...가 실패하던 Kotlin/Bazel 설정을 수정했습니다.
  • identity adapter/application 모듈이 필요한 Spring 의존성을 직접 참조하도록 보강했습니다.
  • configuration application 모듈의 @Transactional 컴파일 의존성 누락을 수정했습니다.
  • grpc-java를 업데이트해 configuration gRPC adapter 빌드 중 발생하던 Windows C++ plugin 컴파일 오류를 해결했습니다.
  • 최종적으로 bazel build //... 전체 빌드가 통과하는 것을 확인했습니다.

Related Issue

Root Cause

  • .bazelrcbuild --package_path=%workspace%: 설정에 trailing separator가 있어 recursive target expansion 중 동일 패키지가 중복 수집됐습니다.
  • rules_kotlin@2.1.0은 Windows 환경에서 Kotlin stdlib classpath를 runfile 경로 하나처럼 처리해 Rlocation failed 오류를 발생시켰습니다.
  • rules_kotlin@2.4.0 적용 후 기존 Maven 기반 kotlin-allopen-compiler-plugin:2.1.0이 Kotlin compiler와 호환되지 않았습니다.
  • configuration-applicationorg.springframework.transaction.annotation.Transactional을 사용하지만 spring-tx를 직접 의존하지 않았습니다.
  • grpc-java@1.70.0은 현재 resolved protobuf/abseil 조합에서 Windows C++ plugin 컴파일 오류가 발생했습니다.

Fix Description

  • .bazelrc--package_path 값을 %workspace%로 정리했습니다.
  • rules_kotlin2.4.0으로 업데이트하고 MODULE.bazel.lock을 갱신했습니다.
  • spring_allopen compiler plugin dependency를 @rules_kotlin//kotlin/compiler:allopen-compiler-plugin으로 변경했습니다.
  • identity adapter-in/application 모듈에 필요한 Spring dependency를 추가했습니다.
  • configuration-application@maven//:org_springframework_spring_tx를 추가했습니다.
  • grpc-java1.82.0으로 업데이트하고 lock 파일을 갱신했습니다.

Testing

  • Reproduced before fix
  • Verified after fix
  • Test details:
    • bazel build //systems/admin/... 성공
    • bazel build //systems/application/... 성공
    • bazel build //systems/configuration/... 성공
    • bazel build //systems/gateway/... 성공
    • bazel build //systems/identity/... 성공
    • bazel build //systems/notification/... 성공
    • bazel build //systems/observability/... 성공
    • bazel build //... 성공

Risk & Impact

  • Risk level: Medium
  • Affected areas:
    • Bazel module resolution
    • Kotlin compile toolchain
    • Spring all-open compiler plugin
    • configuration gRPC/protobuf code generation
    • identity module compile dependencies
  • rules_kotlingrpc-java 버전이 변경되므로 CI 환경에서도 전체 빌드 확인이 필요합니다.

Checklist

  • No new regressions introduced
  • Edge cases considered
  • Logs / error handling updated if needed

Notes

  • contracts:configuration_java_proto deprecation warning과 Kotlin language version 2.1 deprecation warning은 남아 있지만 빌드는 통과합니다.
  • 현재 PR 본문은 커밋된 identity/infra 변경과 미커밋된 전체 패키지 빌드 보강 변경을 모두 포함합니다.

@kusuri12-09 kusuri12-09 linked an issue Jul 9, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0e880126-5a6c-424f-9aab-bcf3c7e466fd

📥 Commits

Reviewing files that changed from the base of the PR and between 0cd4a43 and 62a03f8.

⛔ Files ignored due to path filters (2)
  • .bazelrc is excluded by none and included by none
  • MODULE.bazel.lock is excluded by !**/*.lock, !**/*.lock and included by none
📒 Files selected for processing (5)
  • MODULE.bazel
  • kotlin.bzl
  • systems/configuration/configuration-application/deps.bzl
  • systems/identity/identity-adapter-in/deps.bzl
  • systems/identity/identity-application/deps.bzl
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (2)
**/{BUILD.bazel,*.bzl}

📄 CodeRabbit inference engine (Custom checks)

In BUILD.bazel and .bzl files, require buildifier-compatible formatting and stable target naming

Files:

  • systems/identity/identity-adapter-in/deps.bzl
  • systems/identity/identity-application/deps.bzl
  • kotlin.bzl
  • systems/configuration/configuration-application/deps.bzl
**/*.bzl

⚙️ CodeRabbit configuration file

**/*.bzl: Apply Bazel Starlark (.bzl) style guidance.

Readability and docs:

  • Keep file/module docstrings and docstrings for public functions/macros.
  • Use descriptive parameter names and document attribute intent.

API design:

  • Macros should take a name argument and derive generated target names from it.
  • Prefer keyword arguments when calling macros for clarity and stability.
  • Keep macro side effects predictable and visible.

Encapsulation:

  • Use private visibility for helper targets created by macros unless explicitly public.
  • Avoid exposing internal implementation targets unintentionally.

Tooling:

  • Enforce buildifier formatting and lint compliance.

Files:

  • systems/identity/identity-adapter-in/deps.bzl
  • systems/identity/identity-application/deps.bzl
  • kotlin.bzl
  • systems/configuration/configuration-application/deps.bzl
🔇 Additional comments (5)
systems/configuration/configuration-application/deps.bzl (1)

3-3: LGTM! spring_tx 의존성 추가는 Spring Boot 애플리케이션 모듈의 컴파일 의존성으로 적절합니다.

systems/identity/identity-adapter-in/deps.bzl (1)

1-4: LGTM! spring_boot_starter_webidentity-application:main 의존성 추가는 인바운드 어댑터 모듈에 적절합니다. identity-application/deps.bzladapter-in에 의존하지 않으므로 순환 의존성 위험은 없습니다.

systems/identity/identity-application/deps.bzl (1)

1-3: LGTM! spring_boot_starter 의존성 추가는 애플리케이션 모듈의 기본 컴파일 의존성으로 적절합니다.

kotlin.bzl (1)

14-14: 🎯 Functional Correctness

경로는 그대로 사용해도 됩니다. @rules_kotlin//kotlin/compiler:allopen-compiler-pluginrules_kotlin의 표준 kt_compiler_plugin 사용 예시와 일치하므로, 이 변경에 추가 수정은 필요 없습니다.

			> Likely an incorrect or invalid review comment.
MODULE.bazel (1)

11-11: 🔒 Security & Privacy

grpc-java 1.82.0은 유지 가능
grpc-java 1.82.0은 BCR에 등록돼 있고, 이 저장소의 Bazel 8.5.1과도 맞는다. 현재 사용 중인 @grpc-java//:java_grpc_library.bzl에도 별도 호환성 문제를 지적할 근거가 없다.

			> Likely an incorrect or invalid review comment.

📝 Walkthrough

Windows 환경에서 bazel build //systems/identity/... 및 전체 bazel build //...가 통과하도록 해 빌드 중단을 해소했습니다.

  • 아키텍처 변경

    • MODULE.bazel에서 grpc-java1.70.0에서 1.82.0으로 업그레이드했습니다.
    • kotlin.bzl의 Spring all-open 컴파일러 플러그인 참조를 @maven 아티팩트에서 @rules_kotlin//kotlin/compiler:allopen-compiler-plugin 타깃으로 전환했습니다.
    • systems/configuration/configuration-application/deps.bzlorg_springframework_spring_tx 의존성을 추가했습니다.
    • systems/identity/identity-application/deps.bzl에 Spring Boot starter를 KOTLIN_DEPS에 추가했습니다.
    • systems/identity/identity-adapter-in/deps.bzl에서 KOTLIN_DEPS를 비어 있던 상태에서 spring-boot-starteridentity-application 의존을 포함하도록 정리했습니다.
  • 위험 영역

    • grpc-java 업그레이드로 인한 네이티브/플러그인 컴파일 경로 변경 가능성
    • rules_kotlin 런타임(runfiles/classpath) 처리 변경에 따른 Windows 전용 동작 차이
    • 추가된 Spring 의존성으로 인한 컴파일 범위 및 전이 의존성 확대
  • 마이그레이션/호환성 고려사항

    • Kotlin all-open 플러그인과 컴파일러 버전의 호환성을 rules_kotlin 제공 타깃 기준으로 맞췄습니다.
    • Windows에서 발생하던 Rlocation failed 및 패키지 중복 수집 문제를 해소하는 방향으로 Bazel 설정을 조정했습니다.
    • identityconfiguration 모듈의 누락된 Spring 컴파일 의존성을 보완했습니다.
  • 검증 체크리스트

    • Windows에서 bazel build //systems/identity/... 성공 확인
    • Windows에서 bazel build //... 성공 확인
    • identity-domain 패키지 분석 시 중복 패키지 수집 오류가 없는지 확인
    • Kotlin 타깃이 Rlocation failed 없이 빌드되는지 확인
    • all-open 플러그인 적용 대상이 정상 컴파일되는지 확인
  • 롤아웃 नोट/노트

    • Windows Bazel/Kotlin 빌드 환경에 우선 적용하는 것이 안전합니다.
    • 의존성 업그레이드가 포함되어 있으므로, 병합 후 CI에서 전체 타깃과 Windows 관련 경로를 우선 모니터링하는 것을 권장합니다.

Walkthrough

MODULE.bazel의 grpc-java 의존성 버전이 갱신되고, kotlin.bzl의 spring_allopen 플러그인 대상이 rules_kotlin 제공 대상으로 교체되었다. configuration-application, identity-adapter-in, identity-application 세 모듈의 deps.bzl에서 KOTLIN_DEPS에 Maven/로컬 의존성이 추가되었다.

Changes

Bazel 및 Kotlin 의존성 변경

Layer / File(s) Summary
grpc-java 버전 및 allopen 컴파일러 플러그인 대상 변경
MODULE.bazel, kotlin.bzl
grpc-java bazel_dep 버전이 1.70.0에서 1.82.0으로 갱신되고, spring_allopen 플러그인이 @maven 아티팩트 대신 @rules_kotlin의 allopen-compiler-plugin 대상을 참조하도록 변경된다.
모듈별 KOTLIN_DEPS 갱신
systems/configuration/configuration-application/deps.bzl, systems/identity/identity-adapter-in/deps.bzl, systems/identity/identity-application/deps.bzl
configuration-application에 org_springframework_spring_tx가 추가되고, identity-adapter-in에 Spring Boot Web starter와 identity-application main target이 추가되며, identity-application에 org_springframework_boot_spring_boot_starter가 추가된다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: bug, bazel, kotlin

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive 핵심 요구사항인 .bazelrcMODULE.bazel.lock 변경이 필터로 제외되어 #46의 package_path/rules_kotlin 수정 여부를 확인할 수 없습니다. .bazelrcMODULE.bazel.lock의 diff를 포함해 #46 요구사항(중복 패키지, Kotlin 호환성)을 다시 검증할 수 있게 해주세요.
✅ Passed checks (9 passed)
Check name Status Explanation
Title check ✅ Passed Conventional Commit 형식이며 변경 내용과 #46을 명확히 반영합니다.
Description check ✅ Passed 빌드 실패 수정, 의존성 보강, #46 종료를 설명해 변경 사항과 관련됩니다.
Out of Scope Changes check ✅ Passed 보이는 변경은 Kotlin/all-open, Spring 의존성, grpc-java 버전 갱신 등 #46의 빌드 수정 범위와 일치합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Kotlin Layer Boundary ✅ Passed PASS: 도메인 모듈의 adapter/bootstrap import는 없고, application 모듈의 Spring/@transactional 의존성은 서비스 구현상 정당합니다.
Go Error Context ✅ Passed 이번 PR diff에는 Go 파일이 없고 변경된 내용은 Bazel/Kotlin 설정뿐이라, Go error context 규칙은 적용 대상이 아닙니다.
Bazel Formatting ✅ Passed 수정된 .bzl 파일들은 buildifier 스타일(들여쓰기, 줄바꿈, trailing comma)을 따르고, 새 타깃/리네임도 없어 타깃 명명도 안정적입니다.
Behavior Change Needs Tests ✅ Passed 변경 diff에 Kotlin/Go 소스는 없고 MODULE.bazel, MODULE.bazel.lock, deps.bzl만 수정돼 테스트 갱신 요구가 적용되지 않습니다.
Todo Must Reference Issue ✅ Passed 변경된 파일(diff)에서 TODO/FIXME 주석을 찾았지만 새로 추가된 항목이 없었고, 이슈 참조 없는 주석도 없었습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/46-fail-to-build-kotlin
  • 🛠️ cleanup stale imports
  • 🛠️ harden error messages
  • 🛠️ test clarity pass

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/46-fail-to-build-kotlin
  • 🛠️ cleanup stale imports
  • 🛠️ harden error messages
  • 🛠️ test clarity pass

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kusuri12-09

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows 환경에서 Kotlin 빌드 실패

1 participant