Skip to content

Cannot use error lock_mode with new experimental index urls #3711

Description

@darkrift

When I locally run bazel mod deps update, the lock file is not working when we run in GHA.

In GHA, our build fails with a message saying that a section is missing (index_url) while adding that section manually also makes our GHA workflow fail saying this section should now not exist.

On linux machines, it appears that doing bazel clean --expunge followed by bazel mod deps --lockfile_mode=update toggles between adding the index_url and removing it from the facts.

This is using bazel 8.6.0

BUILD.bazel

pip_compile(
    name = "generate_requirements_linux_txt",
    python_platform = "x86_64-unknown-linux-gnu",
    requirements_in = "requirements.txt",
    requirements_txt = "requirements_linux.txt",
    tags = ["no-remote"],
)

pip_compile(
    name = "generate_requirements_macos_txt",
    python_platform = "aarch64-apple-darwin",
    requirements_in = "requirements.txt",
    requirements_txt = "requirements_macos.txt",
    tags = ["no-remote"],
)

pip_compile(
    name = "generate_requirements_macos_x86_txt",
    python_platform = "x86_64-apple-darwin",
    requirements_in = "requirements.txt",
    requirements_txt = "requirements_macos_x86.txt",
    tags = ["no-remote"],
)

multirun(
    name = "generate_requirements_lock",
    commands = [
        ":generate_requirements_linux_txt",
        ":generate_requirements_macos_txt",
        ":generate_requirements_macos_x86_txt",
    ],
    # Running in a single threaded mode allows consecutive `uv` invocations to benefit
    # from the `uv` cache from the first run.
    jobs = 1,
)

MODULE.bazel

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "pip",
    python_version = python_version,
    requirements_by_platform = {
        "//:requirements_linux.txt": "linux_x86_64",
        "//:requirements_macos.txt": "osx_aarch64",
        "//:requirements_macos_x86.txt": "osx_x86_64",
    },
    target_platforms = [
        "linux_x86_64",
        "osx_aarch64",
        "osx_x86_64",
    ],
)
use_repo(pip, "pip")

requirements.txt

--index-url https://prod-artifactory.lmi.tools/artifactory/api/pypi/python-private/simple
--extra-index-url https://prod-artifactory.lmi.tools/artifactory/api/pypi/pypi-release-local/simple
asterisk-ami==0.1.7
betterproto==2.0.0b7
boto3==1.40.1
confluent_kafka==2.11.0
integration-test-common==0.7.6
jive-wiremock-api==0.1.21
lcov_cobertura==2.1.1
nats-py==2.11.0
prometheus_client==0.24.1
psycopg[binary]==3.2.9
psycopg2-binary==2.9.11
pydot==4.0.1
PyHamcrest==2.1.0
pytest==8.4.1
pytest_asyncio==1.1.0
pytest_cases==3.9.1
pytest_httpserver==1.1.3
pytest-timeout==2.4.0
redis==6.2.0
requests==2.33.0
requests-futures==1.0.2
topic-specifications==4.34.11
urllib3==2.6.3
websocket-client==1.8.0
rtclite==3.0.2

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions