Initial support for building on FreeBSD#12996
Conversation
|
Can one of the admins verify this patch? |
|
@phsft-bot build |
|
Starting build on |
|
Thanks @mkrzewic! We kicked off testing to make sure it doesn't break other platforms. I will take a closer look tomorrow 😉 |
Axel-Naumann
left a comment
There was a problem hiding this comment.
This is fantastic, thank you so much!
Just suggesting some small wording (thisisabloodyhackZFS) / indentation changes. I'm curious to see how the CI will deal with the textual module!
| if(CMAKE_CXX_COMPILER_ID STREQUAL Intel) | ||
| set(ROOT_ARCHITECTURE freebsdx8664icc) | ||
| else() |
There was a problem hiding this comment.
Is there really an Intel compiler for FreeBSD? I'd throw out anything that is not needed / tested on FreeBSD, probably only leave freebsdadm64 as ROOT_ARCHITECTURE
There was a problem hiding this comment.
I got a request from the port maintainer (@eamjensen) to keep (and add/fix some of the FBSD specific naming) the cpu architectures in the SetupFreeBSD. Maybe refs to the old freebsd archs can be removed (freebsd4,freebsd5,freebsd7 in config/root-config.in and a bunch of options in etc/Makefile.arch) - instead we could glob/wildcard as they all seem to to the same thing for now plus I think it's safe to say older (gcc based) freebsd systems will not be supported (e.g. because they don't support c++14 etc.)
I'll remove the intel thing, it makes no sense indeed.
There was a problem hiding this comment.
I cleaned up a bit, all in new commits.
maintained by Erik Jensen <erik@tenku.dk> (https://www.freshports.org/devel/root)
this should work on FreeBSD 9 and up. only tested on 13.
… namespace will do
Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
| auto parent_path = [](std::string path) { | ||
| return path.substr(0, path.find_last_of("/\\")); | ||
| }; | ||
| fallback = parent_path(parent_path({path_str})); |
There was a problem hiding this comment.
I see that this part is common with the WIN32 case. Perhaps we can restructure this a bit to avoid code duplication.
There was a problem hiding this comment.
possibly, I even tried, but for some reason this was better if I remember correctly... maybe not a good reason though:)
| #endif | ||
| #if defined R__FBSD || defined __FreeBSD__ | ||
| procstat* ps = procstat_open_sysctl(); // | ||
| kinfo_proc* kp = kinfo_getproc(getpid()); |
There was a problem hiding this comment.
I saw some other usages of the procfs filesystem typically mounted on /proc on Linux, namely in:
- The
proof/,rootx/andbindings/pyroot/cppyy/directories - The
config/thisroot.shfile
Maybe we should take a look into those too.
There was a problem hiding this comment.
config/thisroot.sh should work as it is
rootx I'll fix, but is there no common library/place to define GetExePath (and the like) once for all components?
proof and python I'll leave for later as I have no use for those. Someone will contribute a patch if there is need:)
| char* __progname; | ||
| char** environ; |
There was a problem hiding this comment.
These are extern, no?
There was a problem hiding this comment.
possibly, this is a "legacy" fix from the port maintainer, it is needed and sufficient (it seems). I think maybe for some reason the symbols needed to be visible for lld, possibly some subtle difference with ld.
| // libprocstat pulls in sys/elf.h which seems to clash with llvm/BinaryFormat/ELF.h | ||
| // similar collision happens with ZFS. Defining ZFS disables this include. |
Co-authored-by: Javier Lopez-Gomez <javier.lopez.gomez@cern.ch>
Co-authored-by: Javier Lopez-Gomez <javier.lopez.gomez@cern.ch>
Co-authored-by: Javier Lopez-Gomez <javier.lopez.gomez@cern.ch>
Co-authored-by: Javier Lopez-Gomez <javier.lopez.gomez@cern.ch>
Co-authored-by: Javier Lopez-Gomez <javier.lopez.gomez@cern.ch>
Co-authored-by: Javier Lopez-Gomez <javier.lopez.gomez@cern.ch>
|
I have one more question, this gets it building and kinda working, but there are still runtime issues: bunch of tests fail, most notably some io (basic works, higher compression levels fail) and threading (some TThread tests fail, for various reasons, from trivial _REENTRANT macro not defined, to proper crashes). Question is: keep adding to this PR or open a new issue some time in the future? |
|
New issues, new PRs please - we prefer to work incrementally, grandiose things have the habit to fail :-) I very much appreciate this first step to make it build! |
|
Let's not downplay the achievement here - my understanding is that this PR not only allows to compile ROOT on FreeBSD, but gets us a decently functional executable for first tests and further improvements 🚀 I agree with Axel that other problems and tests should be addressed in future issues / PRs. I think the final point to consider is how to merge. With the current state of commits addressing review comments, I would propose to squash on merge; unless @mkrzewic wants to rework the commits and fold the followups into the respective commits 😉 |
|
@Axel-Naumann sure, squash away, then I'll rebase my next branch and open a new PR. |
|
Thanks a LOT for your work, @mkrzewic ! |
|
We forgot to run the old Jenkins CI for the latest push (that is on us), #13073 takes care of an |
Co-authored-by: Mikolaj Krzewicki <Mikolaj Krzewicki mkrzewicki@gmail.com>
This Pull request:
This is an initial attempt at getting this thing building on modern FreeBSD (i.e. without /proc)
some discussion was going on in issue #12787 and @hahnjo suggested a broader review and discussion in a PR.
Changes or fixes:
Checklist:
This PR fixes #12787