Skip to content

Example WORKSPACE override without MODULE.bazel #115

@jamesreprise

Description

@jamesreprise

For Bazel 7.4.0, I've found that putting the suggested http_archive call at the beginning or end of a 'WORKSPACE' file doesn't have any effect - the default Bazel @platforms is not overridden.

With this placed in 'WORKSPACE', attempting to build with a repository that references versions of platforms later than what was bundled with Bazel 7.4.0 yields an error as follows.

ERROR: /private/var/tmp/_bazel_james/a44fae3b01e4e9e5bdb196f0b360847f/external/platforms/os/BUILD: no such target '@@platforms//os:uefi': target 'uefi' not declared in package 'os' defined by /private/var/tmp/_bazel_james/a44fae3b01e4e9e5bdb196f0b360847f/external/platforms/os/BUILD

I believe bazelbuild/rules_rust#2142 (comment) was experiencing the same issue, as the given solution of placing bazel_dep(name = "platforms", version = "0.0.11") or similar in 'MODULE.bazel' works.

Is it possible to override the default @platforms without 'MODULE.bazel'? If so, could an example be given as to how this is done?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions