Skip to content

Fix OS condition#5802

Open
jaredpar wants to merge 1 commit intoAzure:mainfrom
jaredpar:fix-linux-build
Open

Fix OS condition#5802
jaredpar wants to merge 1 commit intoAzure:mainfrom
jaredpar:fix-linux-build

Conversation

@jaredpar
Copy link
Copy Markdown

The $(OS) property on Linux machines is Unix not Linux. This was causing builds to fail on Linux. Flipped to making it a positive check for Windows since it looks like none of this should fire for non-Windows.

Pull Request Template

Description

Please include a summary of the change and which issue is fixed. Include samples if adding new API, and include relevant motivation and context. List any dependencies that are required for this change.

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

The `$(OS)` property on Linux machines is `Unix` not `Linux`. This was causing builds to fail on Linux. Flipped to making it a positive check for Windows since it looks like none of this should fire for non-Windows.
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
2 pipeline(s) require an authorized user to comment /azp run to run.

</ItemGroup>

<ItemGroup Condition="$(OS) != 'Linux' AND '$(ProjectRef)' != 'True' ">
<ItemGroup Condition="$(OS) == 'Windows_NT' AND '$(ProjectRef)' != 'True' ">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This means that this will no longer run on macOS, right? I think that's correct, but want to call it out explicitly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Correct. That seemed to be the intent here. Also MSBuild doesn't have a great way to differentiate between Linux and MacOS. The $(OS) value for both is "Unix". Can differentiate but you have to use a different type of condition

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since the original intent was not honored and so-far not know of any broken/impact. How about remove condition it-self?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, @jaredpar was trying to build on Linux and it didn't work, right? So presumably something about that doesn't work on Linux?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/usr/lib/dotnet/sdk/10.0.106/Microsoft.Common.CurrentVersion.targets(5381,5): error MSB3030: Could not copy the file "/home/kirankk/.nuget/packages/Microsoft.HybridRow/1.1.0-preview3/microsoft.hybridrow.nuspec" because it was not found.

Yup. lets take this PR then.

Copy link
Copy Markdown
Member

@kirankumarkolli kirankumarkolli Apr 23, 2026

Choose a reason for hiding this comment

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

Seems this was primarily driven through the yml files where its set.
One option might be <ItemGroup Condition="$(TargetFramework.Contains('windows'))"> (for build time?)

Copy link
Copy Markdown
Member

@kirankumarkolli kirankumarkolli Apr 23, 2026

Choose a reason for hiding this comment

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

WSL varified that it works

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah I was trying to review the other PR and I didn't quite understand how the build laid out files such that the targets could actually work. Opened up the repo in codespaces to play around and the build failed. The fix was essentially just changing the condition after which build worked fine.

@Pilchie
Copy link
Copy Markdown
Member

Pilchie commented Apr 22, 2026

@kirankumarkolli - can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants