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

Fix windows-yarn lockfile manipulation/marshalling into YAML #145

@jaredpalmer

Description

@jaredpalmer

What version of Turbrepo are you using?

1.0.0

Describe the Bug

Window x Yarn v1 deo-opts to full lockfile hashing due to a window bug in the yarn lockfile parsing code in ReadLockfile():

https://github.com/vercel/turborepo/blob/main/cli/internal/fs/lockfile.go#L45

This function's job is to transform Yarn v1 SYML into YAML and then read it into memory. This operation is rather expensive so turbo will cache this transformation in node_modules/.cache/turbo/[:hash]-turbo-lock.yaml. In order to ship v1.0 for launch, we hacked around this bug by adding isWin() throughout the codebase to avoid this. These should be removed when fixing this bug.

Expected Behavior

Lockfile marshalling should be the same across OS / Arch

To Reproduce

  • Use turbo on win32 or win64 with yarn and see that its hashes will be different than those on darwin and linux with yarn.
  • Or, ... remove isWin() booleans in the codebase, build from source, run on a windows machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: windowsIssues specifically reproducing on Windowsgood first issueGood for newcomerskind: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions