这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@praggCode
Copy link

fix(config-dir): resolve relative TURBO_CONFIG_DIR_PATH before validation

Fixes issue #8645

Summary

This PR fixes a bug where setting TURBO_CONFIG_DIR_PATH to a relative path
(e.g., "configs") caused Turborepo to fail with:

PathError::NotAbsolute("configs")

AbsoluteSystemPathBuf::new() only accepts absolute paths, but the value from
the environment variable was passed directly without being resolved.
This caused a startup failure even though the provided path was valid.

Root Cause

When a user sets: TURBO_CONFIG_DIR_PATH="configs"

Turborepo attempted to validate "configs" as an absolute path.
Since it is relative, the validator rejected it, causing Turborepo to stop early.

What This PR Changes

  • Detects whether the provided TURBO_CONFIG_DIR_PATH is relative

  • If relative, resolves it against the current working directory:

    std::env::current_dir()?.join(raw)

Converts the resolved path to UTF-8
Passes the resulting absolute path into AbsoluteSystemPathBuf::new()
Leaves absolute paths fully unchanged
Introduces zero breaking changes

Why This Fix Is Safe

  • Relative → absolute resolution is deterministic and standard practice
  • Absolute paths behave exactly the same as before
  • Error surface area decreases (fewer startup failures)
  • The change is minimal, well-scoped, and consistent with existing path logic
  • No impact on users who do not set the environment variable

@praggCode praggCode requested a review from a team as a code owner November 15, 2025 14:48
@praggCode praggCode requested a review from tknickman November 15, 2025 14:48
@vercel
Copy link
Contributor

vercel bot commented Nov 15, 2025

@praggCode is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@praggCode praggCode changed the title fix: resolve TURBO_CONFIG_DIR_PATH to absolute path fix(config-dir): Resolve relative TURBO_CONFIG_DIR_PATH before validation Nov 15, 2025
@anthonyshew anthonyshew changed the title fix(config-dir): Resolve relative TURBO_CONFIG_DIR_PATH before validation fix(config-dir): Resolve relative TURBO_CONFIG_DIR_PATH before validation Nov 18, 2025
@vercel
Copy link
Contributor

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-designsystem-docs Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-gatsby-web Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-kitchensink-blog Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-nonmonorepo Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-svelte-web Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-tailwind-web Ready Ready Preview Comment Nov 18, 2025 5:32am
examples-vite-web Ready Ready Preview Comment Nov 18, 2025 5:32am
turbo-site Ready Ready Preview Comment Nov 18, 2025 5:32am

Copy link
Contributor

@anthonyshew anthonyshew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added some tests for this crate in #11132 to make sure that the code in this PR would introduce failing tests, and they did as expected.

I also had to add handling for empty strings in this PR because of those added tests, which is also an improvement. Thanks for the inpsiration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants