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

Issue while building the code in mac os mojave #23015

Closed
ghost opened this issue Mar 12, 2019 · 23 comments · Fixed by #23069
Closed

Issue while building the code in mac os mojave #23015

ghost opened this issue Mar 12, 2019 · 23 comments · Fixed by #23069
Labels
A-build Related to or part of the build process P-mac Any version of MacOS

Comments

@ghost
Copy link

ghost commented Mar 12, 2019

./mach build -d

Exception: Your system's GStreamer libraries are out of date (we need at least 1.12). If you're unable to install them, let us know by filing a bug!

File "/Users/ramakrishna.chilaka/Desktop/servo/python/servo/build_commands.py", line 303, in build
env = self.build_env(target=target, is_build=True)
File "/Users/ramakrishna.chilaka/Desktop/servo/python/servo/command_base.py", line 612, in build_env
if self.needs_gstreamer_env(target):
File "/Users/ramakrishna.chilaka/Desktop/servo/python/servo/command_base.py", line 560, in needs_gstreamer_env
install them, let us know by filing a bug!")

I installed GStreamer libraries through brew and manually downloading from GStreamer website. installed OpenSSL from brew. Still, I am not able to build. Kindly, please help, if anyone faced the same issue before.

@tigercosmos tigercosmos added P-mac Any version of MacOS A-build Related to or part of the build process labels Mar 13, 2019
@FateXRebirth
Copy link

same issue encounter, any solution?
I have upgraded my gstreamer version to 1.14.4 by typing "brew upgrade gstreamer"

@janczer
Copy link
Contributor

janczer commented Mar 15, 2019

I have the same problem. MacOS Mojave 10.14.3

@CYBAI
Copy link
Member

CYBAI commented Mar 15, 2019

I have the same problem. MacOS Mojave 10.14.3

I'm on macOS Mojave 10.14.3 with gstreamer 1.14.4 and I can build Servo successfully.

→ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.14.4
GStreamer 1.14.4
Unknown package origin

@ghost
Copy link
Author

ghost commented Mar 15, 2019

I installed gstreamer libraries freshly through brew, they are of latest version.😄, my mojave version is also 10.14.3

@CYBAI
Copy link
Member

CYBAI commented Mar 19, 2019

How about checking with pkg-config?

→ pkg-config --modversion gstreamer-1.0
1.14.4

and also try to run this locally with a python script

import subprocess

print subprocess.call(["pkg-config", "gstreamer-1.0 >= 1.12"])

It should print 0 or it will be falsy in this line which makes the exception thrown

def check_gstreamer_lib():
return subprocess.call(["pkg-config", "gstreamer-1.0 >= 1.12"],
stdout=PIPE, stderr=PIPE) == 0

@josephhutch
Copy link

How about checking with pkg-config?

I'm getting 1.14.4

and also try to run this locally with a python script

The script prints 1 with no exceptions

I'm also having this issue on MacOS 10.14.3. Let me know if I can provide any other information to get this issue resolved.

@CYBAI
Copy link
Member

CYBAI commented Mar 20, 2019

@josephhutch I just updated the python script snippet to not use PIPE. Could you run the script again? I think you would get some error messages this time 🤔 Thanks!

@josephhutch
Copy link

@CYBAI Still getting 1

@CYBAI
Copy link
Member

CYBAI commented Mar 20, 2019

@josephhutch Hmm, sorry, could you run it again? I think this would print the error 🤔

import subprocess

print subprocess.check_call(["pkg-config", "gstreamer-1.0 >= 1.12"])
print subprocess.check_output(["pkg-config", "gstreamer-1.0 >= 1.12"])

@ghost
Copy link
Author

ghost commented Mar 20, 2019

@josephhutch Hmm, sorry, could you run it again? I think this would print the error 🤔

import subprocess

print subprocess.check_call(["pkg-config", "gstreamer-1.0 >= 1.12"])
print subprocess.check_output(["pkg-config", "gstreamer-1.0 >= 1.12"])

On running this script i got the following output

>>> print subprocess.check_call(["pkg-config", "gstreamer-1.0 >= 1.12"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['pkg-config', 'gstreamer-1.0 >= 1.12']' returned non-zero exit status 1
>>> print subprocess.check_output(["pkg-config", "gstreamer-1.0 >= 1.12"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['pkg-config', 'gstreamer-1.0 >= 1.12']' returned non-zero exit status 1

@CYBAI
Copy link
Member

CYBAI commented Mar 20, 2019

Could someone try to apply this patch and see if it will pass the build? 🤔 Thanks.

diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py
index c7060b3888..1243d6a0a3 100644
--- a/python/servo/bootstrap.py
+++ b/python/servo/bootstrap.py
@@ -46,8 +46,7 @@ def install_trusty_deps(force):
 
 
 def check_gstreamer_lib():
-    return subprocess.call(["pkg-config", "gstreamer-1.0 >= 1.12"],
-                           stdout=PIPE, stderr=PIPE) == 0
+    return subprocess.check_output('pkg-config --modversion gstreamer-1.0') >= 1.12
 
 
 def run_as_root(command, force=False):

@Feliix42
Copy link

Feliix42 commented Mar 20, 2019

For me, the build is now successfully initiated.

Edit: Ok, I seem to have an issue with libffi and gobject, but this is probably unrelated.

@josephhutch
Copy link

@CYBAI, that worked for me as well. Thank you for the help!

@Feliix42, the libffi issue can be solved by adding the environment variable PKG_CONFIG_PATH with libffi's path. See brew info libffi

bors-servo pushed a commit that referenced this issue Mar 21, 2019
Compare gstreamer version via `pkg-config --modversion` in bootstrap python script

Not sure why calling `["pkg-config", "gstreamer-1.0 >= 1.12"]` did not work for some people on Mojave. (Btw, I'm also on Mojave but checking version with `gstreamer-1.0 >= 1.12` works fine for me 🤔)

I'd like to send this PR and ask bors to try to see if this will also work for other platform.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23015
- [x] These changes do not require tests because it tries to fix building issue

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23069)
<!-- Reviewable:end -->
@CYBAI
Copy link
Member

CYBAI commented Mar 21, 2019

@josephhutch @Feliix42 Could you help me try if this patch also works for you? Thanks!

Btw, maybe it's good to ./mach clean to have a clean environment and build it again, thanks!

diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py
index c7060b3888..6456f1a075 100644
--- a/python/servo/bootstrap.py
+++ b/python/servo/bootstrap.py
@@ -46,7 +46,7 @@ def install_trusty_deps(force):
 
 
 def check_gstreamer_lib():
-    return subprocess.call(["pkg-config", "gstreamer-1.0 >= 1.12"],
+    return subprocess.call(["pkg-config", "--atleast-version=1.12", "gstreamer-1.0"],
                            stdout=PIPE, stderr=PIPE) == 0

@Feliix42
Copy link

Feliix42 commented Mar 21, 2019

This patch also works, but only if I set -gx PKG_CONFIG_PATH "/usr/local/opt/libffi/lib/pkgconfig" in my fish, as suggested from running brew info libffi (which fixes the second issue I had). Otherwise, the build will not start.

It might be a good idea to include a note for this in the readme.

@CYBAI
Copy link
Member

CYBAI commented Mar 21, 2019

This patch also works, but only if I set -gx PKG_CONFIG_PATH "/usr/local/opt/libffi/lib/pkgconfig" in my fish, as suggested from running brew info libffi (which fixes the second issue I had). Otherwise, the build will not start.

It might be a good idea to include a note for this in the readme.

Interesting. I just checked my PKG_CONFIG_PATH and it's /usr/local/opt/expat/lib/pkgconfig.

Maybe setting PKG_CONFIG_PATH is required?

Also, thanks for helping to check the patch works.

bors-servo pushed a commit that referenced this issue Mar 25, 2019
Compare gstreamer version via `pkg-config --modversion` in bootstrap python script

Not sure why calling `["pkg-config", "gstreamer-1.0 >= 1.12"]` did not work for some people on Mojave. (Btw, I'm also on Mojave but checking version with `gstreamer-1.0 >= 1.12` works fine for me 🤔)

I'd like to send this PR and ask bors to try to see if this will also work for other platform.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23015
- [x] These changes do not require tests because it tries to fix building issue

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23069)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Mar 26, 2019
Compare gstreamer version via `pkg-config --modversion` in bootstrap python script

Not sure why calling `["pkg-config", "gstreamer-1.0 >= 1.12"]` did not work for some people on Mojave. (Btw, I'm also on Mojave but checking version with `gstreamer-1.0 >= 1.12` works fine for me 🤔)

I'd like to send this PR and ask bors to try to see if this will also work for other platform.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23015
- [x] These changes do not require tests because it tries to fix building issue

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23069)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Mar 26, 2019
Compare gstreamer version via `pkg-config --modversion` in bootstrap python script

Not sure why calling `["pkg-config", "gstreamer-1.0 >= 1.12"]` did not work for some people on Mojave. (Btw, I'm also on Mojave but checking version with `gstreamer-1.0 >= 1.12` works fine for me 🤔)

I'd like to send this PR and ask bors to try to see if this will also work for other platform.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23015
- [x] These changes do not require tests because it tries to fix building issue

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23069)
<!-- Reviewable:end -->
@Axighi
Copy link

Axighi commented Mar 28, 2019

I just pulled the master, still have this problem.
pkg-config --modversion gstreamer-1.0 results 1.14.4

@CYBAI
Copy link
Member

CYBAI commented Mar 28, 2019

Could you check if there's any set PKG_CONFIG_PATH in your environment?

@Axighi
Copy link

Axighi commented Mar 28, 2019

Could you check if there's any set PKG_CONFIG_PATH in your environment?

It's empty. So I did export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig", the problem remains.

@Axighi
Copy link

Axighi commented Apr 3, 2019

Maybe setting PKG_CONFIG_PATH is required?

Yes. It's required.

bors-servo pushed a commit that referenced this issue Apr 7, 2019
Add a note to indicate PKG_CONFIG_PATH required

I just got the error messages like #23015 again and then I think the root cause should be about
`PKG_CONFIG_PATH`. After following #23015 (comment) said, I can build Servo successfully.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because this just updates README.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23175)
<!-- Reviewable:end -->
@luisbg
Copy link
Contributor

luisbg commented May 15, 2019

I also had to do the subprocess.check_output change above to make it work with git master.

@mrwonko
Copy link

mrwonko commented Jun 6, 2019

I had to export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig:/usr/local/lib/pkgconfig/" to make it work, merely adding the libffi pkgconfig was insufficient…

@o0Ignition0o
Copy link
Contributor

Fwiw I just ran into the same issue, and did what @mrwonko suggested. It allowed me to start the build but I ran into an other error:

error: failed to run custom build command for `gstreamer-sdp-sys v0.8.0`

Caused by:
  process didn't exit successfully: `/Users/ignition/Projects/mozilla/servo/target/debug/build/gstreamer-sdp-sys-1cd0ac0217628654/build-script-build` (exit code: 1)
--- stderr
`"pkg-config" "--libs" "--cflags" "gstreamer-sdp-1.0 >= 1.8"` did not exit successfully: exit code: 1
--- stderr
Package gstreamer-sdp-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-sdp-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gstreamer-sdp-1.0' found

I then did what the Gstreamer install documentation says and it worked.

The path they provide is the following:

export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Related to or part of the build process P-mac Any version of MacOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants