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

🐛(WinOS) --config-path causes "unexpected error" #3479

Open
1 task done
rivy opened this issue Jul 20, 2024 · 14 comments
Open
1 task done

🐛(WinOS) --config-path causes "unexpected error" #3479

rivy opened this issue Jul 20, 2024 · 14 comments
Labels
A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@rivy
Copy link

rivy commented Jul 20, 2024

Environment information

CLI:
  Version:                      1.8.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

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

Workspace:
  Open Documents:               0

What happened?

biome lint --config-path .\biome.jsonc panics, where otherwise, biome lint completes correctly.

❯ biome lint --config-path .\biome.jsonc
Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ignore-0.4.21\src\gitignore.rs:229:9
Thread Name: biome::worker_0
Message: path is expected to be under the root

Expected result

It should not panic.

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 S-Help-wanted Status: you're familiar with the code base and want to help the project labels Jul 20, 2024
@Conaclos
Copy link
Member

@ematipico Are you able to reproduce this bug?

@ematipico
Copy link
Member

The error comes from the ignore crate, so it's possible we are passing an incorrect path. However, we need a reproduction. This is an issue generated by the VCS integration

@ematipico ematipico added S-Needs repro Status: needs a reproduction and removed S-Help-wanted Status: you're familiar with the code base and want to help the project A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug labels Jul 22, 2024
@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
@rivy
Copy link
Author

rivy commented Aug 29, 2024

@ematipico , why are you closing this issue? It's a fundamental problem when running the application.
😕

@ematipico
Copy link
Member

We requested a reproduction, but that was never provided. After so much inactivity, we close the issue.

@rivy
Copy link
Author

rivy commented Aug 29, 2024

I don’t understand.
A reproduction was included in my initial post about the issue. It includes the simple WinOS command line which prompts the bug and the output (including the request to post it here to help you fix the issue).

@Conaclos
Copy link
Member

Conaclos commented Aug 29, 2024

I don’t understand.
A reproduction was included in my initial post about the issue. It includes the simple WinOS command line which prompts the bug and the output (including the request to post it here to help you fix the issue).

Could you share the .gitignore in the directory where you executed Biome? Without it, I think we are not able to reproduce the error.

@rivy
Copy link
Author

rivy commented Aug 29, 2024

@Conaclos , happy to do so, and thanks for looking at this issue.

# git ignore config file
# v2024-04-30 [rivy]
# spell-checker:ignore () yarnrc (jargon) globstar (names) deno dlang (people) Roy Ivy III * rivy

# NOTE: Git GLOBSTAR syntax [see `git help gitignore`]
# * ref: [.gitignore] http://git-scm.com/docs/gitignore @@ http://archive.is/Rk6rO
# * ref: [Generate a 'gitignore'](https://gitignore.io) ; eg, <https://gitignore.io/api/node>

# build/dist artifacts
/build
/[._@#$]build
/dist
/target
# note: `git add --force dist && git commit -m 'change: add updated dist artifacts'` will still add any desired distribution artifacts
# note: `git status --ignored -- build dist target` will still show changes (for release testing)
# * project cache directories
/.*-cache
/zig-cache

# coverage data
/coverage
/[._@#$]coverage
/.nyc_output

# D (dlang)
# * dub
/.dub
# note: 'dub.selections.json' is a generated file, useful to applications (for reproducible builds) but not generally for libraries; use `git add --force ...` if needed
/dub.selections.json

# Deno
/deno.lock

# JS/TS
# * ignore JS import/package-related files
/node_modules
/package-lock.json
/yarn.lock
# * allow packaging of lock files into '.deps-lock'
!/.deps-lock/package-lock.json
!/.deps-lock/yarn.lock
# * ignore `yarn`-related files (allows use of "modern" v2+ `yarn`)
# - ref: <https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored> @@ <https://archive.is/Sc1Ab>
.pnp.*
/.yarn/*
!/.yarn/patches
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks
!/.yarn/versions
# * use `.yarnrc.yml` for `yarn` config
/.yarnrc

# VSCode
# * ignore local-only VSCode artifacts
# - logs/settings
/.vscode/c_cpp_properties.json
/.vscode/makefile.extension.output
# - precompiled headers for IntelliSense ## spell-checker:ignore ipch
/.vscode/ipch/

## local-start
## local-end

Any use of --config-path causes the error (eg, biome lint --config-path .biome.lenient.jsonc, ...).

Let me know if there's anything else I can do to help track down the cause.

@Conaclos Conaclos reopened this Aug 29, 2024
@rivy
Copy link
Author

rivy commented Aug 29, 2024

@Conaclos , notably:

1 - an empty or missing .gitignore avoids the error
2 - a .gitignore with only comments avoids the error
3 - a .gitignore with any actual "ignore" (non-commentary) content => ERROR

I hope that's helpful.

@Conaclos
Copy link
Member

Unfortunately I cannot reproduce the issue.

Here is my attempt:

❯ git init

❯ npm init --yes

❯ npm i -D @biomejs/biome

❯ tree 
├── biome.jsonc
├── package.json
├── src
│   └── index.js

❯ cat biome.jsonc
{
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  }
}

❯ npx biome lint --config-path ./biome.jsonc 
Checked 3 files in 909µs. No fixes applied.

Note: I am on Linux.

@rivy
Copy link
Author

rivy commented Aug 29, 2024

@Conaclos ,

Yes, it looks like a WinOS-specific problem.
Using WSL with the exact same project files of my prior example, there is no error.

@rivy
Copy link
Author

rivy commented Aug 30, 2024

Here's a minimal reproduction (file repo at https://github.com/rivy-fix/biome-config-bug).

> dir
 Volume in drive C is Local Disk
 Volume Serial Number is 1C33-48C1

 Directory of C:\Users\Roy\AARK\Projects\js\t-biome\repo

2024-08-29  20:22    <DIR>          .
2024-08-29  20:22    <DIR>          ..
2024-08-29  20:24    <DIR>          .git
2024-08-29  20:21                 3 .gitignore
2024-08-29  20:19               137 biome.json
2024-08-29  20:09               329 package.json
               3 File(s)            469 bytes
               3 Dir(s)  369,052,930,048 bytes free
> cat .gitignore
FOO
> cat biome.json
{
        "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
        "vcs": { "clientKind": "git", "enabled": true, "useIgnoreFile": true }
}
> cat package.json
{
  "name": "repo",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Roy Ivy III <rivy.dev@gmail.com> (https://rivy.dev/)",
  "license": "MIT",
  "description": "",
  "devDependencies": {
    "@biomejs/biome": "^1.8.3"
  }
}
> npx biome lint
Checked 2 files in 1988µs. No fixes applied.
> npx biome lint --config-path biome.json
Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ignore-0.4.21\src\gitignore.rs:229:9
Thread Name: biome::worker_0
Message: path is expected to be under the root
> wsl
...
$ npx biome lint
Checked 2 files in 2ms. No fixes applied.
$ npx biome lint --config-path biome.json
Checked 2 files in 2ms. No fixes applied.

@ematipico ematipico added A-CLI Area: CLI S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs repro Status: needs a reproduction labels Aug 30, 2024
@ematipico
Copy link
Member

Thank you. That's what I meant with providing a reproduction. Providing only the commands isn't enough.

@rivy
Copy link
Author

rivy commented Aug 30, 2024

Sorry, your prior message seemed internal, not directed at me for additional information.
I'm happy to help narrow down the issue. Just ask if you need anything else.

@rivy
Copy link
Author

rivy commented Jan 11, 2025

Ping @ematipico , any progress on this?
It's still an issue as of v1.9.4.
Thanks for any updates.

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

No branches or pull requests

3 participants