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

dev: reject builds when CRL JS dependencies are 'pnpm link'ed #107129

Commits on Jul 19, 2023

  1. dev: reject builds when CRL JS dependencies are 'pnpm link'ed

    When working with first-party JS dependencies that aren't in this
    monorepo, the idiomatic development workflow uses pnpm link [1] to link
    multiple JS packages together. Specifically, running
    'pnpm link /path/to/github.com/cockroachdb/ui/packages/foo' from within
    pkg/ui/workspaces/* creates a symbolic link at
    node_modules/@cockroachlabs/foo that points to
    ../../(…)/ui/packages/foo. This works quite smoothly for local
    development, as changes in the 'foo' package are automatically seen by a
    'pnpm webpack --watch' running in CRDB. The two packages act like
    they're maintained in the same repo, while allowing independent version
    history, CI processes, etc.
    
    Unfortunately, rules_js currently offers no way to link outside of the
    Bazel workspace. Such a symlink is either ignored by rules_js (since it
    doesn't appear in pnpm-lock.yaml) or is rejected if it's manually added
    to the lockfile [2]. Allowing Bazel-based builds of CockroachDB when
    'pnpm link'ed packages are present introduces dependency skew between
    Bazel and non-Bazel builds. To allow 'pnpm link' to be used safely,
    pre-emptively reject builds of 'cockroach' and 'cockroach-oss' that are
    run through the 'dev' helper when linked @cockroachlabs/ packages are
    detected.
    
    [1] https://pnpm.io/cli/link
    [2] aspect-build/rules_js#1165
    
    Release note: None
    Epic: none
    sjbarag committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    3ba9bcb View commit details
    Browse the repository at this point in the history