Bazel: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Fix: remove --- horizontal lines (9 removed))
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Bazel is a tool that '''automates software builds and tests'''. Supported build tasks include running compilers and linkers to produce executable programs and libraries, and assembling deployable packages for Android, iOS and other target environments<ref>https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwix_f67rJqCAxUErlYBHc29CNkQFnoECAkQAw&url=https%3A%2F%2Fbazel.build%2Fabout%2Ffaq&usg=AOvVaw2LTedC5jnCi-zPHaBwVp9D&opi=89978449</ref>
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}


== Install specific version of bazel ==
{{TOC}}
[https://bazel.build/install Bazel install page] describes multiple way to install bazel,  following is our preferred method for automated build scripts that uses various version of bazel depending on the projects.<syntaxhighlight lang="bash">
#example version 6.3.2
$export _version=6.3.2
$ wget https://github.com/bazelbuild/bazel/releases/download/$_version/bazel-$_version-installer-linux-x86_64.sh
$chmod +x bazel-$_version-installer-linux-x86_64.sh


# to install user only
== Overview ==
$./bazel-$_version-installer-linux-x86_64.sh --user


# to install system-wide 
Bazel에 대한 기술 문서입니다.
$./bazel-$_version-installer-linux-x86_64.sh


</syntaxhighlight>
=== Summary ===


== Tips and tricks ==
* 무엇인가? - Bazel
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


=== How to override the use of output when building with Bazel ===
* The default output path is /tmp but depending on the version or default .bazelrc can be different output path, to override output path set <code>--output_base</code> or --output_user_root to put all output in a non-default directory
** <code>--output_base</code> startup option to override the default output base directory
** <code>--output_user_root</code> startup option to override the default install base and output base
* <code>bazel --output_base=/dir/path/you/want/to build //<whatever></code>
* <code>bazel --output_user_root=/dir/path/you/want/to build //<whatever></code>


* <code>bazel clean</code> does an <code>rm -rf</code> on the <code>outputPath</code> and the <code>action_cache</code> directory. It also removes the workspace symlinks. The <code>--expunge</code> option will clean the entire outputBase.<ref>https://bazel.build/remote/output-directories</ref>
== Purpose ==


=== Server terminated abruptly<ref>https://stackoverflow.com/questions/65605663/cannot-build-with-error-server-terminated-abruptly</ref> ===
이 문서가 존재하는 이유
 
* Goal: Bazel에 대한 기술 정보 제공
* Scope: Bazel의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
 
 
== Key Concepts ==
 
{| class="wikitable"
! Concept
! Description
! Related
|-
| Bazel
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}
 
 
== Detailed Explanation ==
 
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}
Bazel은 소프트웨어 빌드 및 테스트를 자동화하는 도구입니다. 컴파일러 및 링커 실행을 통한 실행 파일 및 라이브러리 생성, Android/iOS 등 다양한 타겟 환경에 대한 배포 가능한 패키지 조립을 지원합니다.
* 무엇인가? Google 개발 소프트웨어 빌드 및 테스트 자동화 도구
* 왜 필요한가? 복잡한 빌드 의존성 관리, 캐싱, 분산 빌드 지원
* 언제 사용하는가? 대규모 코드베이스, 다중 언어 프로젝트, CI/CD 파이프라인
이 문서가 존재하는 이유
* Goal: Bazel 설치 방법, 출력 경로 설정,常见问题 해결 가이드 제공
* Scope: Bazel 버전별 설치, --output_base/--output_user_root, server terminated 오류
* Non-goals: BUILD 파일 작성, Bazel 규칙 상세, Starlanguag 언어
{| class="wikitable"
! Concept
! Description
! Related
|-
 
 
== Best Practices ==
 
* 최신 버전 사용 권장
* 공식 문서 참고
* 테스트 환경에서 먼저 검증


* The most common cause we've seen for this kind of thing (can't say for sure without the <code>jvm.out</code>) is running out of memory which results in the OOM killer terminating the bazel server process.
** Using a lower <code>--jobs</code> is the most direct way to limit that.
** <code>--local_ram_resources</code> will help in theory, but bazel doesn't have a very good idea how much RAM each compilation command uses so it's very approximate.


== References ==
== References ==
<references />
 
* [https://wiki.hpcmate.com Bazel]
 
 
== Related Pages ==
 
* [[Linux]]
* [[Server]]
* [[Hardware]]
* [[Network]]
 
 
[[Category:Server]]
== Knowledge Graph ==
 
Related
 
→ [[Linux]]
→ [[Server]]
→ [[Hardware]]
→ [[Network]]
 
[[Category:Reference]]

Latest revision as of 11:27, 17 July 2026

Template:Status

Template:TOC

Overview

Bazel에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Bazel
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


Purpose

이 문서가 존재하는 이유

  • Goal: Bazel에 대한 기술 정보 제공
  • Scope: Bazel의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장


Key Concepts

Concept Description Related
Bazel HPC/서버 환경에서 중요한 기술 개념 Linux, Server


Detailed Explanation

|status=Draft |owner=Knowledge Agent |last_update=2026-07-16 |review=Pending }} Bazel은 소프트웨어 빌드 및 테스트를 자동화하는 도구입니다. 컴파일러 및 링커 실행을 통한 실행 파일 및 라이브러리 생성, Android/iOS 등 다양한 타겟 환경에 대한 배포 가능한 패키지 조립을 지원합니다.

  • 무엇인가? Google 개발 소프트웨어 빌드 및 테스트 자동화 도구
  • 왜 필요한가? 복잡한 빌드 의존성 관리, 캐싱, 분산 빌드 지원
  • 언제 사용하는가? 대규모 코드베이스, 다중 언어 프로젝트, CI/CD 파이프라인

이 문서가 존재하는 이유

  • Goal: Bazel 설치 방법, 출력 경로 설정,常见问题 해결 가이드 제공
  • Scope: Bazel 버전별 설치, --output_base/--output_user_root, server terminated 오류
  • Non-goals: BUILD 파일 작성, Bazel 규칙 상세, Starlanguag 언어

Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증


References


Related Pages

Knowledge Graph

Related

LinuxServerHardwareNetwork

Concept Description Related