Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Emulator support #268

Merged
merged 10 commits into from
Dec 18, 2017
Merged

Emulator support #268

merged 10 commits into from
Dec 18, 2017

Conversation

saleemrashid
Copy link
Contributor

@saleemrashid saleemrashid commented Dec 13, 2017

Emulator support with SDL2 or headless mode, persistent flash and UDP transport.

@saleemrashid
Copy link
Contributor Author

Rebased. Device tests pass in 36 seconds on my laptop which is about 12 times faster than on a physical device.

@prusnak
Copy link
Member

prusnak commented Dec 18, 2017

This is really nice work! I am truly amazed!

One small nit, though. Does it make sense to move firmware/udp.c to emulator/udp.c? I would like to keep all emulator-specific stuff in this directory.

@saleemrashid
Copy link
Contributor Author

saleemrashid commented Dec 18, 2017

Does it make sense to move firmware/udp.c to emulator/udp.c?

I also thought about this but I came to the following conclusion. While it might be sensible to move some of it (for use in non-firmware parts), at least some of it should remain in firmware/ because I would like code from emulator/ to not depend on anything from firmware/ (in this case firmware/usb.h)

@saleemrashid
Copy link
Contributor Author

@prusnak I think this is an acceptable solution

- EMULATOR=1 HEADLESS=1
- DEBUG_LINK=1
before_script:
- sed -i '/hidapi/d' "vendor/python-trezor/requirements.txt"
Copy link
Member

@prusnak prusnak Dec 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python-trezor contains --disable-hidapi option in setup.py, maybe we can try using pip install with --install-option - I remember I was trying to use the same trick for trezor-core, but I failed, though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prusnak I tried that at least 5 different ways and gave up. 😆 pip will not pass provided options to ./setup.py egg_info which is what it uses to gather dependencies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, glad to know I am the only one who failed on this. Thanks :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prusnak There is an issue here but I don't imagine it will be fixed pypa/pip#4383

@prusnak prusnak merged commit 8fceb96 into trezor:master Dec 18, 2017
@prusnak
Copy link
Member

prusnak commented Dec 18, 2017

❤️

@saleemrashid saleemrashid deleted the emulator branch December 19, 2017 13:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants