-
Notifications
You must be signed in to change notification settings - Fork 197
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
Adding FreeBSD support for server version #353
Open
Teetoow
wants to merge
15
commits into
ONLYOFFICE:master
Choose a base branch
from
Teetoow:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also add patches/ directory check in order to easily apply custom patches to OnlyOffice sources. By default this directory does not exists.
not written for FreeBSD. In order to get chromium compiling under FreeBSD a specific set of compilation tool has to be used (see https://wiki.freebsd.org/Chromium)
repositories. This is particulary useful when compiling code on an unsupported platform. Patches are stored in patches/<platform/ directory. Moreover skip the 3rd party compilation under FreeBSD since OnlyOffice depends on v8 which needs specific compilation tools under FreeBSD (native v8 compilation tools are not written for FreeBSD. Thus under FreeBSD we use node10 available in the FreeBSD port compiled with the "shared" option. In that way libnode.so is used in order to get the v8 code). Since v8 library is got from FreeBSD ports, we also want to use the native ICU library, boost library, openssl library etc. Moreover it lets the sysadmin getting the latest security patches for these libraries and avoid security holes (without recompiling onlyoffice).
/usr/bin. When npm-pkg is installed it is installed in /usr/local/bin. In that way by specifying the full path under FreeBSD it lets the python script accessing npm pkg rather that the FreeBSD package manager.
ones are used during compilation.
Before calling this script: - be sure that "git" (or "git-lite"), "sudo" and # "python27" are installed: # pkg install git-lite sudo python27 - /usr/bin/python is a symlink to /usr/local/bin/python2.7: # ln -s /usr/local/bin/python2.7 /usr/bin/python - CC and CXX environment variables are respectively set to clang and clang++ # export CC=clang # export CXX=clang++ Last but not least only "server" module has been checked to compile under FreeBSD. That's why only this module is currently accepted.
apply it. Currently it only supports linux patch but it is easy to add the windows solution too. It does nothing if the patches/ or the patches/<os> directories don't exist. It could be useful to easily apply patches before compiling them. Since some patches are applied (at least in build_server.py) it could also be interested in creating a function with an argument "prefix" in order to apply patches before compiling and after compiling in a such way. Since it changes nothing if directories are not present it would be very intested in adding this code. In that way it would be easier to add FreeBSD (and other OSes) support.
library updates which removes very old functions declared as obsolete since many years (Node10 is very old..). There is no more problems with node12. Please note that node12 is now obsolete and no more maintained. It could then bring security issues especially for servers...). Since the code is not working under node14 or node16 it would be interested in working on the code to use them.
In that case we are sure that we are using the latest version with latest security patches applied. Moreover these libraries will be updated with the system updates. Then we will be sure we will get the latest security fixes!
working under FreeBSD
ABI. In order to compile some node modules on very old FreeBSD version some macros have to be passed to the compiler. Unfortunately the test used to check which FreeBSD version is installed on the host is quite poor since it is based on a text string which corresponds to the LLVM version. With FreeBSD version greater or equal to FreeBSD 12, LLVM major version is greater or equal to 10. Then the string comparison between "4.0" and the current LLVM version "10.xx" gives wrong result and unsupported MACROS are applied during compilation whereas it should not be applied. On "newer" version of node (at least since node12) this test has been removed. However since the current version of DocumentServer does not compiles with node12 or greater (due to the use of V8 code which is no more available in the V8 version contained in node12 and greater) we need to patch the common.gypi file which is cached during npm install process. Once node_gyp files are cached other calls to npm install use the cached version. So patching the cache files will work during the compilation process. To summarize this part of the code is only useful because documentserver version use VERY VERY VERY VERY old V8 version. Once DocumentServer will be able to use newer V8 version this hack will be removed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These patches added FreeBSD support for server version of DocumentServer.
Applying these patches won't break non FreeBSD users since there are os specific conditions everywhere (excepted for the patching mechanism but as explained in its commit it won't do anything if patches/ or patches/ is not present which is the case by default).
Please note that the FreeBSD version needs specific packages installed before using it as explained in the header of the tools/freebsd/automate.py file.
The node10 version installed have to be installed with the "--shared" option enabled in order to use its V8 version.