Skip to content
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

Support for FreeBSD #561

Closed
RobinQ124274 opened this issue Feb 27, 2019 · 12 comments
Closed

Support for FreeBSD #561

RobinQ124274 opened this issue Feb 27, 2019 · 12 comments
Assignees
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@RobinQ124274
Copy link

RobinQ124274 commented Feb 27, 2019

I am looking for a way to build/install Shaka Packager properly on FreeBSD 12. I noticed from the build instructions that there is no specific part for (Free)BSD builds and following the Linux build instructions leaves me with various issues regarding depot_tools not supporting FreeBSD as well.

I also tried using the static Linux binaries in combination with the Linux Compatibility Layer from FreeBSD (which proved to work albeit with some error notifications), but I was wondering if there is a more native way to install Shaka Packager on FreeBSD?

@kqyang
Copy link
Contributor

kqyang commented Feb 27, 2019

Unfortunately, as far as I know, there aren't other ways to install Shaka Packager on FreeBSD.

following the Linux build instructions leaves me with various issues regarding depot_tools not supporting FreeBSD as well.

For depot_tool, I assume you are talking about gclient. Does other tools like gyp work in FreeBSD? If so, you can try to download the source code in Linux (which is what gclient does) and then use gyp directly to see if you can build the code in FreeBSD.

@kqyang kqyang added type: question A question from the community and removed needs triage labels Feb 27, 2019
@RobinQ124274
Copy link
Author

Thank you for your quick reply.

The first problem arose when I tried to use gclient:

$ gclient config https://www.github.com/google/shaka-packager.git --name=src --unmanaged
CIPD not supported on freebsd

So I tried a little hack by adding FreeBSD to the OS checks in CIPD. Changing the target to freebsd or bsd wasn't possible due to missing hashes in the *.digests files. So for the sake of it I tried changing the target to Linux to see what would happen. CIPD then tried to execute a Linux binary which ended in the following error:

[root@cleanbsd-12 /usr/local/src]# gclient config https://www.github.com/google/shaka-packager.git --name=src --unmanaged
depot_tools update failed. Conflict in /usr/local/src/depot_tools
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.
ELF binary type "0" not known.
CIPD selfupdate failed. Trying to bootstrap the CIPD client from scratch...
ELF binary type "0" not known.
/usr/local/src/depot_tools/cipd: line 204: /usr/local/src/depot_tools/.cipd_client: cannot execute binary file: Exec format error

So I followed your advise and downloaded the source code using gclient on a Linux machine and copied the code to the FreeBSD machine. There I continued the steps described in the build instructions for Linux and executed ninja:

$ ninja -C out/Release/
ninja: Entering directory `out/Release/'
[1/1646] CC obj/third_party/boringssl/src/crypto/bytestring/boringssl.cbs.o
FAILED: obj/third_party/boringssl/src/crypto/bytestring/boringssl.cbs.o 
../../packager/third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/boringssl/src/crypto/bytestring/boringssl.cbs.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=700 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=317263-2 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBORINGSSL_IMPLEMENTATION -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_SMALL -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../packager/third_party/boringssl/src/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-tautological-constant-compare -Wno-unguarded-availability -Wno-unused-variable -m64 -march=x86-64 --sysroot=/home/robin/.local/src/shaka_packager/src/packager/build/linux/debian_wheezy_amd64-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -std=c99  -c ../../packager/third_party/boringssl/src/crypto/bytestring/cbs.c -o obj/third_party/boringssl/src/crypto/bytestring/boringssl.cbs.o
In file included from ../../packager/third_party/boringssl/src/crypto/bytestring/cbs.c:15:
In file included from ../../packager/third_party/boringssl/src/include/openssl/buf.h:60:
../../packager/third_party/boringssl/src/include/openssl/base.h:61:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
         ^~~~~~~~~~~~~
1 error generated.
[2/1646] CC obj/third_party/boringssl/src/crypto/chacha/boringssl.chacha.o
FAILED: obj/third_party/boringssl/src/crypto/chacha/boringssl.chacha.o 
../../packager/third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/boringssl/src/crypto/chacha/boringssl.chacha.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=700 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=317263-2 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBORINGSSL_IMPLEMENTATION -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_SMALL -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../packager/third_party/boringssl/src/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-tautological-constant-compare -Wno-unguarded-availability -Wno-unused-variable -m64 -march=x86-64 --sysroot=/home/robin/.local/src/shaka_packager/src/packager/build/linux/debian_wheezy_amd64-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -std=c99  -c ../../packager/third_party/boringssl/src/crypto/chacha/chacha.c -o obj/third_party/boringssl/src/crypto/chacha/boringssl.chacha.o
In file included from ../../packager/third_party/boringssl/src/crypto/chacha/chacha.c:17:
In file included from ../../packager/third_party/boringssl/src/include/openssl/chacha.h:18:
../../packager/third_party/boringssl/src/include/openssl/base.h:61:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
         ^~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

So it looks like gclient also set some variables for the build recipe with regard to the OS on which it was executed (probably also the reason why sys/types.h could not be found while being present at /usr/include/sys/types.h). Gyp and clang were also installed via pkg, but the same error remained.

I also performed more tests using the static Linux binaries on FreeBSD and I received errors regarding gaps which resulted in a corrupted video stream.

[0228/110316:WARNING:representation.cc(384)] Found a gap of size 15360 > kRoundingErrorGrace (5). The new segment starts at 2160360 but the previous segment ends at 2145000.
[0228/110322:WARNING:representation.cc(384)] Found a gap of size 15360 > kRoundingErrorGrace (5). The new segment starts at 2701800 but the previous segment ends at 2686440.

On Linux, these errors do not appear using the same video sources, so I suspect that using Linux Compatibility Layer may not be a viable solution either.

@kqyang
Copy link
Contributor

kqyang commented Feb 28, 2019

Can you try running ./gyp_packager.py --depth=packager first running ninja -C out/Release?

@RobinQ124274
Copy link
Author

Initially had some problems getting gyp_packager.py to work since FreeBSD uses Clang as default compiler. However, after some research I found that env CC="gcc8" CXX="g++8" ./gyp_packager.py --depth=packager solves the problem.

Afterwards I ran ninja -C out/Release, which yielded the following error:

/usr/local/bin/ninja -C out/Release
ninja: Entering directory `out/Release'
[249/1625] CC obj/third_party/libxml/src/libxml.threads.o
FAILED: obj/third_party/libxml/src/libxml.threads.o 
gcc8 -MMD -MF obj/third_party/libxml/src/libxml.threads.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=317263-2 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_NOTIFICATIONS -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DLIBXML_STATIC= -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DU_STATIC_IMPLEMENTATION -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../packager/third_party/libxml/linux -I../../packager/third_party/libxml/linux/include -I../../packager/third_party/libxml/src/include -I../../packager/third_party/icu/source/common -I../../packager/third_party/zlib -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-strict-aliasing -Wno-extra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -Wno-dangling-else -Wno-deprecated-declarations -Wno-unused-function -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables   -c ../../packager/third_party/libxml/src/threads.c -o obj/third_party/libxml/src/libxml.threads.o
../../packager/third_party/libxml/src/threads.c: In function 'xmlGetGlobalState':
../../packager/third_party/libxml/src/threads.c:667:33: error: 'xmlOnceInit' undeclared (first use in this function)
     pthread_once(&once_control, xmlOnceInit);
                                 ^~~~~~~~~~~
../../packager/third_party/libxml/src/threads.c:667:33: note: each undeclared identifier is reported only once for each function it appears in
../../packager/third_party/libxml/src/threads.c:671:31: warning: implicit declaration of function 'xmlNewGlobalState'; did you mean 'xmlGetGlobalState'? [-Wimplicit-function-declaration]
         xmlGlobalState *tsd = xmlNewGlobalState();
                               ^~~~~~~~~~~~~~~~~
                               xmlGetGlobalState
../../packager/third_party/libxml/src/threads.c:671:31: warning: initialization of 'xmlGlobalState *' {aka 'struct _xmlGlobalState *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
../../packager/third_party/libxml/src/threads.c: In function 'xmlIsMainThread':
../../packager/third_party/libxml/src/threads.c:805:33: error: 'xmlOnceInit' undeclared (first use in this function)
     pthread_once(&once_control, xmlOnceInit);
                                 ^~~~~~~~~~~
[250/1625] CC obj/third_party/libxml/src/libxml.parser.o
ninja: build stopped: subcommand failed.

@kqyang
Copy link
Contributor

kqyang commented Mar 1, 2019

@RobinQ124274 The failure is because HAVE_PTHREAD_H is defined but LIBXML_THREAD_ENABLED flag is not. Right now the libxml build probably uses the config defined in packager/third_party/libxml/linux. It needs to be adjusted to work on FreeBSD platforms.

@shaka-bot
Copy link
Collaborator

@RobinQ124274 Does this answer all your questions? Can we close the issue?

@shaka-bot shaka-bot added status: waiting on response Waiting on a response from the reporter(s) of the issue and removed status: waiting on response Waiting on a response from the reporter(s) of the issue labels Mar 5, 2019
@RobinQ124274
Copy link
Author

Thank you again for the tip!

I added #define LIBXML_THREAD_ENABLED to packager/third_party/libxml/linux/config.h and the build process continued without errors for a while until I bumped into the next error:

$ /usr/local/bin/ninja -C out/Release/
ninja: Entering directory `out/Release/'
[700/1625] CXX obj/third_party/icu/source/common/icuuc.uloc.o
In file included from ../../packager/third_party/icu/source/common/uloc.cpp:39:
../../packager/third_party/icu/source/common/uloc.cpp: In function 'int32_t _canonicalize(const char*, char*, int32_t, uint32_t, UErrorCode*)':
../../packager/third_party/icu/source/common/cstring.h:57:70: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
 #define uprv_strncpy(dst, src, size) U_STANDARD_CPP_NAMESPACE strncpy(dst, src, size)
../../packager/third_party/icu/source/common/uloc.cpp:1679:13: note: in expansion of macro 'uprv_strncpy'
             uprv_strncpy(name, d, len);
             ^~~~~~~~~~~~
../../packager/third_party/icu/source/common/cstring.h:35:57: note: length computed here
 #define uprv_strlen(str) U_STANDARD_CPP_NAMESPACE strlen(str)
../../packager/third_party/icu/source/common/uloc.cpp:1676:24: note: in expansion of macro 'uprv_strlen'
         len = (int32_t)uprv_strlen(d);
                        ^~~~~~~~~~~
[734/1625] CC obj/third_party/curl/source/lib/libcurl.asyn-ares.o
FAILED: obj/third_party/curl/source/lib/libcurl.asyn-ares.o
gcc8 -MMD -MF obj/third_party/curl/source/lib/libcurl.asyn-ares.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=317263-2 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_NOTIFICATIONS -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBUILDING_LIBCURL -DCURL_STATICLIB -DHTTP_ONLY -DUSE_IPV6 -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../packager/third_party/curl/source/lib -I../../packager/third_party/curl/source/include -I../../packager/third_party/boringssl/src/include -I../../packager/third_party/curl/config -I../../packager/third_party/curl/config/curl -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-strict-aliasing -Wno-extra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -Wno-dangling-else -Wno-deprecated-declarations -Wno-unused-function -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables   -c ../../packager/third_party/curl/source/lib/asyn-ares.c -o obj/third_party/curl/source/lib/libcurl.asyn-ares.o
In file included from ../../packager/third_party/curl/source/lib/curl_setup.h:669,
                 from ../../packager/third_party/curl/source/lib/asyn-ares.c:23:
../../packager/third_party/curl/source/lib/curl_setup_once.h:110:8: error: redefinition of 'struct timeval'
 struct timeval {
        ^~~~~~~
In file included from /usr/include/sys/select.h:41,
                 from /usr/include/sys/types.h:376,
                 from ../../packager/third_party/curl/source/include/curl/system.h:397,
                 from ../../packager/third_party/curl/source/include/curl/curl.h:38,
                 from ../../packager/third_party/curl/source/lib/curl_setup.h:142,
                 from ../../packager/third_party/curl/source/lib/asyn-ares.c:23:
/usr/include/sys/_timeval.h:49:8: note: originally defined here
 struct timeval {
        ^~~~~~~
In file included from ../../packager/third_party/curl/source/lib/curl_setup.h:669,
                 from ../../packager/third_party/curl/source/lib/asyn-ares.c:23:
../../packager/third_party/curl/source/lib/curl_setup_once.h:175:3: error: unknown type name 'Error'; did you mean 'ferror'?
   Error Missing_definition_of_macro_sread
   ^~~~~
   ferror
../../packager/third_party/curl/source/lib/curl_setup_once.h:206:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Error'
   Error Missing_definition_of_macro_swrite
   ^~~~~
../../packager/third_party/curl/source/lib/curl_setup_once.h:206:3: error: unknown type name 'Error'; did you mean 'ferror'?
   Error Missing_definition_of_macro_swrite
   ^~~~~
   ferror
../../packager/third_party/curl/source/lib/curl_setup_once.h:322:5: warning: data definition has no type or storage class
   } bool;
     ^~~~
../../packager/third_party/curl/source/lib/curl_setup_once.h:322:5: warning: type defaults to 'int' in declaration of 'bool' [-Wimplicit-int]
[735/1625] CC obj/third_party/curl/source/lib/libcurl.amigaos.o
FAILED: obj/third_party/curl/source/lib/libcurl.amigaos.o
gcc8 -MMD -MF obj/third_party/curl/source/lib/libcurl.amigaos.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=317263-2 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_NOTIFICATIONS -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBUILDING_LIBCURL -DCURL_STATICLIB -DHTTP_ONLY -DUSE_IPV6 -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../packager/third_party/curl/source/lib -I../../packager/third_party/curl/source/include -I../../packager/third_party/boringssl/src/include -I../../packager/third_party/curl/config -I../../packager/third_party/curl/config/curl -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-strict-aliasing -Wno-extra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -Wno-dangling-else -Wno-deprecated-declarations -Wno-unused-function -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables   -c ../../packager/third_party/curl/source/lib/amigaos.c -o obj/third_party/curl/source/lib/libcurl.amigaos.o
In file included from ../../packager/third_party/curl/source/lib/curl_setup.h:669,
                 from ../../packager/third_party/curl/source/lib/amigaos.c:23:
../../packager/third_party/curl/source/lib/curl_setup_once.h:110:8: error: redefinition of 'struct timeval'
 struct timeval {
        ^~~~~~~
In file included from /usr/include/sys/select.h:41,
                 from /usr/include/sys/types.h:376,
                 from ../../packager/third_party/curl/source/include/curl/system.h:397,
                 from ../../packager/third_party/curl/source/include/curl/curl.h:38,
                 from ../../packager/third_party/curl/source/lib/curl_setup.h:142,
                 from ../../packager/third_party/curl/source/lib/amigaos.c:23:
/usr/include/sys/_timeval.h:49:8: note: originally defined here
 struct timeval {
        ^~~~~~~
In file included from ../../packager/third_party/curl/source/lib/curl_setup.h:669,
                 from ../../packager/third_party/curl/source/lib/amigaos.c:23:
../../packager/third_party/curl/source/lib/curl_setup_once.h:175:3: error: unknown type name 'Error'; did you mean 'ferror'?
   Error Missing_definition_of_macro_sread
   ^~~~~
   ferror
../../packager/third_party/curl/source/lib/curl_setup_once.h:206:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Error'
   Error Missing_definition_of_macro_swrite
   ^~~~~
../../packager/third_party/curl/source/lib/curl_setup_once.h:206:3: error: unknown type name 'Error'; did you mean 'ferror'?
   Error Missing_definition_of_macro_swrite
   ^~~~~
   ferror
../../packager/third_party/curl/source/lib/curl_setup_once.h:322:5: warning: data definition has no type or storage class
   } bool;
     ^~~~
../../packager/third_party/curl/source/lib/curl_setup_once.h:322:5: warning: type defaults to 'int' in declaration of 'bool' [-Wimplicit-int]
[736/1625] CXX obj/third_party/boringssl/src/ssl/boringssl.tls_record.o
ninja: build stopped: subcommand failed.

I am not really familiar with C code compilation, especially not in bigger projects, so I am sorry that I can't be much of a help in these situations...

@kqyang kqyang added type: enhancement New feature or request and removed type: question A question from the community labels Mar 6, 2019
@kqyang kqyang added this to the Backlog milestone Mar 6, 2019
@kqyang kqyang changed the title [Question] Support for FreeBSD Support for FreeBSD Mar 6, 2019
@kqyang kqyang added the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Mar 6, 2019
@kqyang
Copy link
Contributor

kqyang commented Mar 6, 2019

That is a good progress! Almost ~50% of the modules now compiles.

The curl build failures can be solved by updating curl.gyp: https://github.com/google/shaka-packager/blob/6b4a75b6bacdac6b0b9f598c365c8f84f0a7fd70/packager/third_party/curl/curl.gyp#L31.

You can try adding a config for FreeBSD, e.g. start with the config for mac or linux. You need to rerun gyp_packager.py after updating gyp files.

There will probably be more errors in other third party modules.

Another option you can go is to update the gyp files to use pre-built libraries instead of re-comping them. Here is an example on using system libxml: https://github.com/google/shaka-packager/blob/6b4a75b6bacdac6b0b9f598c365c8f84f0a7fd70/packager/third_party/libxml/libxml.gyp#L16.

@joeyparrish joeyparrish modified the milestones: Backlog, v2.7 Jun 24, 2022
@joeyparrish joeyparrish added the priority: P3 Useful but not urgent label Jun 24, 2022
@joeyparrish joeyparrish self-assigned this Oct 18, 2023
@joeyparrish
Copy link
Member

I suspect the cmake branch may be able to build on FreeBSD now. I'll check in a VM for fun.

@joeyparrish
Copy link
Member

There are a couple compiler errors in third_party that should be silenced, and there may be a legitimate error around the networking code in packager/file/udp_file.cc. But the cmake build system is functional on FreeBSD.

This was referenced Oct 18, 2023
@joeyparrish
Copy link
Member

With the two PRs linked above, I have a working build on FreeBSD in a VM. Unit tests are all passing in that environment as well.

We can't do FreeBSD builds in CI without self-hosting a runner on a FreeBSD host. But with the new cmake build, it should be easy to contribute for those who want to maintain a FreeBSD port in the future.

cosmin pushed a commit that referenced this issue Oct 18, 2023
cosmin pushed a commit that referenced this issue Oct 18, 2023
@joeyparrish
Copy link
Member

All fixed in the cmake branch now. We'll merge back to main soon. Thanks!

@joeyparrish joeyparrish removed the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Oct 19, 2023
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Dec 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants