-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Revert #17398 and #17402 #18480
Revert #17398 and #17402 #18480
Conversation
…not have trailing DirSep (nim-lang#17402)" This reverts commit 2356d06.
…ude trailing `/` (nim-lang#17398)" This reverts commit bebf2ce.
If someone really relies on broken behaviours and not asserting its inputs, template getHomeDirShim*(): string =
let s = getHomeDir()
if s[^1] == '/': s else: s & '/' |
or, using |
Wouldn't it be better to create a version-1p6 branch and undo all the breaking commits there? I thought devel was targeting the latest and greatest future Nim version. |
We're considering it. |
this is would be much better than reverting these commit, likewise with other reverts that are currently pending and other similar reverts that were made in 1.5; but we don't even need to undo those commits in that branch and in fact it's better not to as it allows gradual migration, see #18486 |
else: result = getEnv("HOME") | ||
result.normalizePathEnd(trailingSep = defined(nimLegacyHomeDir)) | ||
when defined(windows): return getEnv("USERPROFILE") & "\\" | ||
else: return getEnv("HOME") & "/" |
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.
So previously the code used a trailing dir on purpose. Calling this a "bugfix" then is a bit of stretch...
And why is it suddenly "bad code"? It used to work and could continue to work... |
See #18513 (
because it was inconsistent both with all other languages and all other APIs in nim that return a dir, see long list here: #17393 (comment), consistency is still a thing. |
But now it's not consistent with its own previous behavior anymore... Great consistency here. |
* Revert "followup nim-lang#17398: `getTempDir`, `getConfigDir` now do not have trailing DirSep (nim-lang#17402)" This reverts commit 2356d06. * Revert "fix nim-lang#17393 getHomeDir and expandTilde should not include trailing `/` (nim-lang#17398)" This reverts commit bebf2ce. * fix test
Another breaking change which shouldn't be part of Nim 1.6