Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
kswiecicki committed Aug 27, 2024
1 parent 01c084e commit a2c74f7
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,53 @@ jobs:
- name: Build all
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS

- name: Dump binary dependents
- name: Show contents of bin directory
working-directory: ${{github.workspace}}/build
run: ls ./bin/${{matrix.build_type}}/

- name: Show contents of lib directory
working-directory: ${{github.workspace}}/build
run: ls ./lib/${{matrix.build_type}}/

- name: Show contents of PATH env var
run: $Env:PATH

- name: Append build bin and lib dir to PATH env
run: $env:PATH = "${{github.workspace}}/build/bin/${{matrix.build_type}};${{github.workspace}}/build/lib/${{matrix.build_type}};$env:PATH"

- name: Check system32 dir
run: ls "C:\Windows\System32\"

- name: Check VC tools dir
run: ls "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\"

- name: Check VC redist libs dir1
run: ls "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.40.33807\debug_nonredist\x64\"

- name: Check VC redist libs dir2
run: ls "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.40.33807\debug_nonredist\x64\Microsoft.VC143.DebugCRT"

- name: Check Windows Kits dir
run: ls "C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.UniversalCRT.Debug\"

- name: Show contents of PATH env var again
run: $Env:PATH

- name: Dumpbin hello_world.exe output
working-directory: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/"
run: ./dumpbin.exe /DEPENDENTS ${{github.workspace}}/build/bin/${{matrix.build_type}}/hello_world.exe

- name: Dumpbin ur_loader.dll output
working-directory: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/"
run: ./dumpbin.exe /DEPENDENTS ${{github.workspace}}/build/bin/${{matrix.build_type}}/ur_loader.dll

- name: Run single failing test example-hello-world
working-directory: ${{github.workspace}}/build
run: ctest -R "example-hello" -C ${{matrix.build_type}} --verbose

- name: Test
working-directory: ${{github.workspace}}/build
run: $Env:UR_LOG_LEVEL_ZERO="level:info;output:stdout"; $Env:UR_LOG_LOADER="level:info;output:stdout"; ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace" --verbose
run: $Env:ZEL_ENABLE_LOADER_LOGGING=1; $Env:ZEL_LOADER_LOGGING_LEVEL="info"; $Env:ZE_ENABLE_LOADER_DEBUG_TRACE=1; $Env:UR_LOG_LEVEL_ZERO="level:info;output:stdout"; $Env:UR_LOG_LOADER="level:info;output:stdout"; ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace" --verbose

# macos-build:
# name: Build - MacOS
Expand Down
1 change: 1 addition & 0 deletions examples/hello_world/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if(MSVC)
VS_DEBUGGER_COMMAND_ARGUMENTS ""
VS_DEBUGGER_WORKING_DIRECTORY "$(OutDir)"
)
set_target_properties (${NAME} PROPERTIES PREFIX "../")
endif()

target_link_libraries(${TARGET_NAME} PRIVATE
Expand Down
5 changes: 2 additions & 3 deletions source/common/windows/ur_lib_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) {

std::unique_ptr<HMODULE, LibLoader::lib_dtor>
LibLoader::loadAdapterLibrary(const char *name) {
logger::info(
"Trying to load a library from {}",
name);
logger::info("Trying to load a library from {}", name);
auto handle = std::unique_ptr<HMODULE, LibLoader::lib_dtor>(
LoadLibraryExA(name, nullptr, 0));
logger::info("loaded adapter 0x{} ({})", handle, name);
return handle;
}

void *LibLoader::getFunctionPtr(HMODULE handle, const char *func_name) {
logger::info("Getting function ptr for {}", func_name);
return reinterpret_cast<void *>(GetProcAddress(handle, func_name));
}

Expand Down
2 changes: 1 addition & 1 deletion source/loader/windows/adapter_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ur_loader {
std::optional<fs::path> getLoaderLibPath() {
HMODULE hModule = NULL;
char pathStr[MAX_PATH_LEN_WIN];

logger::info("Getting loader library path!");
if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPCSTR>(&getLoaderLibPath),
Expand Down

0 comments on commit a2c74f7

Please sign in to comment.