Skip to content

Build script (sh) does not correctly detect FreeBSD #47838

Closed
@Thefrank

Description

@Thefrank

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

aspnetcore/eng/build.sh

Lines 37 to 41 in d07f377

if [ "$(uname)" = "Darwin" ]; then
target_os_name='osx'
else
target_os_name='linux'
fi

The current version of eng/build.sh only checks for "Darwin" in uname's return and assumes "linux" otherwise. Under normal circumstances this is fine as building under FreeBSD we use --os-name FreeBSD to override this behavior. Unfortunately this is not possible when source building and leads to build failures

Expected Behavior

It actually is functioning correctly: locking everything using the build.sh to "Darwin" if detected or linux if otherwise. The current solution is unusable in the setting of a source build for FreeBSD

Falling back to linux is a safe assumption as there exist a large number of linux distros. However aspnetcore has been built and working under FreeBSD since net3.0-previews using --os-nameFreeBSD to override this. freebsd-x64, while not officially supported by Microsoft, is a supported RID

freebsd-x64
and a community supported platform

Steps To Reproduce

Under any FreeBSD AMD64:
git clone https://github.com/dotnet/aspnetcore
./eng/build.sh

As most people don't have FreeBSD systems/VMs sitting around, I can provide SSH access.

Exceptions (if any)

The build system will download an try and execute linux ELF's under FreeBSD

.NET Version

No response

Anything else?

Caught here while trying to get source building working: dotnet/runtime#14537 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions