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

[turborepo] error hashing package files: invalid glob: failed to parse glob expression from 1.10.4-canary.0 onwards #5378

Closed
Inlustra opened this issue Jun 25, 2023 · 7 comments
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo

Comments

@Inlustra
Copy link

Inlustra commented Jun 25, 2023

What version of Turborepo are you using?

1.10.6

What package manager are you using / does the bug impact?

Yarn v2/v3 (node_modules linker only)

What operating system are you using?

Linux

Describe the Bug

Ends with the following error:

Turbo error: error hashing package files: invalid glob: failed to parse glob expression

I'm also unable to run a --summarize due to the same error

Errors:

❯ TURBO_LOG_LEVEL=TRACE turbo --verbosity=3 build
2023-06-25T00:09:22.802+0000 [DEBUG] turborepo_lib::shim: Global turbo version: 1.10.6
2023-06-25T00:09:23.484+0000 [DEBUG] turborepo_lib::shim: Local turbo path: /Internal/rowm/node_modules/turbo-linux-64/bin/turbo
2023-06-25T00:09:23.484+0000 [DEBUG] turborepo_lib::shim: Local turbo version: 1.10.6
2023-06-25T00:09:23.484+0000 [DEBUG] turborepo_lib::shim: Repository Root: /Internal/rowm
2023-06-25T00:09:23.485+0000 [DEBUG] turborepo_lib::shim: Running local turbo binary in /Internal/rowm/node_modules/turbo-linux-64/bin/turbo

2023-06-25T00:09:23.485+0000 [DEBUG] turborepo_lib::shim: supports_skip_infer_and_single_package true
2023-06-25T00:09:23.521Z [DEBUG] turbo: build tag: rust
2023-06-25T00:09:23.729Z [DEBUG] turbo: running in daemon mode
2023-06-25T00:09:23.731Z [DEBUG] turbo: global hash env vars: vars=[]
2023-06-25T00:09:23.731Z [DEBUG] turbo: global hash: value=8d6ecf842166dd4c
2023-06-25T00:09:23.731Z [DEBUG] turbo: local cache folder: path=""
2023-06-25T00:09:24.241Z [ERROR] turbo: error: run failed: error hashing package files: invalid glob: failed to parse glob expression
 ERROR  run failed: error hashing package files: invalid glob: failed to parse glob expression
Turbo error: error hashing package files: invalid glob: failed to parse glob expression
  • 1.10.2 - Works
  • 1.10.3 - Works
  • 1.10.4-canary.0 - Broken
  • 1.10.4-canary.1 - Broken
  • 1.10.4-canary.2 - Broken
  • 1.10.4-canary.3 - Broken
  • 1.10.4-canary.4 - Broken
  • 1.10.4 - Broken
  • 1.10.5 - Broken
  • 1.10.6 - Broken

Changes between 1.10.3 & 1.10.4-canary.0
v1.10.3...v1.10.4-canary.0

Expected Behavior

It builds correctly

To Reproduce

TURBO_LOG_LEVEL=TRACE turbo --verbosity=3 build

Reproduction Repo

No response

@Inlustra Inlustra added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Jun 25, 2023
@Inlustra Inlustra changed the title [turborepo] [turborepo] error hashing package files: invalid glob: failed to parse glob expression Jun 25, 2023
@Inlustra Inlustra changed the title [turborepo] error hashing package files: invalid glob: failed to parse glob expression [turborepo] error hashing package files: invalid glob: failed to parse glob expression from 1.10.4-canary.1 onwards Jun 25, 2023
@Inlustra Inlustra changed the title [turborepo] error hashing package files: invalid glob: failed to parse glob expression from 1.10.4-canary.1 onwards [turborepo] error hashing package files: invalid glob: failed to parse glob expression from 1.10.4-canary.0 onwards Jun 25, 2023
@chris-olszewski
Copy link
Member

Could you try upgrading to 1.10.7? We switched our globbing library and accidentally made the globs we accept overly restrictive.

@TomaszG
Copy link

TomaszG commented Jul 5, 2023

I'm experiencing the same in 1.10.7:

 ERROR  run failed: error hashing package files: bad pattern /home/runner/work/<censored>/<censored>/packages/eslint-config/:!cypress/: failed to parse glob expression

It's because I want to exclude one directory from the inputs array:

			"inputs": [
				"*.{js,ts}",
				"src/**/*",
				"public/**/*",
				"package.json",
				"{j,t}sconfig.*json",
				":!cypress/"
			],

Is there any other way to do that?

UPDATE:
I have fixed that by changing :!cypress/ to !cypress/**.

@cornedor
Copy link

I'm on 1.10.9, this is also treated as an invalid glob:

src/**/!(*.generated).{ts,tsx}

This glob does work:

!src/**/*.generated.{ts,tsx}

Additionally, In my project turborepo does not throw an error, but instead hangs. However, I cannot reproduce this. The solution described in #5468 did not work for me.

❯ npm run lint     

> redacted@0.0.0 lint
> turbo run lint -vvv --no-cache

2023-07-21T10:26:34.108+0200 [DEBUG] turborepo_lib::shim: Global turbo version: 1.10.9
2023-07-21T10:26:34.118+0200 [DEBUG] turborepo_lib::shim: Local turbo path: /Users/corne/Development/library/node_modules/turbo-darwin-arm64/bin/turbo
2023-07-21T10:26:34.118+0200 [DEBUG] turborepo_lib::shim: Local turbo version: 1.10.9
2023-07-21T10:26:34.118+0200 [DEBUG] turborepo_lib::shim: Repository Root: /Users/corne/Development/library
2023-07-21T10:26:34.119+0200 [DEBUG] turborepo_lib::shim: Running local turbo binary in /Users/corne/Development/library/node_modules/turbo-darwin-arm64/bin/turbo

2023-07-21T10:26:34.119+0200 [DEBUG] turborepo_lib::shim: supports_skip_infer_and_single_package true
^C

@wesrice
Copy link

wesrice commented Jul 26, 2023

I had some simple, but invalid globs that used parenthesis.

"!(foo/bar/baz.tsx)"

The parenthesis were an artifact from a previous glob implementation and were no longer needed. I was able to refactor these globs not to use the parenthesis and they worked.

"!foo/bar/baz.tsx"

While this might not be super-helpful for all circumstances, I thought I'd share this as a possible test case to consider while fixing this issue.

@cahnory
Copy link

cahnory commented Dec 7, 2023

After upgrading from 1.10.16 to 1.11.0 this pattern in my globalDependencies is considered invalid:

@(apps|libs)/*/tsconfig.json

ERROR run failed: bad pattern /Users/.../@(apps|libs)/tsconfig.json: failed to parse glob expression

I thought it was related to this issue but if needed I can open a new one.

@psychobolt
Copy link

psychobolt commented Jan 31, 2024

I think this used to work, but now its not:

"coverage/coverage*(*).json"

https://unix.stackexchange.com/questions/238809/match-zero-or-more-operator-in-shell-globbing

@gsoltis
Copy link
Contributor

gsoltis commented Feb 2, 2024

Hey all, apologies for the thrash in glob support, different libraries have different ideas about syntax. We've now documented what we're committed to supporting in terms of glob syntax: https://turbo.build/repo/docs/reference/configuration#glob-specification-for-paths

I'm going to close this issue, but if you have a glob that is failing to parse and that is using the supported syntax, please file a new issue.

@gsoltis gsoltis closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo
Projects
None yet
Development

No branches or pull requests

9 participants