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

[mono]pack nuget packages with -cmakeargs orrcured error on windows. #76717

Open
srxqds opened this issue Oct 6, 2022 · 6 comments
Open

[mono]pack nuget packages with -cmakeargs orrcured error on windows. #76717

srxqds opened this issue Oct 6, 2022 · 6 comments
Assignees
Milestone

Comments

@srxqds
Copy link
Contributor

srxqds commented Oct 6, 2022

Description

when I build to generate package with -cmakeargs, it hit error:

./build.cmd -pack -runtimeFlavor mono /p:Deterministic=true -cmakeargs -DENABLE_OVERRIDABLE_ALLOCATORS=1 -c Release -v d

but it can build successful using:

./build.cmd mono+libs -c Release

./build.cmd -pack -runtimeFlavor mono /p:Deterministic=true -cmakeargs -DENABLE_OVERRIDABLE_ALLOCATORS=1

Reproduction Steps

./build.cmd -pack -runtimeFlavor mono /p:Deterministic=true -cmakeargs -DENABLE_OVERRIDABLE_ALLOCATORS=1 -c Release

Expected behavior

build success

Actual behavior

hit error.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 6, 2022
@srxqds
Copy link
Contributor Author

srxqds commented Oct 6, 2022

below is the log build with -pack and -cmakeargs
log.txt

found the problem is not fond zlib

Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.24/Modules/FindZLIB.cmake:166 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
F:/netease-gitlab/dotnet/runtime/src/native/libs/System.IO.Compression.Native/extra_libs.cmake:12 (find_package)
F:/netease-gitlab/dotnet/runtime/src/native/corehost/apphost/static/CMakeLists.txt:151 (append_extra_compression_libs)

and build_log.txt is the log using ./build.cmd mono+libs -c Release
build_log.txt

@srxqds srxqds changed the title build to generate nuget packages with -cmakeargs orrcured error. [mono]build to generate nuget packages with -cmakeargs orrcured error. Oct 6, 2022
@srxqds
Copy link
Contributor Author

srxqds commented Oct 6, 2022

@akoeplinger could you help me?

the problem is there are two cmake define pass with one -cmakeargs:

F:\netease-gitlab\dotnet\runtime\src\coreclr\runtime.proj(61,5): error MSB3073: The command ""F:\netease-gitlab\dotnet\runtime\src\coreclr\build-runtime.cmd" -x64 -cmakeargs "-DENABLE_OVERRIDABLE_ALLOCATORS=1 -DCLR_CROSS_COMPONENTS_BUILD=1" -release -os Linux -hostarch x64 -component crosscomponents" exited with code 1.

but I am not an expert in windows batch or msbuild script, so I can't fix it, hope you can take the time to fix it.

@srxqds srxqds changed the title [mono]build to generate nuget packages with -cmakeargs orrcured error. [mono]build to generate nuget packages with -cmakeargs orrcured error on windows. Oct 6, 2022
@srxqds

This comment was marked as off-topic.

@srxqds srxqds changed the title [mono]build to generate nuget packages with -cmakeargs orrcured error on windows. [mono]pack nuget packages with -cmakeargs orrcured error on windows. Oct 7, 2022
@akoeplinger
Copy link
Member

Hmm it looks like there's some issue with passing this to the coreclr build?
If you want to just experiment then you can add the define here instead:

<_MonoCMakeArgs Include="-DMONO_SHARED_LIB_NAME=$(MonoSharedLibName)" />

@srxqds
Copy link
Contributor Author

srxqds commented Oct 7, 2022

yeah, it can be fixed by adding define in CMakeList.txt or mono.proj file directly.
I think we the problem is introduced at this line:

set __ExtraCmakeArgs=!__ExtraCmakeArgs! "-DCLR_CMAKE_TARGET_ARCH=%__TargetArch%" "-DCLR_CMAKE_TARGET_OS=%__TargetOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" %__CMakeArgs%

we should append __ExtraCmakeArgs with "-DENABLE_OVERRIDABLE_ALLOCATORS=1" "-DCLR_CROSS_COMPONENTS_BUILD=1" instead of "-DENABLE_OVERRIDABLE_ALLOCATORS=1 -DCLR_CROSS_COMPONENTS_BUILD=1"

I have tryed but not work

@marek-safar marek-safar added this to the 9.0.0 milestone Jul 21, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 21, 2023
@lewing lewing assigned akoeplinger and unassigned directhex Jul 30, 2024
@lewing lewing modified the milestones: 9.0.0, 10.0.0 Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants