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

AttributeError: 'list' object has no attribute 'split' #957

Closed
doadin opened this issue May 31, 2023 · 30 comments · Fixed by #958
Closed

AttributeError: 'list' object has no attribute 'split' #957

doadin opened this issue May 31, 2023 · 30 comments · Fixed by #958

Comments

@doadin
Copy link
Contributor

doadin commented May 31, 2023

Running

gvsbuild build --platform=x64 --vs-ver=17 --enable-gi --py-wheel --skip gtksourceview4,emeus,clutter gtk3-full pycairo pygobject lz4 enchant

The same command I used like a year ago to build successfully I am now getting error:

`

+--------------------- Traceback (most recent call last) ---------------------+
| C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\gvsbuild\bu |
| ild.py:419 in build |
| |
| 416 pv = f"'{v}'" if type(v) is str else repr(v) |
| 417 log.message_indent(f"'{co}': {pv}, ") |
| 418 builder = Builder(opts) |
| > 419 builder.preprocess() |
| 420 |
| 421 to_build = __get_projects_to_build(opts) |
| 422 if not to_build: |
| |
| +-------------------------------- locals ---------------------------------+ |
| | archives_download_dir = WindowsPath('C:/gtk-build/src') | |
| | build_dir = WindowsPath('C:/gtk-build') | |
| | builder = <gvsbuild.utils.builder.Builder object | |
| | at 0x00000252357FDC00> | |
| | capture_out = False | |
| | cargo_opts = None | |
| | check_hash = False | |
| | clean = False | |
| | clean_built = False | |
| | configuration = <Configuration.debug_optimized: | |
| | 'debug-optimized'> | |
| | debug = False | |
| | deps = True | |
| | enable_gi = True | |
| | export_dir = None | |
| | fast_build = False | |
| | ffmpeg_enable_gpl = False | |
| | from_scratch = False | |
| | git_expand_dir = None | |
| | keep_going = False | |
| | keep_tools = False | |
| | log_single = False | |
| | log_size = 0 | |
| | make_zip = False | |
| | msbuild_opts = None | |
| | msys_dir = None | |
| | net_target_framework = None | |
| | net_target_framework_version = None | |
| | ninja_opts = None | |
| | opts = <gvsbuild.utils.base_project.Options | |
| | object at 0x0000025235AC9FF0> | |
| | p = 'enchant' | |
| | patches_root_dir = WindowsPath('C:/hostedtoolcache/windows� | |
| | platform = <Platform.x64: 'x64'> | |
| | print_out = False | |
| | projects = [ | |
| | 'gtk3-full', | |
| | 'pycairo', | |
| | 'pygobject', | |
| | 'lz4', | |
| | 'enchant' | |
| | ] | |
| | prop_file = WindowsPath('C:/hostedtoolcache/windows� | |
| | py_wheel = True | |
| | skip = ['gtksourceview4,emeus,clutter'] | |
| | tools_root_dir = None | |
| | use_env = False | |
| | verbose = False | |
| | vs_install_path = None | |
| | vs_ver = <VsVer.vs2022: '17'> | |
| | win_sdk_ver = None | |
| | zip_continue = False | |
| +-------------------------------------------------------------------------+ |
| |
| C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\gvsbuild\ut |
| ils\builder.py:470 in preprocess |
| |
| 467 proj.clean = True |
| 468 |
| 469 for proj in Project.list_projects(): |
| > 470 self.__compute_deps(proj) |
| 471 log.debug(f"{proj.name} => {[d.name for d in proj.all_de |
| 472 |
| 473 def __compute_deps(self, proj): |
| |
| +-------------------------------- locals ---------------------------------+ |
| | archive = 'go1.20.4.windows-amd64.zip' | |
| | proj = 'dev-shell' | |
| | self = <gvsbuild.utils.builder.Builder object at 0x00000252357FDC00> | |
| | url = 'https://go.dev/dl/go1.20.4.windows-amd64.zip' | |
| +-------------------------------------------------------------------------+ |
| |
| C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\gvsbuild\ut |
| ils\builder.py:482 in __compute_deps |
| |
| 479 for p in dep.all_dependencies: |
| 480 deps.add(p) |
| 481 deps.add(dep) |
| > 482 proj.finalize_dep(self, deps) |
| 483 proj.all_dependencies = deps |
| 484 |
| 485 def _drop_proj(self, drop_prj): |
| |
| +------------------------------- locals -------------------------------+ |
| | dep = 'tools' | |
| | deps = { | |
| | 'cargo', | |
| | 'cmake', | |
| | 'go', | |
| | 'meson', | |
| | 'msys2', | |
| | 'nasm', | |
| | 'ninja', | |
| | 'perl', | |
| | 'tools' | |
| | } | |
| | p = 'perl' | |
| | proj = 'dev-shell' | |
| | self = <gvsbuild.utils.builder.Builder object at 0x00000252357FDC00> | |
| +----------------------------------------------------------------------+ |
| |
| C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\gvsbuild\pr |
| ojects\dev_shell.py:46 in finalize_dep |
| |
| 43 |
| 44 def finalize_dep(self, builder, deps): |
| 45 if builder.opts.skip: |
| > 46 skip = builder.opts.skip.split(",") |
| 47 for s in skip: |
| 48 p = Project.get_project(s) |
| 49 if p in deps: |
| |
| +-------------------------------- locals ---------------------------------+ |
| | builder = <gvsbuild.utils.builder.Builder object at 0x00000252357FDC00> | |
| | deps = { | |
| | 'cargo', | |
| | 'cmake', | |
| | 'go', | |
| | 'meson', | |
| | 'msys2', | |
| | 'nasm', | |
| | 'ninja', | |
| | 'perl', | |
| | 'tools' | |
| | } | |
| | self = 'dev-shell' | |
| +-------------------------------------------------------------------------+ |
+-----------------------------------------------------------------------------+
AttributeError: 'list' object has no attribute 'split'

`

@danyeaw
Copy link
Member

danyeaw commented Jun 1, 2023

Hi @doadin, try using spaces between the project names with no commas

@doadin
Copy link
Contributor Author

doadin commented Jun 1, 2023

@danyeaw
Copy link
Member

danyeaw commented Jun 1, 2023

Got it, thanks! I can reproduce this, I missed that you were using the --skip option last evening.

I opened a PR to fix this, I think you'll need to reorganize the options you put in, like:

> gvsbuild build --enable-gi --py-wheel gtk3-full pycairo pygobject lz4 enchant --sk
ip gtksourceview4 emeus clutter gtk3-full pycairo pygobject lz4 enchant

or

> gvsbuild build --skip gtksourceview4 emeus clutter --enable-gi --py-wheel gtk3-full pycairo pygobject lz4 enchant

@doadin
Copy link
Contributor Author

doadin commented Jun 1, 2023

Thanks for this, it now builds further but I am running into another issue.
https://github.com/doadin/gvsbuild-release/actions/runs/5149056649/jobs/9271570707

@doadin
Copy link
Contributor Author

doadin commented Jun 1, 2023

I should probabbly make a new Issue for this but I see, https://github.com/mesonbuild/meson/blob/master/mesonbuild/compilers/c.py#L487 that in the log and
53753e7

Maybe theres was something missing in changing to meson?

@danyeaw
Copy link
Member

danyeaw commented Jun 1, 2023

Hi @doadin, you need to move the Git/bin folder out of the way that is on the GitHub Actions runner:

- name: GTK binaries move git binary
  run: |
    move "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin"
    move "C:\Program Files\Git\bin" "C:\Program Files\Git\notbin"

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw ok, I had:

`

  - name: Move git binary
    # Temporarily move preinstalled git to prevent errors related to cygwin.
    run: Rename-Item "C:\Program Files\Git\usr\bin" notbin

`

so was missing the other part I guess. Thanks! testing now.

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw
Copy link
Member

danyeaw commented Jun 2, 2023

@doadin It looks like Cogl is failing. I saw you were skipping Clutter, do you need Cogl?

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw Im just building gtk for use with deluge, I dont think it uses either. I was just trying to update my build, is this a build issue for gvsbuild or cogl?

@danyeaw
Copy link
Member

danyeaw commented Jun 2, 2023

It is a cogl issue. Our CI, builds the following things:

gvsbuild build --ninja-opts -j2 gtk3 gtksourceview4 graphene glib-networking
gvsbuild build --ninja-opts -j2 --enable-gi cairo gtk4 libadwaita gtksourceview5 gobject-introspection adwaita-icon-theme hicolor-icon-theme

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw ah, and the link to cogl goes to a gitlab that is "Archived" and hasnt been updated in 2 years so I guess thats never getting fixed.

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw I am probabbly just missing something but I tried to add to skip and it did NOT skip.

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw
Copy link
Member

danyeaw commented Jun 2, 2023

It looks like it is not possible to pass a list of optional values in with Typer which is the library we are using: tiangolo/typer#554

It is possible to call it each time though it looks like, and I verified that it dropped both:

> gvsbuild build --skip cogl --skip gtksourceview4 gtk3-full

Or you could also just explicitly call out the libraries you want to build and avoid using the gtk3-full group. I'll update the help menu and README to make this clearer.

@doadin
Copy link
Contributor Author

doadin commented Jun 2, 2023

@danyeaw ok I will test this. Thank you, helping me along here. All I know is the build process was successful Jun 13, 2022. I tried to re-run same github action this week and it failed. SO what happened between then and now and why I am just trying. :)

@doadin
Copy link
Contributor Author

doadin commented Jun 3, 2023

@danyeaw yea the multiple skips seems to work but got another error for librsvg. Probabbly should just choose what part I need instead of full, would probabbly be easier.

@danyeaw
Copy link
Member

danyeaw commented Jun 3, 2023

Ya, I ran in to that error with librsvg today as well. I submitted an issue upstream: https://gitlab.gnome.org/GNOME/librsvg/-/issues/968

@doadin
Copy link
Contributor Author

doadin commented Jun 7, 2023

@danyeaw I saw the fixes merged so I tried a build again:

gvsbuild build --skip gtksourceview4 --skip emeus --skip clutter --skip cogl --configuration=release --platform=x64 --vs-ver=16 --enable-gi --py-wheel gtk3-full pycairo pygobject lz4 enchant

https://github.com/doadin/gvsbuild-release/actions/runs/5205425769/jobs/9390855310

@doadin
Copy link
Contributor Author

doadin commented Jun 7, 2023

@danyeaw so i started reducing down the command trying to see where this non-project is maybe getting put in and it seems like its just a problem parseing the skips maybe? with the above command it said cant find project c . Once I got it down to just

gvsbuild build --skip gtksourceview4 --skip emeus --configuration=release --platform=x64 --vs-ver=16 --enable-gi --py-wheel gtk3

It says can not find project e . Notice the last skip does not start with c and now starts with e .

@doadin
Copy link
Contributor Author

doadin commented Jun 7, 2023

@danyeaw sorry last @ gvsbuild build --platform=x64 --vs-ver=16 --enable-gi --py-wheel gtk3 pycairo pygobject lz4 enchant works so fairly positive I have narrowed it down to the skip option is still broke but in a different way :(

@doadin
Copy link
Contributor Author

doadin commented Jun 7, 2023

Unfortunately while the build gets far without skips, still fails:
https://github.com/doadin/gvsbuild-release/actions/runs/5205711137/jobs/9391460212

the is filled with lines like:

C compiler for the host machine: cl (msvc 19.29.30148 "Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30148 for x86") C linker for the host machine: link link 14.29.30148.0 Host machine cpu family: x86 Host machine cpu: x86

so idk how it is "finding" x86_64

@danyeaw
Copy link
Member

danyeaw commented Jun 9, 2023

Hi @doadin, for the last one it looks like you are trying to build with win32, but meson is finding x64 version of Python.

It may be possible to pass in the path of python as a meson option to pycairo using the python -m build --config-setting -Dpython=C:\path\to\python. However, it may just be easier to remove versions of Python you don't want to use off your Path in CI.

@danyeaw
Copy link
Member

danyeaw commented Jun 9, 2023

gvsbuild build --skip gtksourceview4 --skip emeus --skip clutter --skip cogl --configuration=release --platform=x64 --vs-ver=16 --enable-gi --py-wheel gtk3-full pycairo pygobject lz4 enchant

https://github.com/doadin/gvsbuild-release/actions/runs/5205425769/jobs/9390855310

I fixed this in d29bbce

@doadin
Copy link
Contributor Author

doadin commented Jun 9, 2023

@danyeaw yea I am not sure what the path looks like I am using setup-python action to manage python. Which seems like it puts the right python in place from my tests. But im not sure.

@doadin
Copy link
Contributor Author

doadin commented Jun 9, 2023

@danyeaw nvm I see a different python on path. Weird that setup-python doesnt already remove others?

@doadin
Copy link
Contributor Author

doadin commented Jun 9, 2023

@danyeaw
Copy link
Member

danyeaw commented Jun 9, 2023

The runner comes with Python 3.9 installed before you run setup-python. https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#language-and-runtime

This looks like a limitation of meson to me. If there are multiple versions of Python, it may not choose the Python that meson was run with. Setup-python looks like it is changing the default python, but it doesn't remove other versions on the path.

@doadin
Copy link
Contributor Author

doadin commented Jun 9, 2023

@danyeaw yea in the trace you can see it is being run from a different python than meson "found" and just running a python command you can see it running with the python version added by setup-python action. Im not sure how to remove the others from path but Ill figure it out. Thanks for the other fix!

@doadin
Copy link
Contributor Author

doadin commented Jun 9, 2023

@danyeaw well looks like removing all other python from path did not work.
https://github.com/doadin/gvsbuild-release/actions/runs/5219121735/jobs/9420597840

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

Successfully merging a pull request may close this issue.

2 participants