mherrmann / fbs-tutorial

Tutorial for creating Python/Qt GUIs with fbs
https://build-system.fman.io
GNU General Public License v3.0
1.95k stars 161 forks source link

Migrate existing project from fbs<0.2.0 #17

Closed yzernik closed 5 years ago

yzernik commented 5 years ago

I have an exising project using fbs.

I recently tried updating the requirements, and noticed that it fails to build for fbs version >= 0.2.0:

(venv) jzernik@jonathans-mbp:~/work/squeakclient $ python -m fbs freeze
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/__main__.py", line 4, in <module>
    main()
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/cmdline.py", line 26, in main
    args.fn(*fn_args)
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/builtin_commands/__init__.py", line 93, in freeze
    freeze_mac(debug=debug)
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/freeze/mac.py", line 27, in freeze_mac
    _generate_resources()
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/freeze/__init__.py", line 49, in _generate_resources
    _copy(path_fn, 'src/main/resources/' + profile, resources_dest_dir)
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/resources.py", line 99, in _copy
    copy_with_filtering(src, dst, files_to_filter=filter_)
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/resources.py", line 29, in copy_with_filtering
    if files_to_filter is None or src in to_filter:
  File "/Users/jzernik/work/squeakclient/venv/lib/python3.6/site-packages/fbs/resources.py", line 91, in __contains__
    if p.samefile(item) or p in item.parents:
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pathlib.py", line 1066, in samefile
    st = self.stat()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pathlib.py", line 1156, in stat
    return self._accessor.stat(self)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/pathlib.py", line 387, in wrapped
    return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/jzernik/work/squeakclient/src/freeze/mac/Contents/Info.plist'

Is there any guide for migrating an existing project to latest fbs version?

mherrmann commented 5 years ago

Sorry for the trouble. fbs is still young and I take liberty to still change its API so future generations don't have to live with unnecessary old cruft.

To make this somewhat more bearable, I do my best to explain necessary migrations in the list of releases. I suggest you look at this list and work upwards from 0.2.0.

If you still run into trouble, do let me know. I'm happy to help.

Finally, please report issues at mherrmann/fbs/issues instead of here (the issue tracker of the tutorial).

mherrmann commented 5 years ago

Oh, and that particular error might have just been fixed by release 0.3.4.

yzernik commented 5 years ago

Thank you for the help.

I was able to get it working with just a few changes:

1) Remove the "resources_to_filter" field from src/build/settings/mac.json 2) Add the "version" field to src/build/settings/base.json 3) Add a new src/build/settings/linux.json file

mherrmann commented 5 years ago

Happy to hear it!

What's squeakclient? :)