Repository navigation
Print forward-slash paths in error messages on Windows #7377
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Print paths with forward slashes in bundle and `fs` error messages on Windows. ([#7377](https://github.com/databricks/cli/pull/7377)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1 @@ | ||
| Cloud = false | ||
|
|
||
| [[Repls]] | ||
| # Fix path with reverse slashes in the output for Windows. | ||
| Old = 'TEST_TMP_DIR]\\(app-[a-z-]+)' | ||
| New = 'TEST_TMP_DIR]/${1}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1 @@ | ||
| Cloud = false | ||
|
|
||
| [[Repls]] | ||
| # Fix path with reverse slashes in the output for Windows. | ||
| Old = 'TEST_TMP_DIR]\\(app-[a-z-]+)' | ||
| New = 'TEST_TMP_DIR]/${1}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,3 @@ RecordRequests = false | |
| [[Repls]] | ||
| Old = '\\\\' | ||
| New = '/' | ||
|
|
||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,3 @@ RecordRequests = false | |
| [[Repls]] | ||
| Old = '\\\\' | ||
| New = '/' | ||
|
|
||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1 @@ | ||
| RecordRequests = false | ||
|
|
||
| [[Repls]] | ||
| Old = '\\\\' | ||
| New = '/' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1 @@ | ||
| RecordRequests = false | ||
|
|
||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| Env.MSYS_NO_PATHCONV = "1" | ||
|
|
||
| [[Repls]] | ||
| Old = '\\\\' | ||
| New = '/' | ||
|
|
||
| [[Repls]] | ||
| Old = "[0-9a-f]{32}" | ||
| New = "[GENIE_SPACE_ID]" |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,2 @@ | ||
| CloudSlow = true | ||
| # serverless is only enabled if UC is enabled | ||
|
|
||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,3 @@ | ||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' | ||
|
|
||
| [[Repls]] | ||
| Old = '/world-[0-9]+' | ||
| New = '/world-123456' | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1 @@ | ||
| Badness = "Relative paths in variable-overrides.json resolve inconsistently: task files are resolved against the bundle root (with an error), libraries relative to the overrides file." | ||
|
|
||
| [[Repls]] | ||
| Old = '\\' | ||
| New = '/' |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1 @@ | ||
| Cloud = true | ||
|
|
||
| # Local paths in errors use the OS separator. | ||
| [[Repls]] | ||
| Old = 'local\\nonexistent\\mydir' | ||
| New = 'local/nonexistent/mydir' |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: ToSlash in filer Error() also rewrites remote paths on Windows
Error()of the seven filer error types now runsfilepath.ToSlashonerr.path. These types are shared with the DBFS, Files API and workspace filers, whose paths are POSIX strings built withpath.Join; there a\is an ordinary character, not a separator.On Windows, a remote path that contains a backslash is now printed with
/instead, so the message names a different path from the one sent to the API. Example: a Windows user typesdatabricks fs ls dbfs:\Volumes\mainand the API reports the path as missing. The error used to readno such directory: /\Volumes\main, which showed the mistake. It now readsno such directory: //Volumes/main, which looks like a valid path that does not exist.Only local paths need converting. Apply
filepath.ToSlashwherelibs/filer/local_client.gobuilds these errors and leave theError()methods as they were.Evidence:
libs/filer/errors.go:15,34,45,59,73,88,119wraperr.pathunconditionally. Remote construction sites pass POSIX paths, e.g.libs/filer/dbfs_client.go:244(absPath, err := w.root.Join(name)) and:259(noSuchDirectoryError{absPath}), withJoinimplemented aspath.Join(p.rootPath, name)atlibs/filer/workspace_root_path.go:26.cmd/fs/helpers.go:38-49passes everything afterdbfs:to the remote filer unchanged. Local construction sites are only inlibs/filer/local_client.go:61,63,90,96,121,128,143,149,172.Agreed by 2 reviewer model(s).