brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.86k stars 2.34k forks source link

ModuleNotFoundError: No module named 'import_inline' #28430

Open yuppiestechdev opened 1 year ago

yuppiestechdev commented 1 year ago

Description

Gradle files not generated.

python3 ../../tools/grit/grit.py -i ../../remoting/resources/remoting_strings.grd build -o gen --depdir . --depfile gen/remoting/resources/strings_grit.d --write-only-new=1 --depend-on-stamp -D DEVTOOLS_GRD_PATH=gen/third_party/devtools-frontend/src/front_end/devtools_resources -D SHARED_INTERMEDIATE_DIR=gen -D _google_chrome=false -D _google_chrome_for_testing=false -D _use_internal_chrome_for_testing_icons=false -D chromeos_ash=false -D chromeos_lacros=false -D reven=false -D toolkit_views=false -D use_aura=false -D use_ozone=false -D use_titlecase=false -E root_gen_dir=gen -E root_src_dir=../../ -E CHROMIUM_BUILD=chromium -E ANDROID_JAVA_TAGGED_ONLY=true -t android -f gen/tools/gritsettings/default_resource_ids --assert-file-list obj/remoting/resources/remoting_strings_expected_outputs.txt
Traceback (most recent call last):
  File "../../tools/grit/grit.py", line 29, in <module>
    sys.exit(grit.grit_runner.Main(sys.argv[1:]))
  File "/src/brave-browser/src/tools/grit/grit/grit_runner.py", line 308, in Main
    toolobject = _GetToolInfo(tool)[_FACTORY]()
  File "/src/brave-browser/src/tools/grit/grit/grit_runner.py", line 26, in ToolFactoryBuild
    import grit.tool.build
  File "/src/brave-browser/src/tools/grit/grit/tool/build.py", line 21, in <module>
    from grit import grd_reader
  File "/src/brave-browser/src/tools/grit/grit/grd_reader.py", line 20, in <module>
    from grit.node import mapping
  File "/src/brave-browser/src/tools/grit/grit/node/mapping.py", line 13, in <module>
    from grit.node import empty
  File "/src/brave-browser/src/tools/grit/grit/node/empty.py", line 15, in <module>
    from grit.node import structure
  File "/src/brave-browser/src/tools/grit/grit/node/structure.py", line 22, in <module>
    import grit.gather.policy_json
  File "/src/brave-browser/src/tools/grit/grit/gather/policy_json.py", line 357, in <module>
    from import_inline import inline_file_from_src; inline_file_from_src("brave/chromium_src/tools/grit/grit/gather/policy_json.py", globals(), locals())
ModuleNotFoundError: No module named 'import_inline'

Steps to reproduce

  1. npm run build -- Debug --target_android_output_format=apk --goma_offline --gn=symbol_level:0 --gn=blink_symbol_level:0 --gn=v8_symbol_level:0 --gn=is_component_build:true --gn=is_debug:true
  2. ./src/build/android/gradle/generate_gradle.py --output-directory ./src/out/android_Debug_arm

Issue reproduces how often

Consistently

Version/Channel Information:

on master

OS

Linux

bigfoxtail commented 1 year ago

add brave\script to env PYTHONPATH

sangwoo108 commented 11 months ago

Hello, we seem to have a new way to generate gradle file. https://github.com/brave/brave-core/pull/19385