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

🐛 --changed in monorepos throws No such file or directory (os error 2) #1996

Closed
1 task done
valkum opened this issue Mar 7, 2024 · 1 comment · Fixed by #2319
Closed
1 task done

🐛 --changed in monorepos throws No such file or directory (os error 2) #1996

valkum opened this issue Mar 7, 2024 · 1 comment · Fixed by #2319
Labels
A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@valkum
Copy link

valkum commented Mar 7, 2024

Environment information

CLI:
  Version:                      1.5.3-nightly.4fa841c
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v21.6.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/4.1.0"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

If you have a monorepo with a folder named /typescript and you run the biome command inside the /typescript folder it will try to access the changed files that are outside of the /typescript directory (even with vcsRoot set).
This emits Internal errors

yarn run biome check --since origin/main --changed --vcs-root .. --vcs-enabled true --no-errors-on-unmatched .",

PWD: /Users/valkum/git/projects/x/typescript
typescript/scripts/ci-check.sh internalError/io  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ No such file or directory (os error 2)

  ⚠ This diagnostic was derived from an internal Biome error. Potential bug, please report it if necessary.


Checked 0 files in 710µs. No fixes needed.

Expected result

The paths of the changed files should be compared against the current working directory and updated and filtered before accessed.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug labels Mar 7, 2024
@castarco
Copy link
Contributor

castarco commented Apr 5, 2024

From what I see, this bug also applies as well to the --staged feature I proposed ( #2300 ) (I already verified it, it fails because of the same reason).

Is anyone working on this one? I can prepare a fix for this one, as I already familiarised myself with that part of the code base.

castarco added a commit to kindspells/forked-biome that referenced this issue Apr 5, 2024
When running `lint`, `check` or `format` with the flag `--changed`,
ensure that files outside the current directory are filtered out before
processing them.

Signed-off-by: Andres Correa Casablanca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants