google / mozc

Mozc - a Japanese Input Method Editor designed for multi-platform
Other
2.32k stars 330 forks source link

Consider specifying `configure = True` when using `repository_rule` #844

Closed yukawa closed 8 months ago

yukawa commented 8 months ago

Description

Currently pkg_config_repository, qt_mac_repository.bzl, and android_repository use repository_rule without configure = True.

If the configure flag is set, the repository is only re-fetched on bazel sync when the --configure parameter is passed to it (if the attribute is unset, this command will not cause a re-fetch)

As a result, these repositories will not be re-evaluated upon bazel sync --configure.

pkg_config_repository

https://github.com/google/mozc/blob/e324bf2d2fe46dbe052ab3c1b4153f0b1c50a9a0/src/bazel/pkg_config_repository.bzl#L117-L122

https://github.com/google/mozc/blob/e324bf2d2fe46dbe052ab3c1b4153f0b1c50a9a0/src/WORKSPACE.bazel#L119-L123

https://github.com/google/mozc/blob/e324bf2d2fe46dbe052ab3c1b4153f0b1c50a9a0/src/WORKSPACE.bazel#L132-L136

qt_mac_repository.bzl

https://github.com/google/mozc/blob/e324bf2d2fe46dbe052ab3c1b4153f0b1c50a9a0/src/bazel/qt_mac_repository.bzl#L44-L50

android_repository

https://github.com/google/mozc/blob/e324bf2d2fe46dbe052ab3c1b4153f0b1c50a9a0/src/bazel/android_repository.bzl#L63-L66

Steps to reproduce

  1. Install Ubuntu 23.10 server as a minimum installation
  2. Run the following commands.
    sudo apt-get install -y curl gnupg libncurses6
    curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
    sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
    echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
    sudo apt-get update
    sudo apt-get install -y git build-essential python3 bazel pkg-config
    git clone https://github.com/google/mozc.git -b master --single-branch --recursive
    cd mozc/src
    bazel build package --config oss_linux -c opt
  3. Then run the following commands.
    sudo apt-get install -y libibus-1.0-dev libglib2.0-dev qt6-base-dev libgl-dev
    bazel sync --configure
    bazel build package --config oss_linux -c opt

Expected behavior

Actual behavior

Version or commit-id

e324bf2d2fe46dbe052ab3c1b4153f0b1c50a9a0

Environment