Skip to content

Parse compiler version in init-compiler.sh #63126

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

Merged
merged 1 commit into from
Dec 26, 2021

Conversation

am11
Copy link
Member

@am11 am11 commented Dec 24, 2021

When user passes versioned native compiler argument such as
-clang10.1 or -gcc9.2 to the top-level :/build.sh,
:/eng/build.sh transforms that to msbuild property called
<Compiler> with raw/unprocessed value.

In coreclr, libs, corehost and tests partitions, we end up calling
:/eng/native/build-commons.sh, which slices the compiler name, major
and minor versions, then calls :/eng/native/gen-buildsys.sh with
individual components. That is just a pass-thru script for the final
:/eng/common/native/init-compiler.sh, where those arguments are
actually used.

In mono.proj and NativeExports.csproj, we do not use
build-commons script, but instead, invoke init-compiler.sh directly
with the raw <Compiler> property. That causes an error when versioned
native compiler is specified on the command line.

This PR fixes the issue by pushing version parsing code into
init-compiler.sh so all its consumers get the same behavior.

Contributes to #63122.

@ghost
Copy link

ghost commented Dec 24, 2021

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

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 24, 2021
@am11
Copy link
Member Author

am11 commented Dec 24, 2021

cc @gbalykov, @jkoritzinsky (still looking into the next tizen arm64 issue Gleb found with --cross, where wrong linker flags are being passed to DNNE; that'd likely be a separate PR)

@am11 am11 force-pushed the feature/native/build-configs branch from efd941f to 914319e Compare December 24, 2021 17:35
@am11 am11 requested a review from marek-safar as a code owner December 24, 2021 17:44
@am11 am11 force-pushed the feature/native/build-configs branch 2 times, most recently from 2dda175 to b21aa83 Compare December 24, 2021 18:58
When user passes versioned native compiler argument such as
`-clang10.1` or `-gcc9.2` to the top-level `:/build.sh`,
`:/eng/build.sh` transforms that to msbuild property called
`<Compiler>` with raw/unprocessed value.

In coreclr, libs, corehost and tests partitions, we end up calling
`:/eng/native/build-commons.sh`, which slices the compiler name, major
and minor versions, then calls `:/eng/native/gen-buildsys.sh` with
individual components. That is just a pass-thru script for the final
`:/eng/common/native/init-compiler.sh`, where those arguments are
actually used.

In `mono.proj` and `NativeExports.csproj`, we do not use
`build-commons` script, but instead, invoke `init-compiler.sh` directly
with the raw `<Compiler>` property. That causes an error when versioned
native compiler is specified on the command line.

This PR fixes this issue by pushing version parsing code into
`init-compiler.sh` so all its consumers get the same behavior.
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 works for me, thanks!

@jkotas jkotas merged commit a95cc4d into dotnet:main Dec 26, 2021
@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-Build-mono 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.

4 participants