Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: invalid lockfile entry #2124

Open
jeff-scifin opened this issue Mar 11, 2025 · 1 comment
Open

[Bug]: invalid lockfile entry #2124

jeff-scifin opened this issue Mar 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jeff-scifin
Copy link

What happened?

When running bazel build ... The following warning is output. It does not seem to have a negative impact on the build.

WARNING: The module extension @@aspect_rules_js~//npm:extensions.bzl%npm produced an invalid lockfile entry because it referenced @@[unknown repo '' requested from @@aspect_rules_js~]. Please report this issue to its maintainers.

Version

Development (host) and target OS/architectures:

Output of bazel --version: 7.4.1

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
MODULE.bazel

Language(s) and/or frameworks involved:

How to reproduce

- `MODULE.bazel` aspect rules section below
- The warning was introduced with the last section for pinning a specific pnpm version to 9.7.1.
- The warning does NOT with bazel 7.3.0, though we are on 7.4.1 for some experimental flags that don't exist in previous versions.
- `pnpm-lock.yaml` is correctly versioned to 9


#------------------------------------------------------------------------------
#                          Aspect Rules
#------------------------------------------------------------------------------

bazel_dep(name = "aspect_rules_cypress", version = "0.7.0")

cypress = use_extension(
    "@aspect_rules_cypress//cypress:extensions.bzl",
    "cypress",
)
cypress.toolchain(
    name = "cypress",
    cypress_version = "13.6.6",
)
use_repo(cypress, "cypress_toolchains")
register_toolchains("@cypress_toolchains//:all")

bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")

# aspect_rule_swc repo version 2.3.0 (latest as of 25-Feb-2025) doesn't fetch
# correctly in arm64. So using previous version from
# https://registry.bazel.build/modules/aspect_rules_swc
bazel_dep(name = "aspect_rules_swc", version = "2.0.1")

bazel_dep(name = "aspect_rules_ts", version = "3.5.0")

ts = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
ts.deps(ts_version_from = "//:package.json")
use_repo(ts, "npm_typescript")

bazel_dep(name = "aspect_rules_js", version = "2.2.0")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
    name = "npm",
    data = [
        "//:pnpm-workspace.yaml",
        "//:package.json",
        "//ports:package.json",
        "//spectrum/auth:package.json",
        "//spectrum/dashboard/ui:package.json",
        "//spectrum/host-app:package.json",
        "//spectrum/components:package.json",
        "//spectrum/widget-core/ui:package.json",
        "//spectrum/widgets/ui:package.json",
        "//platform/platypus/ui:package.json",
        "//skill/pipeline/ui:package.json",
        # Include any other package.json files in your workspace
    ],
    lifecycle_hooks_exclude = [
        # Speed up installation by disabling cypress binary install. Optional.
        "cypress",
    ],
    no_optional = True,
    npmrc = "@@//:.npmrc",
    pnpm_lock = "//:pnpm-lock.yaml",
    update_pnpm_lock = True,
    verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")


pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(
    name = "pnpm",
    pnpm_version = "9.7.0",
)
use_repo(pnpm, "pnpm")

Any other information?

relevant section from MODULE.bazel.lock

    "@@aspect_rules_js~//npm:extensions.bzl%pnpm": {
      "general": {
        "bzlTransitiveDigest": "WClUl6qbzZmGODk/OMN5EOS/OtPVZZbaUl42zfiW9dc=",
        "usagesDigest": "ev9oDWsZFVbGLuDePSLi6AHixtFrzHvtJxGgEzqVxNw=",
        "recordedFileInputs": {},
        "recordedDirentsInputs": {},
        "envVariables": {},
        "generatedRepoSpecs": {
          "pnpm": {
            "bzlFile": "@@aspect_rules_js~//npm/private:npm_import.bzl",
            "ruleClassName": "npm_import_rule",
            "attributes": {
              "package": "pnpm",
              "version": "9.7.0",
              "root_package": "",
              "link_workspace": "",
              "link_packages": {},
              "integrity": "sha512-3AlDAVa0J/Xs/HmIiJnhw50taQ8AS+cOBSMLcssXPZaDlYdUXQlCm1WsPEKcgBtNw8DgAvZTgwpCD6LdTjz5zw==",
              "url": "",
              "commit": "",
              "patch_args": [
                "-p0"
              ],
              "patches": [],
              "custom_postinstall": "",
              "npm_auth": "",
              "npm_auth_basic": "",
              "npm_auth_username": "",
              "npm_auth_password": "",
              "lifecycle_hooks": [],
              "extra_build_content": "load(\"@aspect_rules_js//js:defs.bzl\", \"js_binary\")\njs_binary(name = \"pnpm\", data = glob([\"package/**\"]), entry_point = \"package/dist/pnpm.cjs\", visibility = [\"//visibility:public\"])",
              "generate_bzl_library_targets": false,
              "extract_full_archive": true,
              "system_tar": "auto"
            }
          },
          "pnpm__links": {
            "bzlFile": "@@aspect_rules_js~//npm/private:npm_import.bzl",
            "ruleClassName": "npm_import_links",
            "attributes": {
              "package": "pnpm",
              "version": "9.7.0",
              "dev": false,
              "root_package": "",
              "link_packages": {},
              "deps": {},
              "transitive_closure": {},
              "lifecycle_build_target": false,
              "lifecycle_hooks_env": [],
              "lifecycle_hooks_execution_requirements": [
                "no-sandbox"
              ],
              "lifecycle_hooks_use_default_shell_env": false,
              "bins": {},
              "package_visibility": [
                "//visibility:public"
              ],
              "replace_package": "",
              "exclude_package_contents": []
            }
          }
        },
        "recordedRepoMappingEntries": [
          [
            "aspect_bazel_lib~",
            "bazel_skylib",
            "bazel_skylib~"
          ],
          [
            "aspect_bazel_lib~",
            "bazel_tools",
            "bazel_tools"
          ],
          [
            "aspect_rules_js~",
            "aspect_bazel_lib",
            "aspect_bazel_lib~"
          ],
          [
            "aspect_rules_js~",
            "bazel_features",
            "bazel_features~"
          ],
          [
            "aspect_rules_js~",
            "bazel_skylib",
            "bazel_skylib~"
          ],
          [
            "aspect_rules_js~",
            "bazel_tools",
            "bazel_tools"
          ],
          [
            "bazel_features~",
            "bazel_features_globals",
            "bazel_features~~version_extension~bazel_features_globals"
          ],
          [
            "bazel_features~",
            "bazel_features_version",
            "bazel_features~~version_extension~bazel_features_version"
          ]
        ]
      }
    },
@jeff-scifin jeff-scifin added the bug Something isn't working label Mar 11, 2025
@jbedard
Copy link
Member

jbedard commented Mar 11, 2025

Can you provide a minimal repro in a basic git repo that I can clone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants