Skip to content

Added travis script to build and run jerryscript with zephyr #1144

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

Closed

Conversation

Akromx16
Copy link

Travis will build jerryscript against zephyr and run the "test" command in the virtual console, using named pipe. The output is directed to log.txt which is then checked to see if the command was successfull.

JerryScript-DCO-1.0-Signed-off-by: Adrian Moldovan [email protected]

JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez [email protected]
@LaszloLango LaszloLango added development Feature implementation tools Related to the tooling scripts jerry-port Related to the port API or the default port implementation labels Jun 15, 2016
kill %1
cat log.txt
if grep "Hi JS World!" log.txt > /dev/null; then echo -e "\n\nQapla'! (it means \"Success\" in Klingon)"; else echo -e "\n\nScript has failed"; fi
grep "Hi JS World!" log.txt > /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make this file more readable. Add some comment and empty line, break long lines where you can, etc. I'd rename this file, because it not just builds zephyr (ex.: build-and-test-zephyr-target.sh).

@LaszloLango
Copy link
Contributor

Nice work! I think we can merge it soon.

@Akromx16 Akromx16 force-pushed the wip/adrian_travis branch from 3deb788 to 41edab3 Compare June 15, 2016 11:31

# run the qemu executable in background using the named pipes
./zephyr/zephyr_sdk/sysroots/i686-pokysdk-linux/usr/bin/qemu-system-i386 -m 32 \
-cpu qemu32 -no-reboot -nographic -vga none -display none -net none -clock dynticks \
Copy link
Contributor

Choose a reason for hiding this comment

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

I bit nitpicky, but please indent these lines. It makes it more readable.

@Akromx16 Akromx16 force-pushed the wip/adrian_travis branch from 41edab3 to d80b394 Compare June 16, 2016 11:04
@Akromx16
Copy link
Author

Thank you for the feedback! I didn't know the PR gets updated automatically once I push to my branch, sometimes I just wanted to push so travis could build to check if it works, without having the final release ready. I believe I should close the PR now and reopen it once I finish completly.

@LaszloLango
Copy link
Contributor

LaszloLango commented Jun 16, 2016

@Akromx16, if you want to test the travis build, then you can enable travis for your own fork too. So when you push a new commit to any of your branches, travis will test it. You don't have to open a PR for that. But I think it is ok to keep this open. Let us know when it is ready for review. :)

@Akromx16
Copy link
Author

Yes, that is what I am doing, I am pushing on my own fork, it's just that the PR gets updated everytime I push, (even if sometimes it was for testing travis purposes, and not a final release).

@Akromx16 Akromx16 force-pushed the wip/adrian_travis branch 5 times, most recently from 5cb8ab5 to 4a90a9a Compare June 16, 2016 15:34
Travis will build jerryscript against zephyr and run the "test"
command in the virtual console, using named pipe. The output is
directed to log.txt which is then checked to see if the command was
successfull.

JerryScript-DCO-1.0-Signed-off-by: Adrian Moldovan [email protected]
@Akromx16 Akromx16 force-pushed the wip/adrian_travis branch from 4a90a9a to 9b1e003 Compare June 16, 2016 16:11
@Akromx16
Copy link
Author

@LaszloLango @zherczeg I have my PR finished, with the changes that I could implement. There were some things that broke and I spend quite some time finding out what the problems were. I believe the zephyr sdk changed as well and caused my build to break (i wasn't changing the branch before so implicitly it was going to master). Thanks for all the feedback, and I will make more changes if there are needed.

@zherczeg
Copy link
Member

LGTM However, we might need help for fixing zephyr failures.

@akosthekiss
Copy link
Member

Sorry for joining the conversation a bit late, I've been OoO for a longer period. I've objections, which I'd like to discuss / get answer for:

  • The tools/build.sh is quite monolithic now. It does prerequisites/dependencies installation, building, and testing in one. This is no good. Those deps which can be instaled via system package managers are already handled OK (tools/apt-get-install-*) but those that need other handling should also be separated. The key point is that this "other" install script should not only be useful for Travis CI but developers as well. And devs don't want to run installation at every build. The tools/prerequisites.sh can be a template. Right now, that's used for the setup of STM32 board dependencies. So, please create something similar for zephyr as well.
  • There is an "interesting" line in build-zephyr.sh: sudo ln -s /usr/include/asm-generic /usr/include/asm. Everything else works in the local directory structure but this one is disturbingly global. Why is this needed? Is this needed on all linux variants? I'd be reloctant to fiddle with my global include dir structure.
  • Where are the deps (e.g., zephyr repo, sdk) installed? They shouldn't pollute the main directory of jerry. Other targets (STM32, again) install their deps into the third-party directory. Please, follow that pattern.
  • The testing should not happen in the build script either. Moreover: why is it not possible to run the official tests for checking the correctness of the build?
  • The make target pattern proposed in this PR does not align with the targets already used. build.xxx normally builds all variants (debug and release, all profile variants, etc) for that "xxx" target. And there are targets for all these variants separately as well. build-zephyr doesn't really fit this model.

@sergioamr
Copy link
Contributor

@akosthekiss @Akromx16 will go back to university soon and i am not sure he will be able to finish this PR with all those changes. Is it something you could help him with so we get this integration finish? 👯

@pfalcon
Copy link
Contributor

pfalcon commented Jul 8, 2016

Moreover: why is it not possible to run the official tests for checking the correctness of the build?

This is good question I myself would like to find answer to - does jerryscript has any infrastructure to run its testsuite on an embedded target? I posted that question to the recently created mailing list: https://mail.gna.org/public/jerryscript-dev/2016-07/msg00000.html . @akosthekiss: If you could shed some light on that, it would be appreciated!

@pfalcon
Copy link
Contributor

pfalcon commented Jul 8, 2016

@sergioamr, @Akromx16 : If nobody else beats me to it, then it's in my backlog ;-). But given concerns raised above, I guess I'd take this PR as a known-working reference, but would try to re-implement it myself trying to make as little changes to existing jerryscript CI structure as possible.

My biggest concern however is it may be a bit heavy "gift" fro jerryscript project - majority of runtime here will (likely) be downloading of Zephyr dependencies, and that may skew JerryScript CI responsiveness. And of course, these dependencies need maintenance (update Zephyr SDK downlaod link, etc.) I'd personally be a bit shy to propose such addition right away, how I do it for the other projects is to set up a separate fork and update it manually. If it proves useful and maintained over some time (couple of months, half-year), then it's a good argumentation to burden upstream with it ;-).

@sergioamr
Copy link
Contributor

@pfalcon That is actually a very good suggestion, i didn't think on the heavy work that updating sdks and keeping it current could be for the Jerryscript project. For me to create a new repository with a new open project would also involve to go through a heavy internal process of open sourcing. That would be more work than actually keeping this code running :D

@LaszloLango
Copy link
Contributor

I didn't get any mail from the mailing list, but I'm subscribed. Is it just me?

@pfalcon
Copy link
Contributor

pfalcon commented Jul 8, 2016

For me to create a new repository with a new open project would also involve to go through a heavy internal process of open sourcing.

Fortunately, on github, it's just a click of a "Fork" button, the only trouble then is to make sure to update to upstream regularly (and that's when you push new commits to your fork is when CI on it triggers).

@pfalcon
Copy link
Contributor

pfalcon commented Jul 8, 2016

I didn't get any mail from the mailing list, but I'm subscribed. Is it just me?

Just in case, I sent it last night (EU time). And according to the archive, it's a second message in the ML, after "hello" one last month. So, maybe check spam folder...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Feature implementation jerry-port Related to the port API or the default port implementation tools Related to the tooling scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants