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

Mini-racer installation fails during wheel building phase #76

Open
chipilov opened this issue Sep 10, 2024 · 1 comment
Open

Mini-racer installation fails during wheel building phase #76

chipilov opened this issue Sep 10, 2024 · 1 comment

Comments

@chipilov
Copy link

chipilov commented Sep 10, 2024

Steps to reproduce

  1. Add mini-racer 0.7.0 to the pyproject.toml file of a project
  2. Run poetry install -v

Expected behavior

mini-racer is installed successfully.

Actual behavior

mini-racer fails during its wheel building step with the following error:

#9 474.0   Traceback (most recent call last):
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/metrics.py", line 302, in print_notice_and_exit
#9 474.0       yield
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient.py", line 4638, in <module>
#9 474.0       sys.exit(main(sys.argv[1:]))
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient.py", line 4624, in main
#9 474.0       return dispatcher.execute(OptionParser(), argv)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/subcommand.py", line 254, in execute
#9 474.0       return command(parser, args[1:])
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient.py", line 3977, in CMDsync
#9 474.0       ret = client.RunOnDeps('update', args)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient.py", line 2436, in RunOnDeps
#9 474.0       work_queue.flush(revision_overrides,
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient_utils.py", line 1026, in flush
#9 474.0       reraise(e[0], e[1], e[2])
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient_utils.py", line 53, in reraise
#9 474.0       raise value
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient_utils.py", line 1105, in run
#9 474.0       self.item.run(*self.args, **self.kwargs)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient.py", line 1[251](https://gitlab.com/hades-ai/frontend/-/jobs/7787882868#L251), in run
#9 474.0       self._got_revision = self._used_scm.RunCommand(
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient_scm.py", line 137, in RunCommand
#9 474.0       return getattr(self, command)(options, args, file_list)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient_scm.py", line 664, in wrapper
#9 474.0       return_val = f(*args)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/v8_workspace/depot_tools/gclient_scm.py", line 866, in update
#9 474.0       strp_current_url = current_url[:-4] if current_url.endswith(
#9 474.0   AttributeError: 'NoneType' object has no attribute 'endswith'
#9 474.0   Traceback (most recent call last):
#9 474.0     File "/usr/local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
#9 474.0       main()
#9 474.0     File "/usr/local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
#9 474.0       json_out["return_val"] = hook(**hook_input["kwargs"])
#9 474.0     File "/usr/local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 271, in build_wheel
#9 474.0       return _build_backend().build_wheel(
#9 474.0     File "/tmp/tmp5w6ba2rx/.venv/lib/python3.10/site-packages/hatchling/build.py", line 58, in build_wheel
#9 474.0       return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
#9 474.0     File "/tmp/tmp5w6ba2rx/.venv/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py", line 147, in build
#9 474.0       build_hook.initialize(version, build_data)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/hatch_build.py", line 24, in initialize
#9 474.0       artifacts = build_v8(out_path="src/py_mini_racer")
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/helpers/v8_build.py", line 389, in build_v8
#9 474.0       ensure_v8_src(revision)
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/helpers/v8_build.py", line 209, in ensure_v8_src
#9 474.0       run(
#9 474.0     File "/tmp/tmpi7mv33o8/mini_racer-0.7.0/helpers/v8_build.py", line 163, in run
#9 474.0       return check_call(args, env=env, cwd=cwd)
#9 474.0     File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
#9 474.0       raise CalledProcessError(retcode, cmd)

System configuration

PyMiniRacer version:
0.7.0

Python version:
3.10

@chipilov
Copy link
Author

chipilov commented Sep 10, 2024

Given that the crash occurs due to a None object on this line: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main/gclient_scm.py#:~:text=strp_current_url%20%3D%20current_url%5B%3A%2D4%5D%20if%20current_url.endswith(

...I have confirmed that the root cause of the crash is this change: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/eb0cb70185bf50f89b7b51beaf12c8d97009fdc5%5E%21/#F1:~:text=%2B%20%20%20%20%20%20%20%20if%20not%20scope%3A,values%3A%0A%2B%20%20%20%20%20%20%20%20%20%20%20%20return%20default?

The following patch works around the issue by checkout out a previous version of depot_tools which does NOT cause this error: https://github.com/chipilov/PyMiniRacer-depot_tools_patch/blob/depot_tools_patch/helpers/v8_build.py#L182

The root cause might need to be fixed in the depot_tools repo but maybe the version of depot_tools that is getting pulled here can be parameterized somehow OR fixed to a specific working version of depot_tools and updated only after being tested (instead of pulling the latest version every time)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant