Closed ntop001 closed 1 year ago
It seems pip3 install gyp-next
will not install gyp command(only install packages), use pipx install gyp-next
will install gyp command, But it still don't work:
rm -Rf /Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release/lib/*.dylib
NSPR [1/5] configure ...
NSPR [2/5] make ...
NSPR [3/5] NOT building tests
NSPR [4/5] NOT running tests
NSPR [5/5] install ...
gmake: *** [Makefile:211: /Users/ntop/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release/lib/libnss_static.a] Error 1
Still can not find libnss_static.a
file at the path.
Hi,
Unfortunately I don't have access to a MacBook at the moment. Can you please run the following steps to help me understand the problem?
configure
scriptMakefile
that it creates. Change the following line:
./build.sh -o --disable-tests --static --python=python3
to
./build.sh -v -o --disable-tests --static --python=python3
(add the -v
flag)
@lwthiker Sir, here is the log:
tar xf nss-3.77.tar.gz
# Native build, use NSS' build script.
cd nss-3.77/nss
./build.sh -v -o --disable-tests --static --python=python3
# Hack for macOS: Remove dynamic libraries to force the linker to use the
# static ones when linking curl.
rm -Rf /Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release/lib/*.dylib
run_scanbuild gyp -f ninja --depth=/Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/nss --generator-output=. -Ddisable_tests=1 -Dstatic_libs=1 -Dpython=python3 -Dtarget_arch=arm64 -Denable_sslkeylogfile=1 -Dnss_dist_dir=/Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist -Dnss_dist_obj_dir=/Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release -Dnspr_include_dir=/Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release/include/nspr -Dnspr_lib_dir=/Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release/lib /Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/nss/nss.gyp
Exception: invalid mode: 'rU'
Traceback (most recent call last):
File "/Users/ntopliu/.local/pipx/venvs/gyp-next/lib/python3.11/site-packages/gyp/input.py", line 534, in CallLoadTargetBuildFile
result = LoadTargetBuildFile(
^^^^^^^^^^^^^^^^^^^^
File "/Users/ntopliu/.local/pipx/venvs/gyp-next/lib/python3.11/site-packages/gyp/input.py", line 411, in LoadTargetBuildFile
build_file_data = LoadOneBuildFile(
^^^^^^^^^^^^^^^^^
File "/Users/ntopliu/.local/pipx/venvs/gyp-next/lib/python3.11/site-packages/gyp/input.py", line 239, in LoadOneBuildFile
build_file_contents = open(build_file_path, "rU").read()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU'
gmake: *** [Makefile:211: /Users/ntopliu/workspace/GithubProjects/curl-impersonate/build/nss-3.77/dist/Release/lib/libnss_static.a] Error 1
Looks like a problem with gyp. It doesn't work with Python 3.11. I reproduced the same error on Debian when using the latest Python version.
As a temporary solution try installing Python 3.10 instead. For a permanent fix, I'll have to figure something out.
@lwthiker Yes, sir. I'll try later.
@lwthiker Sir, good news, I have successfully build it. This is what I do:
Go to /Users/ntopliu/.local/pipx/venvs/gyp-next/lib/python3.11/site-packages/gyp/input.py"
file, change if sys.platform == "zos":
to if PY3 or sys.platform == "zos":
.
then the python will build(fix the rU error).
Then I come cross another problem: env: python: No such file or directory
. It seems no python command(but I have python3 installed by system), I create a soft-link: ln -s /usr/bin/python3 /usr/bin/python
, this'll fix the problem.
Then I come another another problem: python: error: Failed to locate 'python'
, this problem have something to do with the Xcode, after some searching, found this: https://stackoverflow.com/questions/72345515/mac-os12-4-python-error-failed-to-locate-python. just created another soft-link:
ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Applications/Xcode.app/Contents/Developer/usr/bin/python
Then all is fine!!! It works!!! It seems all the fucking things come from Mac OS and it's default python installation.
I am having the same problem on AlmaLinux 8. make firefox-build error output. I have to compile due to glibc 2.2 use.
Native build, use NSS' build script. cd nss-3.77/nss ./build.sh -o --disable-tests --static --python=python3 Hack for macOS: Remove dynamic libraries to force the linker to use the static ones when linking curl. rm -Rf curl-impersonate/build/nss-3.77/dist/Release/lib/*.dylib NSPR [1/5] configure ... NSPR [2/5] make ... NSPR [3/5] NOT building tests NSPR [4/5] NOT running tests NSPR [5/5] install ... make: *** [Makefile:211: curl-impersonate/build/nss-3.77/dist/Release/lib/libnss_static.a] Error 245
Sir, I follow the guide: https://github.com/lwthiker/curl-impersonate/blob/main/INSTALL.md#macos to build source code on MacBook air - m2 chip. All is ok until running gmake, here is the logs:
I searched the directory
nss-3.77/dist/Release/lib/
there is nolibnss_static.a
:I don't know what happened and how can I fix it.
I also installed the gyp.