Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[8.0][linux-s390x] Build failure in hostpolicy #112435

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

Closed
carlossanlop opened this issue Feb 11, 2025 · 9 comments
Closed

[8.0][linux-s390x] Build failure in hostpolicy #112435

carlossanlop opened this issue Feb 11, 2025 · 9 comments
Labels
arch-s390x Related to s390x architecture (unsupported) area-Host blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro)

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Feb 11, 2025

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=947568&view=logs&j=7ea23876-d932-5222-06a0-de72daa3cbf4
Build error leg or test failing: Build / linux-s390x Release AllSubsets_Mono / Build product
Pull request: #112381

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "hostpolicy.exports:1: syntax error clang-16: error: linker command failed with exit code 1",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}
  [ 98%] Building CXX object fxr/standalone/CMakeFiles/hostfxr.dir/__/__/hostmisc/pal.unix.cpp.o
  [ 99%] Linking CXX shared library libhostpolicy.so
  /usr/local/bin/s390x-linux-gnu-ld:/__w/1/s/artifacts/obj/linux-s390x.Release/hostpolicy/standalone/hostpolicy.exports: file format not recognized; treating as linker script
  /usr/local/bin/s390x-linux-gnu-ld:/__w/1/s/artifacts/obj/linux-s390x.Release/hostpolicy/standalone/hostpolicy.exports:1: syntax error
  clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
  make[2]: *** [hostpolicy/standalone/CMakeFiles/hostpolicy.dir/build.make:435: hostpolicy/standalone/libhostpolicy.so] Error 1
  make[1]: *** [CMakeFiles/Makefile2:484: hostpolicy/standalone/CMakeFiles/hostpolicy.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....
  [100%] Linking CXX shared library libhostfxr.so
  /usr/local/bin/s390x-linux-gnu-ld:/__w/1/s/artifacts/obj/linux-s390x.Release/fxr/standalone/hostfxr.exports: file format not recognized; treating as linker script
  /usr/local/bin/s390x-linux-gnu-ld:/__w/1/s/artifacts/obj/linux-s390x.Release/fxr/standalone/hostfxr.exports:1: syntax error
  clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
  make[2]: *** [fxr/standalone/CMakeFiles/hostfxr.dir/build.make:355: fxr/standalone/libhostfxr.so] Error 1
  make[1]: *** [CMakeFiles/Makefile2:405: fxr/standalone/CMakeFiles/hostfxr.dir/all] Error 2
  make: *** [Makefile:136: all] Error 2
/__w/1/s/src/native/corehost/corehost.proj(99,5): error MSB3073: The command ""/__w/1/s/src/native/corehost/build.sh" Release s390x -commithash "f6dd20266feb0ced390b11b8d2fbbc6a48f56df7" -os linux -cmakeargs "-DVERSION_FILE_PATH=/__w/1/s/artifacts/obj/_version.c" -cross -runtimeflavor Mono -outputrid linux-s390x" exited with code 2.

Known issue validation

Build: πŸ”Ž https://dev.azure.com/dnceng-public/public/_build/results?buildId=947568
Error message validated: [hostpolicy.exports:1: syntax error clang-16: error: linker command failed with exit code 1]
Result validation: ❌ Known issue did not match with the provided build.
Validation performed at: 2/11/2025 6:12:29 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
@carlossanlop carlossanlop added arch-s390x Related to s390x architecture (unsupported) blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro) labels Feb 11, 2025
@ghost ghost added the area-Host label Feb 11, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 11, 2025
Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@elinor-fung
Copy link
Member

elinor-fung commented Feb 11, 2025

cc @uweigand in case you've seen this or have an idea here.

The .exports files get generated via a script:

function(generate_exports_file)
set(INPUT_LIST ${ARGN})
list(GET INPUT_LIST -1 outputFilename)
list(REMOVE_AT INPUT_LIST -1)
if(CLR_CMAKE_TARGET_APPLE)
set(SCRIPT_NAME generateexportedsymbols.sh)
else()
set(SCRIPT_NAME generateversionscript.sh)
endif()
add_custom_command(
OUTPUT ${outputFilename}
COMMAND ${CLR_ENG_NATIVE_DIR}/${SCRIPT_NAME} ${INPUT_LIST} >${outputFilename}
DEPENDS ${INPUT_LIST} ${CLR_ENG_NATIVE_DIR}/${SCRIPT_NAME}
COMMENT "Generating exports file ${outputFilename}"
)
set_source_files_properties(${outputFilename}
PROPERTIES GENERATED TRUE)
endfunction()

And then added to the linker options:

function(set_exports_linker_option exports_filename)
if(LD_GNU OR LD_SOLARIS OR LD_LLVM)
# Add linker exports file option
if(LD_SOLARIS)
set(EXPORTS_LINKER_OPTION -Wl,-M,${exports_filename} PARENT_SCOPE)
else()
set(EXPORTS_LINKER_OPTION -Wl,--version-script=${exports_filename} PARENT_SCOPE)
endif()
elseif(LD_OSX)
# Add linker exports file option
set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${exports_filename} PARENT_SCOPE)
endif()
endfunction()

@uweigand
Copy link
Contributor

Hi @elinor-fung , I just tried to reproduce the issue (at current release/8.0 commit 98d641585d21c6b7a89f4aa39c6d9f8a3586f5f3), and it seems to work fine for me. The hostpolicy.exports file generated during this build looks like this:

V1.0 {
    global:
        corehost_initialize;
        corehost_load;
        corehost_main;
        corehost_main_with_output_buffer;
        corehost_resolve_component_dependencies;
        corehost_set_error_writer;
        corehost_unload;
    local: *;
};

which does look fine to me.

I'm wondering: can you get the copy of that file from the failed build? This failure happened during the cross-compile on x86, so these should be all Microsoft machines. Would be interesting to see whether the problem is that the file was incorrectly generated somehow, or else the problem is that the cross-linker installed on those machines somehow does not accept a valid file.

@elinor-fung
Copy link
Member

Thanks for taking a look.

Would be interesting to see whether the problem is that the file was incorrectly generated somehow, or else the problem is that the cross-linker installed on those machines somehow does not accept a valid file.

@akoeplinger indicated that this may be related to an update to the images being used #112381 (comment)

can you get the copy of that file from the failed build?

@akoeplinger / @carlossanlop Do you know if we have those intermediates stored somewhere or would we need to make the pipelines upload them? I didn't see anything in the artifacts. Or, what would be the best way to try to repro this, since it seems specific to how the CI builds are set up?

@akoeplinger
Copy link
Member

@elinor-fung @uweigand the hostpolicy.exports file looks identical to the one you posted.

The easiest way to reproduce the failure locally is via docker:

$ docker run -it mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-s390x bash

git clone --branch release/8.0 --depth 1 https://github.com/dotnet/runtime runtime-repo
cd runtime-repo
export ROOTFS_DIR=/crossrootfs/s390x
./build.sh -arch s390x -os linux -cross -s host

@akoeplinger
Copy link
Member

ah, just found that we already solved this: #94355 πŸ˜„

@akoeplinger
Copy link
Member

ok that fixed it:

Build succeeded.
    0 Warning(s)
    0 Error(s)

will backport the arcade fix

akoeplinger pushed a commit to dotnet/arcade that referenced this issue Feb 20, 2025
This is necessary to unbreak the s390x build after the move to the azurelinux-3.0 images: dotnet/runtime#112435

Co-authored-by: Adeel Mujahid <[email protected]>
@uweigand
Copy link
Contributor

Excellent, thanks! I notice that this refers to the problem that LLD is not available for s390x - that is actually no longer the case. As of LLVM 18, we do have LLD support now as well. So whenever you've upgraded your build environment to at least that release, any special-casing of LLD s390x support should no longer be necessary.

@akoeplinger
Copy link
Member

Yep I think we already have that handled in https://github.com/dotnet/arcade/blob/ecdb2f499cb5f5c99b58fba1a14fdf977c56e1ac/eng/common/native/init-compiler.sh#L136-L140

I'll close this issue now that the fix is in arcade, it'll flow to runtime with #112504

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Feb 21, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-s390x Related to s390x architecture (unsupported) area-Host blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro)
Projects
Archived in project
Development

No branches or pull requests

4 participants