netcoredbg icon indicating copy to clipboard operation
netcoredbg copied to clipboard

Invalid CoreCLR directory path in CMakeFile

Open giritrivedi opened this issue 1 year ago • 8 comments

Hello, In CMakeList.txt of netcoredbg below code looks to be incorrect, set(CORECLR_SRC_DIR "${CORECLR_DIR}/src")

What should be the correct path to be set to CORECLR_DIR ?

giritrivedi avatar Dec 10 '24 12:12 giritrivedi

Do you have some build issues? CORECLR_SRC_DIR takes in account both older coreclr repo (https://github.com/dotnet/coreclr before merge in https://github.com/dotnet/runtime, e.g. .Net Core 3.1), as well as new runtime repo.

gbalykov avatar Dec 10 '24 12:12 gbalykov

yes.. If above repo paths are given, it will throw an error if /dotnet/runtime repo is given and the condition below will fail

# Basic checks for valid paths
if (NOT IS_DIRECTORY "${CORECLR_SRC_DIR}/pal")
    message(FATAL_ERROR "Invalid CoreCLR source directory")
endif()

as /dotnet/runtime/pal is invalid here. Pal directory is located at /dotnet/runtime/src/coreclr/pal , Hence I had to pass /dotnet/runtime/src/coreclr directory path.

giritrivedi avatar Dec 15 '24 13:12 giritrivedi

Hence I think, The code needs to be changed from set(CORECLR_SRC_DIR "${CORECLR_DIR}/src") to set(CORECLR_SRC_DIR "${CORECLR_DIR}") and Proper path of CORECLR_DIR should be passed as /dotnet/runtime/src/coreclr

giritrivedi avatar Dec 15 '24 13:12 giritrivedi

Let me know if its proper to provide the fix, i will submit.

giritrivedi avatar Dec 15 '24 13:12 giritrivedi

The code needs to be changed from set(CORECLR_SRC_DIR "${CORECLR_DIR}/src") to set(CORECLR_SRC_DIR "${CORECLR_DIR}")

In this case you broke build with previous CoreCLR versions. In case you want provide changes, please, make sure it will work for all CoreCLR sources since version 3.1.

viewizard avatar Dec 15 '24 13:12 viewizard

Hence I had to pass /dotnet/runtime/src/coreclr directory path.

This is intentional behavior, CORECLR_SRC_DIR variable represents dir of CoreCLR, and runtime repo contains other stuff too. Path to CoreCLR is passed right now to support build with new and old repos. You can propose some change that will support passing dotnet/runtime, but this change should not break build with older repo.

gbalykov avatar Dec 15 '24 14:12 gbalykov

Thanks. Microsoft is no more using https://github.com/dotnet/coreclr repo. Active development is happening in https://github.com/dotnet/runtime. I Suppose we should be using this going further.

giritrivedi avatar Dec 16 '24 07:12 giritrivedi

For this time we support build starts from CoreCLR 3.1, since it still used in old, but still supported by Samsung versions of Tizen OS, that don't provide other source packages of CoreCLR for debugger build. This mean, netcoredbg build must support CoreCLR versions 3.1, 6.0, 8.0, ... (usually LTS + current release versions) in order to support all actively supported Tizen OS versions.

viewizard avatar Dec 16 '24 08:12 viewizard