Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Few build changes to support Freebsd #14121

Merged
merged 13 commits into from
Oct 3, 2017
Merged

Few build changes to support Freebsd #14121

merged 13 commits into from
Oct 3, 2017

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Sep 21, 2017

  • there may not be 'python' binary - fresh install has only python2.7
  • __HostDistroRid for FreeBSD
  • small fixes for consistency and to make build of corelib easier for freebsd

@@ -35,7 +35,7 @@ OPTION(CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF)
OPTION(CLR_CMAKE_WARNINGS_ARE_ERRORS "Warnings are errors" ON)

# Ensure that python is present
find_program(PYTHON python)
find_program(PYTHON NAMES python2.7 python2 python)
Copy link
Member

Choose a reason for hiding this comment

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

I didn't need to change this on my FreeBSD 11.0, when I run "python --version", it prints 2.7.13. I wonder what is different on your instance that causes this to be required. But the change doesn't hurt and can possibly help on some new platforms.
Btw, I have:

$ which python
/usr/local/bin/python
$ ls -la /usr/local/bin/python
lrwxr-xr-x  1 root  wheel  7 Feb 25  2017 /usr/local/bin/python -> python2

Copy link
Member Author

Choose a reason for hiding this comment

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

I have fresh install of 11.0 and it is not there.
This is essentially re-incarnation of 38c683c#diff-0b83f9dedf40d7356e5ca147a077acb4 submitted last yer.

Copy link
Member

Choose a reason for hiding this comment

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

Just FYI, I have installed the python-2.7_3,2 package using the pkg tool, that one includes the link I've mentioned above.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was wondering about that. I have Python 2.7.13 (default, Apr 29 2017, 01:15:48) which comes with base OS e.g. I did not add any new package. With this we would look for more specific 2.7 first , falling back to what ever python you have.

build.sh Outdated
@@ -553,6 +557,10 @@ case $CPUName in
__HostArch=arm64
;;

adm64)
Copy link
Member

Choose a reason for hiding this comment

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

There is a typo in the name (adm64 instead of amd64).

build.sh Outdated
@@ -860,6 +868,15 @@ while :; do
exit 1
fi
;;
-osgroup=*)
Copy link
Member

Choose a reason for hiding this comment

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

Can you please explain why this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two parts. corefx used -OSGroup= to pass in cross-target OS.
I wanted to be consistent. I also feel that option=value scales better than having list of singular values.

As far as the functionality it allows to build mscorelib for freebsd on Linux.

Copy link
Member

Choose a reason for hiding this comment

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

The problem I have with this option is that we already have options that can specify the same thing. Combined -skipnative, -skipnuget and -skiptests are exactly that. Having a new option that just aggregates other ones seems confusing. Moreover, the option format is inconsistent with all the others (other options with parameters separate the option and its value with space, like e.g. -cmakeargs -DXXXXX=YYY.
So I'd prefer not adding it and using the three options when you need that functionality.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. That is how I originally did it. But than I look at freebsdmscorlib and mimic what it does. Setting __BuildOS does more than just passing define to make. I know this parameter is somewhat inconsistent with rest. However this is exactly how same thing is done for corefx.
I think it is easier to modify shell script to support managed/msbuild like parameters than the other way. Just fact that some places you have to use "release" but "-release" elsewhere is driving me nuts.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you. The last thing I would change here is really to make the option match the others, it means "-osgroup xxxx" instead of "-osgroup=xxxx".


if(LLDB_H STREQUAL LLDB_H-NOTFOUND)
if(REQUIRE_LLDBPLUGIN)
message(FATAL_ERROR "Cannot find LLDB.h. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
else()
message(WARNING "Cannot find LLDB.h Try installing lldb-3.6-dev (or the appropriate package for your platform)")
message(WARNING "Cannot find LLDB.h Try installing lldb-3.6-dev (or the appropriate package for your platform and set LLVM_HOME)")
Copy link
Member

Choose a reason for hiding this comment

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

Setting the LLVM_HOME is not needed in general, installing the lldb-dev package is sufficient on most platforms. Actually, I didn't need to do that on FreeBSD, just adding the find_path was sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed. I wanted to improve message when normal lookup does not work.
Perhaps we can work on wording. In my case I have the headers but the build was not finding them. It may be easier IMHO for distro vendors to set variable instead maintain list of all possible locations.

Copy link
Member

Choose a reason for hiding this comment

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

I would modify the wording to say:
Try installing lldb-3.6-dev (or the appropriate package for your platform). You may need to set LLVM_HOME if the build still can't find it.

I wonder - how did you install the LLVM stuff? I am asking since after we complete enabling FreeBSD, we should add instructions on what dependencies to install so that the build just works.

Copy link

Choose a reason for hiding this comment

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

@janvorli simple pkg install llvm38 should do the trick, also krb5 package is required at some point. I was following https://github.com/dotnet/coreclr/blob/master/Documentation/building/freebsd-instructions.md and it's 99% correct to the build point.

@wfurt wfurt added the os-freebsd FreeBSD OS label Sep 22, 2017
@wfurt
Copy link
Member Author

wfurt commented Sep 22, 2017

This is part of https://github.com/dotnet/corefx/issues/1626

build.sh Outdated
@@ -2,7 +2,7 @@

# resolve python-version to use
if [ "$PYTHON" == "" ] ; then
if ! PYTHON=$(command -v python || command -v python2 || command -v python 2.7)
if ! PYTHON=$(command -v python || command -v python2 || command -v python2.7)
Copy link
Member

Choose a reason for hiding this comment

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

Should we look here in the same order as we do in the CMakeLists.txt above? I like the logic of starting with 2.7, then trying 2 and finally just python.

…with most specific version. uddate warning message about lldb.h and remove composite flag
@wfurt
Copy link
Member Author

wfurt commented Sep 27, 2017

armel failure seems unrelated:
11:13:16 BEGIN EXECUTION
11:13:16 /home/coreclr/bin/tests/Windows_NT.x64.Debug/Tests/coreoverlay/corerun b49809.exe
11:13:16 qemu: Unsupported syscall: 389
11:13:16
./b49809.sh: line 243: 741 Segmentation fault (core dumped) $_DebuggerFullPath "$CORE_ROOT/corerun" $ExePath $CLRTestExecutionArguments


if(LLDB_H STREQUAL LLDB_H-NOTFOUND)
if(REQUIRE_LLDBPLUGIN)
message(FATAL_ERROR "Cannot find LLDB.h. Try installing lldb-3.6-dev (or the appropriate package for your platform)")
else()
message(WARNING "Cannot find LLDB.h Try installing lldb-3.6-dev (or the appropriate package for your platform)")
message(WARNING "Cannot find LLDB.h Try installing lldb-3.6-dev (or the appropriate package for your platformi). You may need to set LLVM_HOME if the build still can't find it.")
Copy link
Member

Choose a reason for hiding this comment

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

A nit - typo - platformi -> platform. Also it seems that the same message should be displayed for the message above - and we should put the text to a common variable instead of duplicating it.

@janvorli janvorli merged commit 858f5e0 into dotnet:master Oct 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
os-freebsd FreeBSD OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants