Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into sensiolabs-insight-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fpapadopou committed Jul 17, 2015
2 parents c1b4154 + 79f9b09 commit ffb82c6
Show file tree
Hide file tree
Showing 20 changed files with 1,698 additions and 597 deletions.
17 changes: 3 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,11 @@ before_install:
- sudo apt-get update

before_script:
- cd Symfony
- cp app/config/parameters.yml.dist app/config/parameters.yml
- composer install
- sudo apt-get install -y unzip
- sudo mkdir /opt/codebender
- wget https://github.com/codebendercc/arduino-core-files/archive/master.zip
- unzip master.zip
- sudo cp -r arduino-core-files-master /opt/codebender/codebender-arduino-core-files
- rm master.zip
- wget https://github.com/codebendercc/external_cores/archive/master.zip
- unzip master.zip
- sudo cp -r external_cores-master /opt/codebender/external-core-files

- scripts/install.sh
- cd /opt/codebender/compiler/Symfony
script:
- mkdir -p build/logs
- phpunit -c app/ --coverage-clover build/logs/clover.xml
- ../scripts/run_tests.sh

after_script:
- php composer.phar update satooshi/php-coveralls --dev
Expand Down
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
This repository is part of the [codebender.cc](http://www.codebender.cc) maker and artist web platform.

[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler) [![Coverage Status](https://img.shields.io/coveralls/codebendercc/compiler.svg)](https://coveralls.io/r/codebendercc/compiler?branch=master)
[![Build Status](https://travis-ci.org/codebendercc/compiler.svg?branch=master)](https://travis-ci.org/codebendercc/compiler)
[![Coverage Status](https://coveralls.io/repos/codebendercc/compiler/badge.svg?branch=master)](https://coveralls.io/r/codebendercc/compiler?branch=master)

## And what's that?

codebender comes to fill the need for reliable and easy to use tools for makers.
A need that from our own experience could not be totally fulfilled by any of the existing solutions. Things like installing libraries, updating the software or installing the IDE can be quite a painful process.
codebender fills the need for reliable, easy to use tools for makers, a need that couldn't be completely fulfilled by any existing solution according to our experience.

In addition to the above, the limited features provided (e.g. insufficient highlighting, indentation and autocompletion) got us starting building codebender, a completely web-based IDE, that requires virtually no installation and offers a great code editor. It also stores your sketches on the cloud.
Things like installing libraries or the IDE and updating software sometimes were (and still are) quite a painful process. But in addition to the above, the limited features provided (e.g. insufficient highlighting, indentation and autocompletion) got us to start codebender, a completely web-based IDE that requires virtually no installation and offers a great code editor. Plus it stores your sketches on the cloud. Yeah!

That way, you can still access your sketches safely even if your laptop is stolen or your hard drive fails! codebender also takes care of compilation, giving you extremely descriptive warnings on terrible code. On top of that, when you are done, you can upload your code to your Arduino straight from the browser.
With your code on the cloud, you can access your sketches safely even if your laptop is stolen or your hard drive fails! codebender also compiles your code giving you extremely descriptive error descriptions on terrible code. There's even more, you can upload your code to your Arduino straight from the browser.

## How does the compiler come into the picture?

The compiler repository includes all the necessary files needed to run the compiler as a service. It receives the code as input and outputs the errors in the code, or the compiled output if the compilation was successful. We provide a really easy to use interface to allow us to send the code to the compiler easily.
The compiler repository includes all the necessary files needed to run the compiler as a service. It receives the code as input and outputs the compiled output if the compilation was successful or the errors present in the code. We provide an easy interface to send the code to the compiler.

Here's a list of open source projects we use
* Clang
* gcc-avr
* avr binutils (avrsize)

For development, we've used it on a variety of Linux and Mac OS X machines.
For development we've run it on a variety of Linux and Mac OS X machines.

For production, we are using Ubuntu Server 12.04, and we know it works perfectly with that, so we suggest using that as well.
For production we are using Ubuntu Server 12.04. We know the compiler works perfectly on it, so we suggest you using it as well.

## How to install

Check out the code in any directory you wish

`git clone https://github.com/codebendercc/compiler.git`

Then cd in the created directory (if you run the command as is above, it would be named `compiler`) and run

`scripts/install.sh`

(don't cd into scripts directory and run install.sh from there, it won't work)

If you now visit `http://localhost/status` you'll see a JSON response telling you everything's ok:
`{"success":true,"status":"OK"}`

## What's next?

Visit the [wiki](https://github.com/codebendercc/compiler/wiki) for more information.

## How can someone contribute?

Contribution is always welcome whether it is by creating an issue for a bug or suggestion you can't fix yourself or a pull request for something you can.

If you write new code or edit old code please don't forget to add/update relative unit tests that come with it. It is always a good idea to run tests localy to make sure nothing breaks before you create a pull request.

We expect new code to be [PSR-2](http://www.php-fig.org/psr/psr-2/) but we know we carry legacy code with different coding styles. You're welcome to fix that.
18 changes: 16 additions & 2 deletions Symfony/app/SymfonyRequirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,20 @@ function_exists('simplexml_import_dom'),
'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
);

$this->addRecommendation(
version_compare($installedPhpVersion, '5.4.11', '>='),
'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)',
'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.'
);

$this->addRecommendation(
(version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
||
version_compare($installedPhpVersion, '5.4.8', '>='),
'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
);

if (null !== $pcreVersion) {
$this->addRecommendation(
$pcreVersion >= 8.0,
Expand All @@ -564,8 +578,8 @@ function_exists('simplexml_import_dom'),

$this->addRecommendation(
class_exists('DomDocument'),
'PHP-XML module should be installed',
'Install and enable the <strong>PHP-XML</strong> module.'
'PHP-DOM and PHP-XML modules should be installed',
'Install and enable the <strong>PHP-DOM</strong> and the <strong>PHP-XML</strong> modules.'
);

$this->addRecommendation(
Expand Down
4 changes: 2 additions & 2 deletions Symfony/app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parameters:
arduino_cores_dir: "/opt/codebender/codebender-arduino-core-files"
external_core_files: "/opt/codebender/external-core-files"

auth_key: "youMustChangeThis"
authorizationKey: "youMustChangeThis"

# Paths to various executables used by the compiler. These depend on the
# distribution used and the method of installation. Linking is performed by
Expand All @@ -45,7 +45,7 @@ parameters:
arflags: "rcs"
ldflags: "-Os -Wl,--gc-sections"
ldflags_tail: "-lm -lc"
clang_flags: "--target=msp430 -w -fsyntax-only -fcolor-diagnostics"
clang_flags: '--target=msp430 -w -fsyntax-only -fcolor-diagnostics -ferror-limit=0 -U__DBL_MIN_EXP__ -U__UINT_LEAST16_MAX__ -U__UINT_LEAST8_TYPE__ -U__INTMAX_C -U__UINT8_MAX__ -U__WINT_MAX__ -U__SIZE_MAX__ -U__WCHAR_MAX__ -U__DBL_DENORM_MIN__ -U__UINT_FAST64_MAX__ -U__SIG_ATOMIC_TYPE__ -U__DBL_MIN_10_EXP__ -U__GNUC_PATCHLEVEL__ -U__UINT_FAST8_MAX__ -U__DEC64_MAX_EXP__ -U__INT8_C -U__UINT_LEAST64_MAX__ -U__LDBL_MAX__ -U__UINT_LEAST8_MAX__ -U__UINTMAX_TYPE__ -U__DEC32_EPSILON__ -U__UINT32_MAX__ -U__LDBL_MAX_EXP__ -U__WINT_MIN__ -U__WCHAR_MIN__ -U__INT64_C -U__DBL_DIG__ -U__SIZEOF_INT__ -U__SIZEOF_POINTER__ -U__LDBL_MIN__ -U__DEC32_MAX__ -U__INT32_MAX__ -U__SIZEOF_LONG__ -U__UINT16_C -U__DECIMAL_DIG__ -U__AVR_2_BYTE_PC__ -U__SIZEOF_LONG_DOUBLE__ -U__BIGGEST_ALIGNMENT__ -U__DBL_MAX__ -U__INT_FAST32_MAX__ -U__DEC32_MIN_EXP__ -U__INT_FAST16_TYPE__ -U__DEC128_MAX__ -U__INT_LEAST32_MAX__ -U__USING_SJLJ_EXCEPTIONS__ -U__DEC32_MIN__ -U__DBL_MAX_EXP__ -U__DEC128_EPSILON__ -U__PTRDIFF_MAX__ -U__SIZEOF_SIZE_T__ -U__SIZEOF_WINT_T__ -U__INT_FAST64_TYPE__ -U__DBL_MIN__ -U__DEC128_MIN__ -U__UINT16_MAX__ -U__AVR_ARCH__ -U__UINT8_TYPE__ -U__VERSION__ -U__UINT64_C -U__INT32_C -U__DEC64_EPSILON__ -U__DEC128_MIN_EXP__ -U__INT_FAST32_TYPE__ -U__UINT_LEAST16_TYPE__ -U__INT16_MAX__ -U__SIZE_TYPE__ -U__UINT64_MAX__ -U__INT8_TYPE__ -U__INT_LEAST16_TYPE__ -U__LDBL_EPSILON__ -U__UINTMAX_C -U__SIG_ATOMIC_MAX__ -U__SIZEOF_PTRDIFF_T__ -U__AVR -U__DEC32_SUBNORMAL_MIN__ -U__INT_FAST16_MAX__ -U__UINT_FAST32_MAX__ -U__UINT_LEAST64_TYPE__ -U__LONG_MAX__ -U__DEC128_SUBNORMAL_MIN__ -U__UINT_FAST16_TYPE__ -U__DEC64_MAX__ -U__CHAR16_TYPE__ -U__INT_LEAST16_MAX__ -U__DEC64_MANT_DIG__ -U__INT64_MAX__ -U__UINT_LEAST32_MAX__ -U__INT_LEAST64_TYPE__ -U__INT16_TYPE__ -U__INT_LEAST8_TYPE__ -U__DEC32_MAX_EXP__ -U__INT_FAST8_MAX__ -U__INTPTR_MAX__ -U__LDBL_MANT_DIG__ -U__SIG_ATOMIC_MIN__ -UAVR -U__INTPTR_TYPE__ -U__UINT16_TYPE__ -U__AVR__ -U__UINTPTR_MAX__ -U__DEC64_MIN_EXP__ -U__INT_FAST64_MAX__ -U__UINT_FAST64_TYPE__ -U__INT_MAX__ -U__INT64_TYPE__ -U__DBL_MANT_DIG__ -U__INT_LEAST64_MAX__ -U__DEC64_MIN__ -U__UINT_LEAST32_TYPE__ -U__LDBL_MIN_EXP__ -U__INT_LEAST8_MAX__ -U__LDBL_MAX_10_EXP__ -U__DBL_EPSILON__ -U__UINT8_C -U__INT_LEAST32_TYPE__ -U__SIZEOF_WCHAR_T__ -U__UINT64_TYPE__ -U__INT_FAST8_TYPE__ -U__DEC_EVAL_METHOD__ -U__UINT32_C -U__INTMAX_MAX__ -U__INT8_MAX__ -U__UINT_FAST32_TYPE__ -U__CHAR32_TYPE__ -U__INT32_TYPE__ -U__SIZEOF_DOUBLE__ -U__INTMAX_TYPE__ -U__DEC128_MAX_EXP__ -U__AVR_HAVE_16BIT_SP__ -U__GNUC_MINOR__ -U__UINTMAX_MAX__ -U__DEC32_MANT_DIG__ -U__DBL_MAX_10_EXP__ -U__LDBL_DENORM_MIN__ -U__INT16_C -U__PTRDIFF_TYPE__ -U__UINT32_TYPE__ -U__UINTPTR_TYPE__ -U__DEC64_SUBNORMAL_MIN__ -U__DEC128_MANT_DIG__ -U__LDBL_MIN_10_EXP__ -U__LDBL_DIG__ -U__UINT_FAST16_MAX__ -U__GNUC_GNU_INLINE__ -U__UINT_FAST8_TYPE__ -D__DBL_MIN_EXP__=\(-125\) -D__UINT_LEAST16_MAX__=65535U -D__UINT_LEAST8_TYPE__=unsigned\ char -D__INTMAX_C\(c\)=c\ ##\ LL -D__UINT8_MAX__=255 -D__WINT_MAX__=65535U -D__SIZE_MAX__=65535U -D__WCHAR_MAX__=32767 -D__DBL_DENORM_MIN__=\(\(double\)1.40129846e-45L\) -D__UINT_FAST64_MAX__=18446744073709551615ULL -D__SIG_ATOMIC_TYPE__=int -D__DBL_MIN_10_EXP__=\(-37\) -D__GNUC_PATCHLEVEL__=3 -D__UINT_FAST8_MAX__=65535U -D__DEC64_MAX_EXP__=385 -D__INT8_C\(c\)=c -D__UINT_LEAST64_MAX__=18446744073709551615ULL -D__LDBL_MAX__=3.40282347e+38L -D__UINT_LEAST8_MAX__=255 -D__UINTMAX_TYPE__=long\ long\ unsigned\ int -D__DEC32_EPSILON__=1E-6DF -D__UINT32_MAX__=4294967295UL -D__LDBL_MAX_EXP__=128 -D__WINT_MIN__=0U -D__WCHAR_MIN__=\(-__WCHAR_MAX__\ -\ 1\) -D__INT64_C\(c\)=c\ ##\ LL -D__DBL_DIG__=6 -D__SIZEOF_INT__=2 -D__SIZEOF_POINTER__=2 -D__LDBL_MIN__=1.17549435e-38L -D__DEC32_MAX__=9.999999E96DF -D__INT32_MAX__=2147483647L -D__SIZEOF_LONG__=4 -D__UINT16_C\(c\)=c\ ##\ U -D__DECIMAL_DIG__=9 -D__AVR_2_BYTE_PC__=1 -D__SIZEOF_LONG_DOUBLE__=4 -D__BIGGEST_ALIGNMENT__=1 -D__DBL_MAX__=\(\(double\)3.40282347e+38L\) -D__INT_FAST32_MAX__=2147483647L -D__DEC32_MIN_EXP__=\(-94\) -D__INT_FAST16_TYPE__=int -D__DEC128_MAX__=9.999999999999999999999999999999999E6144DL -D__INT_LEAST32_MAX__=2147483647L -D__USING_SJLJ_EXCEPTIONS__=1 -D__DEC32_MIN__=1E-95DF -D__DBL_MAX_EXP__=128 -D__DEC128_EPSILON__=1E-33DL -D__PTRDIFF_MAX__=32767 -D__SIZEOF_SIZE_T__=2 -D__SIZEOF_WINT_T__=2 -D__INT_FAST64_TYPE__=long\ long\ int -D__DBL_MIN__=\(\(double\)1.17549435e-38L\) -D__DEC128_MIN__=1E-6143DL -D__UINT16_MAX__=65535U -D__AVR_ARCH__=2 -D__UINT8_TYPE__=unsigned\ char -D__VERSION__=\"4.5.3\" -D__UINT64_C\(c\)=c\ ##\ ULL -D__INT32_C\(c\)=c\ ##\ L -D__DEC64_EPSILON__=1E-15DD -D__DEC128_MIN_EXP__=\(-6142\) -D__INT_FAST32_TYPE__=long\ int -D__UINT_LEAST16_TYPE__=short\ unsigned\ int -D__INT16_MAX__=32767 -D__SIZE_TYPE__=unsigned\ int -D__UINT64_MAX__=18446744073709551615ULL -D__INT8_TYPE__=signed\ char -D__INT_LEAST16_TYPE__=short\ int -D__LDBL_EPSILON__=1.19209290e-7L -D__UINTMAX_C\(c\)=c\ ##\ ULL -D__SIG_ATOMIC_MAX__=32767 -D__SIZEOF_PTRDIFF_T__=2 -D__AVR=1 -D__DEC32_SUBNORMAL_MIN__=0.000001E-95DF -D__INT_FAST16_MAX__=32767 -D__UINT_FAST32_MAX__=4294967295UL -D__UINT_LEAST64_TYPE__=long\ long\ unsigned\ int -D__LONG_MAX__=2147483647L -D__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL -D__UINT_FAST16_TYPE__=unsigned\ int -D__DEC64_MAX__=9.999999999999999E384DD -D__CHAR16_TYPE__=short\ unsigned\ int -D__INT_LEAST16_MAX__=32767 -D__DEC64_MANT_DIG__=16 -D__INT64_MAX__=9223372036854775807LL -D__UINT_LEAST32_MAX__=4294967295UL -D__INT_LEAST64_TYPE__=long\ long\ int -D__INT16_TYPE__=short\ int -D__INT_LEAST8_TYPE__=signed\ char -D__DEC32_MAX_EXP__=97 -D__INT_FAST8_MAX__=32767 -D__INTPTR_MAX__=32767 -D__LDBL_MANT_DIG__=24 -D__SIG_ATOMIC_MIN__=\(-__SIG_ATOMIC_MAX__\ -\ 1\) -DAVR=1 -D__INTPTR_TYPE__=int -D__UINT16_TYPE__=short\ unsigned\ int -D__AVR__=1 -D__UINTPTR_MAX__=65535U -D__DEC64_MIN_EXP__=\(-382\) -D__INT_FAST64_MAX__=9223372036854775807LL -D__UINT_FAST64_TYPE__=long\ long\ unsigned\ int -D__INT_MAX__=32767 -D__INT64_TYPE__=long\ long\ int -D__DBL_MANT_DIG__=24 -D__INT_LEAST64_MAX__=9223372036854775807LL -D__DEC64_MIN__=1E-383DD -D__UINT_LEAST32_TYPE__=long\ unsigned\ int -D__LDBL_MIN_EXP__=\(-125\) -D__INT_LEAST8_MAX__=127 -D__LDBL_MAX_10_EXP__=38 -D__DBL_EPSILON__=\(\(double\)1.19209290e-7L\) -D__UINT8_C\(c\)=c -D__INT_LEAST32_TYPE__=long\ int -D__SIZEOF_WCHAR_T__=2 -D__UINT64_TYPE__=long\ long\ unsigned\ int -D__INT_FAST8_TYPE__=int -D__DEC_EVAL_METHOD__=2 -D__UINT32_C\(c\)=c\ ##\ UL -D__INTMAX_MAX__=9223372036854775807LL -D__INT8_MAX__=127 -D__UINT_FAST32_TYPE__=long\ unsigned\ int -D__CHAR32_TYPE__=long\ unsigned\ int -D__INT32_TYPE__=long\ int -D__SIZEOF_DOUBLE__=4 -D__INTMAX_TYPE__=long\ long\ int -D__DEC128_MAX_EXP__=6145 -D__AVR_HAVE_16BIT_SP__=1 -D__GNUC_MINOR__=5 -D__UINTMAX_MAX__=18446744073709551615ULL -D__DEC32_MANT_DIG__=7 -D__DBL_MAX_10_EXP__=38 -D__LDBL_DENORM_MIN__=1.40129846e-45L -D__INT16_C\(c\)=c -D__PTRDIFF_TYPE__=int -D__UINT32_TYPE__=long\ unsigned\ int -D__UINTPTR_TYPE__=unsigned\ int -D__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD -D__DEC128_MANT_DIG__=34 -D__LDBL_MIN_10_EXP__=\(-37\) -D__LDBL_DIG__=6 -D__UINT_FAST16_MAX__=65535U -D__GNUC_GNU_INLINE__=1 -D__UINT_FAST8_TYPE__=unsigned\ int -U_LP64 -U__ATOMIC_ACQUIRE -U__ATOMIC_ACQ_REL -U__ATOMIC_CONSUME -U__ATOMIC_RELAXED -U__ATOMIC_RELEASE -U__ATOMIC_SEQ_CST -U__BYTE_ORDER__ -U__CONSTANT_CFSTRINGS__ -U__ELF__ -U__GCC_ATOMIC_BOOL_LOCK_FREE -U__GCC_ATOMIC_CHAR16_T_LOCK_FREE -U__GCC_ATOMIC_CHAR32_T_LOCK_FREE -U__GCC_ATOMIC_CHAR_LOCK_FREE -U__GCC_ATOMIC_INT_LOCK_FREE -U__GCC_ATOMIC_LLONG_LOCK_FREE -U__GCC_ATOMIC_LONG_LOCK_FREE -U__GCC_ATOMIC_POINTER_LOCK_FREE -U__GCC_ATOMIC_SHORT_LOCK_FREE -U__GCC_ATOMIC_TEST_AND_SET_TRUEVAL -U__GCC_ATOMIC_WCHAR_T_LOCK_FREE -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 -U__GNUC_STDC_INLINE__ -U__GXX_RTTI -U__INT64_C_SUFFIX__ -U__INTMAX_WIDTH__ -U__INTPTR_WIDTH__ -U__LITTLE_ENDIAN__ -U__LP64__ -U__MMX__ -U__NO_MATH_INLINES -U__ORDER_BIG_ENDIAN__ -U__ORDER_LITTLE_ENDIAN__ -U__ORDER_PDP_ENDIAN__ -U__POINTER_WIDTH__ -U__PTRDIFF_WIDTH__ -U__SIG_ATOMIC_WIDTH__ -U__SIZEOF_INT128__ -U__SIZE_WIDTH__ -U__SSE2_MATH__ -U__SSE2__ -U__SSE_MATH__ -U__SSE__ -U__STDC_UTF_16__ -U__STDC_UTF_32__ -U__STDC_VERSION__ -U__WCHAR_WIDTH__ -U__WINT_UNSIGNED__ -U__WINT_WIDTH__ -U__amd64 -U__amd64__ -U__clang__ -U__clang_major__ -U__clang_minor__ -U__clang_patchlevel__ -U__clang_version__ -U__gnu_linux__ -U__k8 -U__k8__ -U__linux -U__linux__ -U__llvm__ -U__tune_k8__ -U__unix -U__unix__ -U__x86_64 -U__x86_64__ -Ulinux -Uunix '
objcopy_flags: "-R .eeprom"
size_flags: ""

Expand Down
12 changes: 8 additions & 4 deletions Symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0"
},
"require-dev": {
"satooshi/php-coveralls": "dev-master"
},
"scripts": {
"require-dev": {
"phpunit/phpunit": "3.7.*",
"satooshi/php-coveralls": "dev-master",
"squizlabs/php_codesniffer": "1.*",
"sebastian/phpcpd": "*",
"phpmd/phpmd": "2.0.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
Expand Down
Loading

0 comments on commit ffb82c6

Please sign in to comment.