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 libs.tests subset build on tizen arm64 #63128

Closed
wants to merge 1 commit into from

Conversation

am11
Copy link
Member

@am11 am11 commented Dec 25, 2021

In our cross-build setup, we use different heuristics to identify the
target platform first for ourselves, to be then able to set "toolchain
file" settings
(CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_PROCESSOR etc.).
Sometimes it is a file that is known to exist in platform's
sysroot directory pointed by ROOTFS_DIR (FreeBSD and illumos),
and for Tizen and Android it is __DistroRid environment variable which
is used for detection. This environment variable is correctly set only during the
non-portable build of Tizen (for portable builds, it is set to linux-x64).

In NativeExport.csproj, we call toolchain.cmake via
output-toolchain-info.cmake using Exec task to prepare native
compiler and linker arguments for DNNE project. It is invoked in script
mode where cmake engine does not initialize its built-in modules. For
the handful of build-in modules that we use in toolchain.cmake, we
have custom macros in output-toolchain-info.cmake.

Tizen build was broken because a) __DistroRid was not propagated in
the Exec task, b) we were missing custom macro for
include_directories.

This delta addresses the issue a) by unifying how different platforms
are detected in toolchain file and forgoes reliance of __DistroRid
which is an archiac concept when non-portable builds were the only
option, and issue b) by defining include_directories macro.

Fixes #63122

In our cross-build setup, we use different heuristics to identify the
target platform first for ourselves, to be then able to set "toolchain
file" settings. Sometimes it is a file that is known to exist in
platform's sysroot directory pointed by `ROOTFS_DIR` (FreeBSD and
illumos), and for Tizen and Android it is `__DistroRid` environment
variable which is used for detection. This environment variable is set
only during the non-portable build.

In NativeExport.csproj, we call toolchain.cmake via
`output-toolchain-info.cmake` using `Exec` task to prepare native
compiler and linker arguments for DNNE project. It is invoked in script
mode where cmake engine does not initialize its built-in modules. For
the handful of build-in modules that we use in `toolchain.cmake`, we
have custom macros in `output-toolchain-info.cmake`.

Tizen build was broken because a) `__DistroRid` was not propagated in
the `Exec` task, b) we were missing custom macro for
`include_directories`.

This delta addresses the issue a) by unifying how different platforms
are detected in toolchain file and forgoes reliance of `__DistroRid`
which is an archiac concept when non-portable builds were the only
option, and issue b) by defining `include_directores` macro.
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 25, 2021
@ghost
Copy link

ghost commented Dec 25, 2021

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

Issue Details

In our cross-build setup, we use different heuristics to identify the
target platform first for ourselves, to be then able to set "toolchain
file" settings
(CMAKE_SYSTEM_NAME, CMAKE_SYSTEM_PROCESSOR etc.).
Sometimes it is a file that is known to exist in platform's
sysroot directory pointed by ROOTFS_DIR (FreeBSD and illumos),
and for Tizen and Android it is __DistroRid environment variable which
is used for detection. This environment variable is set only during the
non-portable build.

In NativeExport.csproj, we call toolchain.cmake via
output-toolchain-info.cmake using Exec task to prepare native
compiler and linker arguments for DNNE project. It is invoked in script
mode where cmake engine does not initialize its built-in modules. For
the handful of build-in modules that we use in toolchain.cmake, we
have custom macros in output-toolchain-info.cmake.

Tizen build was broken because a) __DistroRid was not propagated in
the Exec task, b) we were missing custom macro for
include_directories.

This delta addresses the issue a) by unifying how different platforms
are detected in toolchain file and forgoes reliance of __DistroRid
which is an archiac concept when non-portable builds were the only
option, and issue b) by defining include_directores macro.

Fixes #63122

Author: am11
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

Copy link
Member

@gbalykov gbalykov left a comment

Choose a reason for hiding this comment

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

This worked for me too, thanks!

@jkotas
Copy link
Member

jkotas commented Dec 25, 2021

Merged as 4c83c3b . github did not close the PR for some reason.

@jkotas jkotas closed this Dec 25, 2021
oldzhu pushed a commit to oldzhu/runtime that referenced this pull request Dec 26, 2021
In our cross-build setup, we use different heuristics to identify the
target platform first for ourselves, to be then able to set "toolchain
file" settings. Sometimes it is a file that is known to exist in
platform's sysroot directory pointed by `ROOTFS_DIR` (FreeBSD and
illumos), and for Tizen and Android it is `__DistroRid` environment
variable which is used for detection. This environment variable is set
only during the non-portable build.

In NativeExport.csproj, we call toolchain.cmake via
`output-toolchain-info.cmake` using `Exec` task to prepare native
compiler and linker arguments for DNNE project. It is invoked in script
mode where cmake engine does not initialize its built-in modules. For
the handful of build-in modules that we use in `toolchain.cmake`, we
have custom macros in `output-toolchain-info.cmake`.

Tizen build was broken because a) `__DistroRid` was not propagated in
the `Exec` task, b) we were missing custom macro for
`include_directories`.

This delta addresses the issue a) by unifying how different platforms
are detected in toolchain file and forgoes reliance of `__DistroRid`
which is an archiac concept when non-portable builds were the only
option, and issue b) by defining `include_directores` macro.
@am11 am11 deleted the feature/build/tizen-arm64 branch December 26, 2021 06:36
@ghost ghost locked as resolved and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-libraries 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.

Libraries tests 7.0 (master) cross build failed for tizen arm64
4 participants