Bug 235459 - WebKit fails to build - error: 'webrtc/rtc_base/network.h' file not found
Summary: WebKit fails to build - error: 'webrtc/rtc_base/network.h' file not found
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-21 15:32 PST by Michael Saboff
Modified: 2022-01-21 17:38 PST (History)
4 users (show)

See Also:


Attachments
Patch (18.63 KB, patch)
2022-01-21 15:42 PST, Michael Saboff
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2022-01-21 15:32:59 PST
When building with a SYSTEM_CONTENT_PATH, we can fail when building WebKit:

.../Source/WebKit/Shared/RTCNetwork.h:32:10: fatal error: 'webrtc/rtc_base/network.h' file not found
#include <webrtc/rtc_base/network.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 1 Michael Saboff 2022-01-21 15:33:14 PST
<rdar://87829404>
Comment 2 Michael Saboff 2022-01-21 15:42:40 PST
Created attachment 449705 [details]
Patch
Comment 3 Mark Lam 2022-01-21 16:45:01 PST
Comment on attachment 449705 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=449705&action=review

I'm not super familiar with the plumbing of all the settings variables, but this patch LGTM.

> Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:27
> +    RELATIVE_PATH_FROM_SYMLINK_TO_ROOT=$(echo "${PUBLIC_FOLDER_PREFIX}" | sed -E -e "s/\/[a-zA-Z0-9_]+/..\//g" -e "s/\/$//")

Why is this "s/\/$//" needed?

> Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:28
> +    SYMLINK_VALUE="${RELATIVE_PATH_FROM_SYMLINK_TO_ROOT}${INSTALL_FOLDER_PREFIX}/${TARGET}"

nit: call this SYMLINK_TARGET instead?

> Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:52
> +        if [[ ! -d ${SYSTEM_PUBLIC_HEADER_PREFIX} ]]; then
> +            mkdir -p ${SYSTEM_PUBLIC_HEADER_PREFIX}
> +        fi

Can't you do this just once outside of the for loop?  The only difference is that moving this out would create this directory even if HEADER_FOLDER_LIST is empty.  But we know it'll never be empty, right?

> Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:64
> +        if [[ ! -d ${SYSTEM_PUBLIC_LIBRARY_PREFIX} ]]; then
> +            mkdir -p ${SYSTEM_PUBLIC_LIBRARY_PREFIX}
> +        fi

Ditto.  Do this outside the for loop?
Comment 4 Michael Saboff 2022-01-21 16:54:50 PST
(In reply to Mark Lam from comment #3)
> Comment on attachment 449705 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=449705&action=review
> 
> I'm not super familiar with the plumbing of all the settings variables, but
> this patch LGTM.
> 
> > Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:27
> > +    RELATIVE_PATH_FROM_SYMLINK_TO_ROOT=$(echo "${PUBLIC_FOLDER_PREFIX}" | sed -E -e "s/\/[a-zA-Z0-9_]+/..\//g" -e "s/\/$//")
> 
> Why is this "s/\/$//" needed?

To eliminate any trailing '/'.

> > Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:28
> > +    SYMLINK_VALUE="${RELATIVE_PATH_FROM_SYMLINK_TO_ROOT}${INSTALL_FOLDER_PREFIX}/${TARGET}"
> 
> nit: call this SYMLINK_TARGET instead?

This follows some the name of other similar scripts.

> > Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:52
> > +        if [[ ! -d ${SYSTEM_PUBLIC_HEADER_PREFIX} ]]; then
> > +            mkdir -p ${SYSTEM_PUBLIC_HEADER_PREFIX}
> > +        fi
> 
> Can't you do this just once outside of the for loop?  The only difference is
> that moving this out would create this directory even if HEADER_FOLDER_LIST
> is empty.  But we know it'll never be empty, right?
> 
> > Source/ThirdParty/libwebrtc/Scripts/create-symlink-to-altroot.sh:64
> > +        if [[ ! -d ${SYSTEM_PUBLIC_LIBRARY_PREFIX} ]]; then
> > +            mkdir -p ${SYSTEM_PUBLIC_LIBRARY_PREFIX}
> > +        fi
> 
> Ditto.  Do this outside the for loop?

I moved both of these to above the loop.
Comment 5 Michael Saboff 2022-01-21 17:38:48 PST
Committed r288391 (246288@trunk): <https://commits.webkit.org/246288@trunk>