I am trying to build the Android kernel for the Pixel 7 using Bazel, following the official documentation here. However, I encounter the following error during the build process:
pixel_kernel$ tools/bazel run --config=fast --config=stamp //private/google-modules/soc/gs:panther_dist
ERROR: Skipping '//private/google-modules/soc/gs:panther_dist': no such package 'private/google-modules/soc/gs': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
/xxx/pixel_kernel/private/google-modules/soc/gs
WARNING: Target pattern parsing failed.
ERROR: no such package 'private/google-modules/soc/gs': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
/xxx/pixel_kernel/private/google-modules/soc/gs
INFO: Elapsed time: 0.039s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successful
Steps I followed:refferred this official page (https://source.android.com/docs/setup/build/building-pixel-kernels),to build kernel but the build failed.
- Downloaded kernel source (
android-gs-pantah-5.10-android14
) using:
repo init -u https://android.googlesource.com/kernel/manifest -b android-gs-pantah-5.10-android14
repo sync
2. Attempted to build using Bazel since build_panther.sh
was not found:
tools/bazel run --lto=thin //gs/google-modules/soc-modules:slider_dist
Expected Outcome: I expect the build to complete successfully and generate the necessary images for flashing the kernel.
Questions:
-
How can I resolve the ‘no such package’ error when running
tools/bazel run --config=fast --config=stamp //private/google-modules/soc/gs:panther_dist
? -
Should
build_panther.sh
be present in the build root directory for this build process, or is usingtools/bazel
alone sufficient?Any assistance or guidance would be greatly appreciated!