Skip to content

gel on Windows calculates path sha different than libraries #1742

@nerdoza

Description

@nerdoza
  • Gel Version: 6.11+66a1377
  • Gel CLI Version: 7.10.0-dev.1463+ff1bd8d
  • OS Version: Windows 11

Steps to Reproduce:

  1. Run gel project init in a project on Windows and the project will be initialized and a new gel.toml created, along with a corresponding [project-name]-[path-hash] directory in C:\Users\USER\AppData\Local\EdgeDB\config\projects.
  2. Run any code using a gel library and the first database call will fail with a project is not initialized error.

Analysis:

The CLI, as of 482062b, is using dunce::canonicalize to generate the project path, which returns a path something like C:\Users\Zach\Dev\kaweah-tech\ff.app which generates a hash of be8268f00bfb7a7d249da0854ac91729624fdbf2. The project code appends a prefix of \\?\ to the path so it uses \\?\C:\Users\Zach\Dev\kaweah-tech\ff.app to generate a hash of f660887260d84cf3ecb590335ddff78600bbbad1. The end result is that the project code is looking for a config file ff.app-f660887260d84cf3ecb590335ddff78600bbbad1 which doesn't exist because the CLI created the config at ff.app-be8268f00bfb7a7d249da0854ac91729624fdbf2.

I believe this is an issue with all the libraries based on this search, so I suspect the fix needs to be made in the gel-cli project to reduce the amount of potential turbulence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions