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

fix runtime build failures on ppc64le #88145

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

Sapana-Khemkar
Copy link
Contributor

@Sapana-Khemkar Sapana-Khemkar commented Jun 28, 2023

Runtime build failing on ppc64le machine with below error

  CMake Error at /home/tester/runtime/src/native/external/libunwind_extras/CMakeLists.txt:169 (add_library):
    Cannot find source file:
  
      /home/tester/runtime/src/native/external/libunwind/src/ppc64/setcontext.S
  
    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
    .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc
  
  
  CMake Error at /home/tester/runtime/src/native/external/libunwind_extras/CMakeLists.txt:169 (add_library):
    No SOURCES given to target: libunwind
  
  
  CMake Generate step failed.  Build files cannot be regenerated correctly.
  ~/runtime/src/coreclr
  ~/runtime/artifacts/obj/coreclr/linux.ppc64le.Release ~/runtime/src/coreclr
  Executing make   iltools  -j 8
  make: *** No rule to make target 'iltools'.  Stop.
  ~/runtime/src/coreclr
  Failed to build "CoreCLR component".
/home/tester/runtime/src/coreclr/runtime.proj(89,5): error MSB3073: The command ""/home/tester/runtime/src/coreclr/build-runtime.sh" -ppc64le -release -portablebuild=false -keepnativesymbols -os linux -outputrid rhel.9-ppc64le -component iltools" exited with code 2.

Build FAILED.

This issue has been observed after PR 87426 merged.

Also I am wondering why upstream CI is not failing for ppc64le. Here is link for ppc64le CI.

cc:
@am11 @tmds @janani66

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jun 28, 2023
@ghost
Copy link

ghost commented Jun 28, 2023

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Runtime build failing on ppc64le machine with below error

  CMake Error at /home/tester/runtime/src/native/external/libunwind_extras/CMakeLists.txt:169 (add_library):
    Cannot find source file:
  
      /home/tester/runtime/src/native/external/libunwind/src/ppc64/setcontext.S
  
    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
    .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc
  
  
  CMake Error at /home/tester/runtime/src/native/external/libunwind_extras/CMakeLists.txt:169 (add_library):
    No SOURCES given to target: libunwind
  
  
  CMake Generate step failed.  Build files cannot be regenerated correctly.
  ~/runtime/src/coreclr
  ~/runtime/artifacts/obj/coreclr/linux.ppc64le.Release ~/runtime/src/coreclr
  Executing make   iltools  -j 8
  make: *** No rule to make target 'iltools'.  Stop.
  ~/runtime/src/coreclr
  Failed to build "CoreCLR component".
/home/tester/runtime/src/coreclr/runtime.proj(89,5): error MSB3073: The command ""/home/tester/runtime/src/coreclr/build-runtime.sh" -ppc64le -release -portablebuild=false -keepnativesymbols -os linux -outputrid rhel.9-ppc64le -component iltools" exited with code 2.

Build FAILED.

This issue has been observed after PR 87426 merged.

Author: Sapana-Khemkar
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@ghost
Copy link

ghost commented Jun 28, 2023

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Runtime build failing on ppc64le machine with below error

  CMake Error at /home/tester/runtime/src/native/external/libunwind_extras/CMakeLists.txt:169 (add_library):
    Cannot find source file:
  
      /home/tester/runtime/src/native/external/libunwind/src/ppc64/setcontext.S
  
    Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .h .hh .h++
    .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .ispc
  
  
  CMake Error at /home/tester/runtime/src/native/external/libunwind_extras/CMakeLists.txt:169 (add_library):
    No SOURCES given to target: libunwind
  
  
  CMake Generate step failed.  Build files cannot be regenerated correctly.
  ~/runtime/src/coreclr
  ~/runtime/artifacts/obj/coreclr/linux.ppc64le.Release ~/runtime/src/coreclr
  Executing make   iltools  -j 8
  make: *** No rule to make target 'iltools'.  Stop.
  ~/runtime/src/coreclr
  Failed to build "CoreCLR component".
/home/tester/runtime/src/coreclr/runtime.proj(89,5): error MSB3073: The command ""/home/tester/runtime/src/coreclr/build-runtime.sh" -ppc64le -release -portablebuild=false -keepnativesymbols -os linux -outputrid rhel.9-ppc64le -component iltools" exited with code 2.

Build FAILED.

This issue has been observed after PR 87426 merged.

Also I am wondering why upstream CI is not failing for ppc64le. Here is link for ppc64le CI.

cc:
@am11 @tmds @janani66

Author: Sapana-Khemkar
Assignees: -
Labels:

area-Infrastructure, community-contribution

Milestone: -

@steveisok
Copy link
Member

/cc @directhex

Copy link
Member

@am11 am11 left a comment

Choose a reason for hiding this comment

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

LGTM!

It seems like we are missing the clr.tools subset in the CI

buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true
, which is why it wasn't spotted earlier.

@am11
Copy link
Member

am11 commented Jun 28, 2023

Upstream change in v1.7.0 was libunwind/libunwind#450.

@tmds
Copy link
Member

tmds commented Jun 28, 2023

Upstream change in v1.7.0 was libunwind/libunwind#450.

How does libunwind.cmake get updated when we sync with upstream libunwind?

@am11
Copy link
Member

am11 commented Jun 28, 2023

We manually update {externalDepName}.cmake file when updating the dependencies under src/native/external. i.e. we don't use upstream build scripts.

@tmds
Copy link
Member

tmds commented Jun 28, 2023

We manually update {externalDepName}.cmake file when updating the dependencies under src/native/external

This PR removes ppc64/setcontext.S from

set(libunwind_la_SOURCES_ppc64le
${libunwind_la_SOURCES_ppc64le_common}
${libunwind_la_SOURCES_local}
ppc64/setcontext.S
ppc64/Lapply_reg_state.c ppc64/Lreg_states_iterate.c
ppc64/Lcreate_addr_space.c ppc/Lget_save_loc.c ppc64/Lglobal.c
ppc64/Linit.c ppc/Linit_local.c
ppc64/Lregs.c ppc64/Lresume.c
ppc/Lis_signal_frame.c ppc64/Lstep.c
)

to match with:

# The list of files that go into libunwind:
libunwind_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \
$(libunwind_la_SOURCES_local) \
$(libunwind_la_SOURCES_ppc) \
ppc64/Lapply_reg_state.c ppc64/Lreg_states_iterate.c \
ppc64/Lcreate_addr_space.c \
ppc64/Lglobal.c ppc64/Linit.c \
ppc64/Lregs.c ppc64/Lresume.c ppc64/Lstep.c

There are still other differences. Should we sync those too? (in a separate PR)

@am11
Copy link
Member

am11 commented Jun 28, 2023

There are still other differences. Should we sync those too? (in a separate PR)

Yes, maybe with the criteria "compile what runtime needs, and not everything possible". The Makefile typically builds the general purpose lib for distros. We only compile the subset.

(Slightly off-topic) get_proc_info_in_range was upstreamed in libunwind 1.7. We can now rework the fallback logic for FEATURE_USE_SYSTEM_LIBUNWIND which source-build is setting:

#ifndef FEATURE_USE_SYSTEM_LIBUNWIND
(e.g. dladdr() that symbols from system libunwind if it's there use that before selecting the fallback logic, which is slightly less efficient)

@jkoritzinsky
Copy link
Member

Would it help if we were able to use the libunwind build system directly instead of wrapping it in our own CMake logic? We can look at using some of the ExternalProject or FetchContent utilities (pointing to the local paths in the repo) to pull in vendored libs if that would make things easier.

@am11
Copy link
Member

am11 commented Jun 28, 2023

IIRC, the rationale to keep build scripts outside the vendor dirs was:

  1. we only build subset of external libs and this way, we are in control of what to compile for which target platform etc.
  2. consistency - some dependencies do not provide cmake scripts, others do.

Also, the cmake scripts in libunwind/libunwind repo is not exercised in the CI (only Windows build uses it: https://github.com/libunwind/libunwind/blob/7d505a2b9d8b0dd21c24c01ee420c0d00dda8214/.github/workflows/CI-win.yml#L39). So it will be an additional maintenance overhead for us.

@jkotas jkotas merged commit 52bc96d into dotnet:main Jun 28, 2023
@janani66
Copy link

LGTM!

It seems like we are missing the clr.tools subset in the CI

buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true

, which is why it wasn't spotted earlier.

@am11 will you be adding the clr.tools to the buildArgs for the CI?

directhex added a commit that referenced this pull request Jun 28, 2023
This will help us catch failures like #88145

CC @am11 @janani66
@ghost ghost locked as resolved and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-PAL-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants