Skip to content
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

Switch to v5 UUIDs as profile GUIDs for the default profiles #913

Merged
merged 9 commits into from
May 21, 2019

Conversation

DHowett-MSFT
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT commented May 21, 2019

Summary of the Pull Request

This pull request switches the GUIDs for default profiles from being randomly generated to being version 5 UUIDs. More info in #870.

PR Checklist

Detailed Description of the Pull Request / Additional comments

This pull request has a number of changes that seem ancillary, but they're general goodness. Let me explain:

  • I've added a whole new Types test library with only two tests in
  • Since UUIDv5 generation requires SHA1, we needed to take a dependency on bcrypt
  • I honestly don't think we should have to link bcrypt in conhost, but LTO should take care of that
    • I considered adding a new Terminal-specific Utils/Types library, but that seemed like a waste
  • The best way to link bcrypt turned out to be in line with a discussion @miniksa and I had, where we decided we both love APISets and think that the console should link against them exclusively... so I've added onecore_apiset.lib to the front of the link line, where it will deflect the linker away from most of the other libs automagically.
StartGroup: UuidTests::TestV5UuidU8String
Verify: AreEqual(uuidExpected, uuidActual)
EndGroup: UuidTests::TestV5UuidU8String [Passed]

StartGroup: UuidTests::TestV5UuidU16String
Verify: AreEqual(uuidExpected, uuidActual)
EndGroup: UuidTests::TestV5UuidU16String [Passed]

@DHowett-MSFT DHowett-MSFT added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. labels May 21, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal v0.2 milestone May 21, 2019
@DHowett-MSFT
Copy link
Contributor Author

@miniksa Bad news! The exe.or.dll.props props are included before VS's default library dependencies, so unless we restructure the include ordering for these things they end up searching the libraries in the wrong order.

if we fix that:

> depends openconsole.exe
=== C:\Users\Dustin\Projects\thirdparty\OpenConsole-master\bin\x64\Debug\openconsole.exe ===

  Dependencies:
    api-ms-win-core-com-l1-1-0
    api-ms-win-core-debug-l1-1-0
    api-ms-win-core-errorhandling-l1-1-0
    api-ms-win-core-file-l1-1-0
    api-ms-win-core-handle-l1-1-0
    api-ms-win-core-heap-l1-1-0
    api-ms-win-core-heap-l2-1-0
    api-ms-win-core-interlocked-l1-1-0
    api-ms-win-core-io-l1-1-0
    api-ms-win-core-largeinteger-l1-1-0
    api-ms-win-core-libraryloader-l1-2-0
    api-ms-win-core-libraryloader-l1-2-1
    api-ms-win-core-localization-l1-2-0
    api-ms-win-core-memory-l1-1-0
    api-ms-win-core-path-l1-1-0
    api-ms-win-core-processenvironment-l1-1-0
    api-ms-win-core-processthreads-l1-1-0
    api-ms-win-core-processthreads-l1-1-1
    api-ms-win-core-profile-l1-1-0
    api-ms-win-core-psapi-l1-1-0
    api-ms-win-core-registry-l1-1-0
    api-ms-win-core-registry-l1-1-1
    api-ms-win-core-registry-l2-1-0
    api-ms-win-core-rtlsupport-l1-1-0
    api-ms-win-core-sidebyside-l1-1-0
    api-ms-win-core-string-l1-1-0
    api-ms-win-core-synch-l1-1-0
    api-ms-win-core-synch-l1-2-0
    api-ms-win-core-sysinfo-l1-1-0
    api-ms-win-core-threadpool-legacy-l1-1-0
    api-ms-win-core-util-l1-1-0
    api-ms-win-eventing-provider-l1-1-0
    api-ms-win-shcore-obsolete-l1-1-0
    api-ms-win-shcore-scaling-l1-1-1
    bcrypt.dll
    d2d1.dll
    d3d11.dll
    dwmapi.dll
    dwrite.dll
    dxgi.dll
    gdi32.dll
    msvcp140d.dll
    ntdll.dll
    oleaut32.dll
    propsys.dll
    shell32.dll
    shlwapi.dll
    ucrtbased.dll
    uiautomationcore.dll
    user32.dll
    uxtheme.dll
    vcruntime140d.dll
    winmm.dll

src/types/ut/UuidTests.cpp Outdated Show resolved Hide resolved
src/types/ut/UuidTests.cpp Outdated Show resolved Hide resolved
src/types/utils.cpp Outdated Show resolved Hide resolved
src/types/utils.cpp Outdated Show resolved Hide resolved
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Other than the tests thing, looks good

src/cascadia/TerminalApp/CascadiaSettings.cpp Show resolved Hide resolved
OpenConsole.sln Outdated Show resolved Hide resolved
@DHowett-MSFT
Copy link
Contributor Author

@zadjii-msft you called types “dependency-free”, so I should feel less comfortable adding a dependency on bcrypt.lib from it. Even though it’s in OneCore... hrm

@zadjii-msft
Copy link
Member

@DHowett-MSFT when I say "dependency-free", I guess I meant more that it didn't have any other dependencies w/in our codebase. It was a bottom(?)-clean lib that could be used by any other lib without introducing a bunch of other dependencies. This is contrasted with the server lib, which is also fundamentally dependent upon the host lib

@miniksa
Copy link
Member

miniksa commented May 21, 2019

@miniksa Michael Niksa FTE Bad news! The exe.or.dll.props props are included before VS's default library dependencies, so unless we restructure the include ordering for these things they end up searching the libraries in the wrong order.

if we fix that:

> depends openconsole.exe
=== C:\Users\Dustin\Projects\thirdparty\OpenConsole-master\bin\x64\Debug\openconsole.exe ===

  Dependencies:
    api-ms-win-core-com-l1-1-0
    api-ms-win-core-debug-l1-1-0
    api-ms-win-core-errorhandling-l1-1-0
    api-ms-win-core-file-l1-1-0
    api-ms-win-core-handle-l1-1-0
    api-ms-win-core-heap-l1-1-0
    api-ms-win-core-heap-l2-1-0
    api-ms-win-core-interlocked-l1-1-0
    api-ms-win-core-io-l1-1-0
    api-ms-win-core-largeinteger-l1-1-0
    api-ms-win-core-libraryloader-l1-2-0
    api-ms-win-core-libraryloader-l1-2-1
    api-ms-win-core-localization-l1-2-0
    api-ms-win-core-memory-l1-1-0
    api-ms-win-core-path-l1-1-0
    api-ms-win-core-processenvironment-l1-1-0
    api-ms-win-core-processthreads-l1-1-0
    api-ms-win-core-processthreads-l1-1-1
    api-ms-win-core-profile-l1-1-0
    api-ms-win-core-psapi-l1-1-0
    api-ms-win-core-registry-l1-1-0
    api-ms-win-core-registry-l1-1-1
    api-ms-win-core-registry-l2-1-0
    api-ms-win-core-rtlsupport-l1-1-0
    api-ms-win-core-sidebyside-l1-1-0
    api-ms-win-core-string-l1-1-0
    api-ms-win-core-synch-l1-1-0
    api-ms-win-core-synch-l1-2-0
    api-ms-win-core-sysinfo-l1-1-0
    api-ms-win-core-threadpool-legacy-l1-1-0
    api-ms-win-core-util-l1-1-0
    api-ms-win-eventing-provider-l1-1-0
    api-ms-win-shcore-obsolete-l1-1-0
    api-ms-win-shcore-scaling-l1-1-1
    bcrypt.dll
    d2d1.dll
    d3d11.dll
    dwmapi.dll
    dwrite.dll
    dxgi.dll
    gdi32.dll
    msvcp140d.dll
    ntdll.dll
    oleaut32.dll
    propsys.dll
    shell32.dll
    shlwapi.dll
    ucrtbased.dll
    uiautomationcore.dll
    user32.dll
    uxtheme.dll
    vcruntime140d.dll
    winmm.dll

You can order them however is necessary to get linkage to work correctly. The only reason I might have said something like "the order is important here, watch yourself" in a comment near those is for the common-editing case (to scare folks away). Not for this case where we're actually trying to change the whole linking world.

@miniksa
Copy link
Member

miniksa commented May 21, 2019

@zadjii-msft Mike Griese FTE you called types “dependency-free”, so I should feel less comfortable adding a dependency on bcrypt.lib from it. Even though it’s in OneCore... hrm

@DHowett-MSFT Dustin Howett FTE when I say "dependency-free", I guess I meant more that it didn't have any other dependencies w/in our codebase. It was a bottom(?)-clean lib that could be used by any other lib without introducing a bunch of other dependencies. This is contrasted with the server lib, which is also fundamentally dependent upon the host lib

I am not concerned about external dependencies. Technically the whole types library has a CRT and STL dependency. It's more that our internal project-to-project layering should strive to be less garbage over time (per where @zadjii-msft was going with his comment.)

OpenConsole.sln Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/CascadiaSettings.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Profile.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Profile.cpp Outdated Show resolved Hide resolved
src/common.build.exe.or.dll.props Show resolved Hide resolved
src/types/ut/Types.Unit.Test.vcxproj Outdated Show resolved Hide resolved
src/types/utils.cpp Outdated Show resolved Hide resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 21, 2019
src/types/utils.cpp Outdated Show resolved Hide resolved
that was harrowing
src/types/dirs Outdated Show resolved Hide resolved
@DHowett-MSFT
Copy link
Contributor Author

Followups filed!

@DHowett-MSFT DHowett-MSFT merged commit 8da6737 into master May 21, 2019
@DHowett-MSFT DHowett-MSFT deleted the dev/duhowett/uuidv5 branch May 21, 2019 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: stable UUIDs for default profiles
7 participants