nit.git
5 years agotests: serve simple and complex binary
Jean Privat [Thu, 31 May 2018 18:21:10 +0000 (14:21 -0400)]
tests: serve simple and complex binary

Signed-off-by: Jean Privat <jean@pryen.org>

5 years agonitcorn: HttpResponse::body is now an agnostic Writable
Jean Privat [Thu, 31 May 2018 18:18:24 +0000 (14:18 -0400)]
nitcorn: HttpResponse::body is now an agnostic Writable

The only quirk is computing the length :(

Signed-off-by: Jean Privat <jean@pryen.org>

5 years agonitcorn: render the response in a template to avoid a copy&buffer
Jean Privat [Thu, 31 May 2018 18:17:25 +0000 (14:17 -0400)]
nitcorn: render the response in a template to avoid a copy&buffer

By the way, name the method `render` instead of reusing `to_s`

Signed-off-by: Jean Privat <jean@pryen.org>

5 years agocore/stream: add Writable::write_to_bytes
Jean Privat [Thu, 31 May 2018 18:14:30 +0000 (14:14 -0400)]
core/stream: add Writable::write_to_bytes

Signed-off-by: Jean Privat <jean@pryen.org>

5 years agoMerge: lib/core: Fix text tests
Jean Privat [Thu, 31 May 2018 00:23:08 +0000 (20:23 -0400)]
Merge: lib/core: Fix text tests

Fix and clean doc units from `abstract_text`.

Also added back ticks around deprecated code examples.

Closes #2403.

Pull-Request: #2701
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

5 years agoMerge: Object destroy traces
Jean Privat [Thu, 31 May 2018 00:23:07 +0000 (20:23 -0400)]
Merge: Object destroy traces

- add destruction traces
- add lttng channel configuration file
- resolve the signed pointer issue by using uintptr_t instead of intptr_t
- resolve the discarded events issue by using a blocking channel mode.

To compile using the trace system: --trace

To test tracing some object instance and destroy events:
lttng load -i=~/nit/src/Nit_Compiler.lttng Nit_Compiler
lttng start
--> run your program
lttng stop

To read your CTF trace file:
babeltrace ~/lttng-traces/Nit_Compiler-.........

Signed-off-by: olivierschirm <olive.schirm@gmail.com>

Pull-Request: #2695
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

5 years agoMerge: model: remove ModelView
Jean Privat [Wed, 30 May 2018 15:36:14 +0000 (11:36 -0400)]
Merge: model: remove ModelView

ModelView had a good life, now is the time to change.

I replaced all the services from ModelView by `collect_*` methods combined with a `ModelFilter` (91072e1).
All the following commits modify the depending tools to use `model_collect` and `model_filter` instead.
Some test results changed because of the new ModelFilter dependency.

> RIP ModelView

Pull-Request: #2691
Reviewed-by: Jean Privat <jean@pryen.org>

5 years agolib/core/text: uniformize doc units
Alexandre Terrasa [Tue, 29 May 2018 20:32:06 +0000 (16:32 -0400)]
lib/core/text: uniformize doc units

A lot of different variations around the doc units were used in the same module.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agolib/core/text: fix unrecognized doc units
Alexandre Terrasa [Tue, 29 May 2018 20:26:38 +0000 (16:26 -0400)]
lib/core/text: fix unrecognized doc units

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agolib/core/text: remove deprecated mentions
Alexandre Terrasa [Tue, 29 May 2018 20:22:23 +0000 (16:22 -0400)]
lib/core/text: remove deprecated mentions

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agonitpackage: remove ModelView dependency
Alexandre Terrasa [Thu, 17 May 2018 21:13:49 +0000 (17:13 -0400)]
nitpackage: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agovim_autocomplete: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:50:02 +0000 (21:50 -0400)]
vim_autocomplete: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agofrontend: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:49:53 +0000 (21:49 -0400)]
frontend: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agonitmetrics: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:49:46 +0000 (21:49 -0400)]
nitmetrics: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agonitx: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:49:31 +0000 (21:49 -0400)]
nitx: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agonitdoc: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:49:01 +0000 (21:49 -0400)]
nitdoc: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

5 years agoadd destruction traces, add lttng channel configuration file, resolve the signed...
olivierschirm [Thu, 17 May 2018 13:14:24 +0000 (09:14 -0400)]
add destruction traces, add lttng channel configuration file, resolve the signed pointer issue by using uintptr_t instead of intptr_t.
add some infomations in nitc man page

Signed-off-by: olivierschirm <olive.schirm@gmail.com>

5 years agoMerge: nitpackage: check existence of README.md files
Jean Privat [Fri, 25 May 2018 12:55:47 +0000 (08:55 -0400)]
Merge: nitpackage: check existence of README.md files

This PR adds the option `--check-readme` to the `nitpackage` tool so it can check for existence of README.md files in packages.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2697

5 years agoMerge: nitc: use pthread_keys on iOS where __thread is not available
Jean Privat [Fri, 25 May 2018 12:55:47 +0000 (08:55 -0400)]
Merge: nitc: use pthread_keys on iOS where __thread is not available

Add an alternative to the use of `__thread` to manage the catch stack on iOS. This fixes the iOS support, broken since #2612.

The issue with `test_catch_multi_threaded` was seemingly unrelated, caused by a stack overflow. @BlackMinou does this make sense?

See previously failing tests: http://gresil.org/jenkins/job/CI%20Github%20OSX/621/#showFailuresLink

Pull-Request: #2698

5 years agoMerge: nitls: option -M escapes characters in paths
Jean Privat [Fri, 25 May 2018 12:55:46 +0000 (08:55 -0400)]
Merge: nitls: option -M escapes characters in paths

Close #2699

Pull-Request: #2700

5 years agonitls: option -M escapes characters in paths
Jean Privat [Thu, 24 May 2018 14:02:40 +0000 (10:02 -0400)]
nitls: option -M escapes characters in paths

Close #2699

Signed-off-by: Jean Privat <jean@pryen.org>

5 years agotests: fix typo in test name in Darwin.skip
Alexis Laferrière [Mon, 21 May 2018 17:17:21 +0000 (13:17 -0400)]
tests: fix typo in test name in Darwin.skip

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

5 years agotests: recurse less in test_catch_multi_threaded to avoid stack overflow
Alexis Laferrière [Mon, 21 May 2018 00:38:31 +0000 (20:38 -0400)]
tests: recurse less in test_catch_multi_threaded to avoid stack overflow

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

5 years agonitc: use pthread_key_create and others when __thread is not available
Alexis Laferrière [Sun, 20 May 2018 23:17:12 +0000 (19:17 -0400)]
nitc: use pthread_key_create and others when __thread is not available

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agonitpackage: check existence of README.md files
Alexandre Terrasa [Thu, 10 May 2018 19:13:35 +0000 (15:13 -0400)]
nitpackage: check existence of README.md files

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agouml: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:48:34 +0000 (21:48 -0400)]
uml: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agonitweb: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:48:24 +0000 (21:48 -0400)]
nitweb: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agodoc/commands: remove ModelView dependency
Alexandre Terrasa [Tue, 15 May 2018 01:48:03 +0000 (21:48 -0400)]
doc/commands: remove ModelView dependency

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agomodel_collect: kill ModelView
Alexandre Terrasa [Tue, 21 Nov 2017 18:43:38 +0000 (13:43 -0500)]
model_collect: kill ModelView

And move services to model_collect

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agoMerge: lib/md5: nitunitize tests
Jean Privat [Tue, 15 May 2018 22:52:05 +0000 (18:52 -0400)]
Merge: lib/md5: nitunitize tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2694

6 years agoMerge: lib/base64: nitunize tests
Jean Privat [Tue, 15 May 2018 22:52:04 +0000 (18:52 -0400)]
Merge: lib/base64: nitunize tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2693

6 years agoMerge: lib/a_star: nitunitize tests
Jean Privat [Tue, 15 May 2018 22:52:03 +0000 (18:52 -0400)]
Merge: lib/a_star: nitunitize tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2692

6 years agoMerge: src/doc/commands: fix test class name for `commands_md`
Jean Privat [Tue, 15 May 2018 16:51:46 +0000 (12:51 -0400)]
Merge: src/doc/commands: fix test class name for `commands_md`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2689

6 years agoMerge: contrib: generate Makefiles with nitpackage
Jean Privat [Tue, 15 May 2018 16:51:45 +0000 (12:51 -0400)]
Merge: contrib: generate Makefiles with nitpackage

I applied `nitpackage --gen-makefile` (#2662) on contrib:
* generated Makefile for projects without any (76a17aa)
* replaced some existing Makefiles with their generated counterpart (a95be1e)
* manually merged generated rules into existing Makefiles (3b85ec3)

Please consider only these commits as the rest of them belongs to another PRs.

Pull-Request: #2685

6 years agoMerge: contrib: apply nitpackage --gen-ini
Jean Privat [Tue, 15 May 2018 16:51:44 +0000 (12:51 -0400)]
Merge: contrib: apply nitpackage --gen-ini

I ran `nitpackage --gen-ini` on contrib projects.

First of all, I added 3 more accepted keys to nitpackage --check-ini that seem to be used in some projects (04abe90):
* `upstream.apk`
* `upstream.tryit`
* `source.exclude`

I expanded the package `github_merge`, the only one left in the non-expanded form in the Nit project (51df98b).

Then I corrected some `git.directory` keys with incorrect values (a4b53f7). Short note for `src`, I added the trailing `/` to be consistent with all other ini files.

Finally I generated the `package.desc` for all projects from the `mdoc_or_fallback.synopsis` values (051ab50).

Pull-Request: #2682
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: lib/core: remove BufferedReader
Jean Privat [Tue, 15 May 2018 16:51:43 +0000 (12:51 -0400)]
Merge: lib/core: remove BufferedReader

Since the streams are often already buffered in the libraries we depend
upon, and since it is not used anymore on streams present in the
librarires, we remove it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2680

6 years agoMerge: nitpackage: generate and check manpages
Jean Privat [Tue, 15 May 2018 16:51:41 +0000 (12:51 -0400)]
Merge: nitpackage: generate and check manpages

This PR adds two new features to nitpackage:

--check-man: check manpages existence and content for packages and executable modules
--gen-man: create manpages for packages and executable modules

As example I added new manpages (91b9839) to `lib/markdown` and `lib/github`.

Please only consider the 6 last commits as the rest belongs to #2652, #2653, #2656, #2657 and #2662.

Pull-Request: #2663
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: nitpackage: create and check Makefile
Jean Privat [Tue, 15 May 2018 16:51:40 +0000 (12:51 -0400)]
Merge: nitpackage: create and check Makefile

This PR adds two new features to `nitpackage`:
* `--check-makefile`: check Makefiles existence for packages and executable modules
* `--gen-makefile`: create Makefiles for packages and executable modules

As example I added new Makefiles (4f948e3) to all lib/ project if none was found.
I also updated some Makefiles from my projects (dbacfc0).

Please only consider the 4 last commits as the rest belongs to #2652, #2653, #2656 and #2657.

Pull-Request: #2662
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agocontrib: merge manually generated Makefiles with existing ones
Alexandre Terrasa [Sun, 13 May 2018 20:34:27 +0000 (16:34 -0400)]
contrib: merge manually generated Makefiles with existing ones

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib: replace Makefile form contrib with same rules
Alexandre Terrasa [Sun, 13 May 2018 20:13:58 +0000 (16:13 -0400)]
contrib: replace Makefile form contrib with same rules

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib: generate Makefile for projects without any
Alexandre Terrasa [Sun, 13 May 2018 20:10:12 +0000 (16:10 -0400)]
contrib: generate Makefile for projects without any

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib: add some manpages generated with `nitpackage`
Alexandre Terrasa [Mon, 14 May 2018 17:47:00 +0000 (13:47 -0400)]
contrib: add some manpages generated with `nitpackage`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib: add some manpages generated with `nitpackage`
Alexandre Terrasa [Tue, 8 May 2018 22:20:39 +0000 (18:20 -0400)]
lib: add some manpages generated with `nitpackage`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agonitpackage: generate and check man pages
Alexandre Terrasa [Tue, 8 May 2018 22:20:18 +0000 (18:20 -0400)]
nitpackage: generate and check man pages

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agogit: ignore `lib/*/bin`
Alexandre Terrasa [Tue, 15 May 2018 14:04:10 +0000 (10:04 -0400)]
git: ignore `lib/*/bin`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agoshare/man: fix `nitmd` path
Alexandre Terrasa [Sun, 13 May 2018 18:51:54 +0000 (14:51 -0400)]
share/man: fix `nitmd` path

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib: add two examples of Makefile generated by `nitpackage`
Alexandre Terrasa [Fri, 11 May 2018 22:20:26 +0000 (18:20 -0400)]
lib: add two examples of Makefile generated by `nitpackage`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agonitpackage: generate and check Makefiles
Alexandre Terrasa [Tue, 8 May 2018 15:30:08 +0000 (11:30 -0400)]
nitpackage: generate and check Makefiles

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agonitpackage: rename phase
Alexandre Terrasa [Tue, 8 May 2018 02:00:28 +0000 (22:00 -0400)]
nitpackage: rename phase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib: generate `package.desc` key for all contrib projects
Alexandre Terrasa [Sun, 13 May 2018 19:07:53 +0000 (15:07 -0400)]
contrib: generate `package.desc` key for all contrib projects

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib: fix wrong `git.directory` in some contrib projects
Alexandre Terrasa [Sun, 13 May 2018 19:29:53 +0000 (15:29 -0400)]
contrib: fix wrong `git.directory` in some contrib projects

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agonitpackage: accept more `package.ini` keys
Alexandre Terrasa [Sun, 13 May 2018 19:30:50 +0000 (15:30 -0400)]
nitpackage: accept more `package.ini` keys

Added:
* `upstream.apk`
* `upstream.tryit`
* `source.exclude`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agoMerge: contrib/wiringPi: fix `shift` module name
Jean Privat [Tue, 15 May 2018 11:16:39 +0000 (07:16 -0400)]
Merge: contrib/wiringPi: fix `shift` module name

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2681
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: contrib/nitiwiki: protect non-nit code blokcs in README
Jean Privat [Tue, 15 May 2018 11:16:38 +0000 (07:16 -0400)]
Merge: contrib/nitiwiki: protect non-nit code blokcs in README

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2683

6 years agoMerge: contrib: use `config` instead of `opts`
Jean Privat [Tue, 15 May 2018 11:16:38 +0000 (07:16 -0400)]
Merge: contrib: use `config` instead of `opts`

Modified two contrib projects to make then use `config`:
* `github_merge`
* `nitiwiki`

They now automatically provide the `--stub-manpage` option from `config`.

Pull-Request: #2686

6 years agoMerge: contrib: fix readmes
Jean Privat [Tue, 15 May 2018 11:16:37 +0000 (07:16 -0400)]
Merge: contrib: fix readmes

Fix some unprotected raw code blocks in contrib READMES.

Pull-Request: #2687

6 years agolib/md5: nitunitize tests
Alexandre Terrasa [Tue, 15 May 2018 02:46:29 +0000 (22:46 -0400)]
lib/md5: nitunitize tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib/base64: nitunize tests
Alexandre Terrasa [Tue, 15 May 2018 02:24:33 +0000 (22:24 -0400)]
lib/base64: nitunize tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib/a_star: nitunitize tests
Alexandre Terrasa [Tue, 15 May 2018 02:21:47 +0000 (22:21 -0400)]
lib/a_star: nitunitize tests

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agosrc/doc/commands: fix test class name for `commands_md`
Alexandre Terrasa [Tue, 15 May 2018 00:51:49 +0000 (20:51 -0400)]
src/doc/commands: fix test class name for `commands_md`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/nitiwiki: use `config` instead of `opts`
Alexandre Terrasa [Mon, 14 May 2018 16:45:41 +0000 (12:45 -0400)]
contrib/nitiwiki: use `config` instead of `opts`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/github_merge: use `config` instead of `opts`
Alexandre Terrasa [Mon, 14 May 2018 16:29:09 +0000 (12:29 -0400)]
contrib/github_merge: use `config` instead of `opts`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib: expand package `github_merge`
Alexandre Terrasa [Sun, 13 May 2018 19:18:24 +0000 (15:18 -0400)]
contrib: expand package `github_merge`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/sort_downloads: protect README doc units
Alexandre Terrasa [Mon, 14 May 2018 18:12:08 +0000 (14:12 -0400)]
contrib/sort_downloads: protect README doc units

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/nitin: protect README doc units
Alexandre Terrasa [Mon, 14 May 2018 18:11:56 +0000 (14:11 -0400)]
contrib/nitin: protect README doc units

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/brainfuck: protect README doc units
Alexandre Terrasa [Mon, 14 May 2018 18:11:49 +0000 (14:11 -0400)]
contrib/brainfuck: protect README doc units

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/nitiwiki: protect non-nit code blocks in README
Alexandre Terrasa [Sun, 13 May 2018 20:35:44 +0000 (16:35 -0400)]
contrib/nitiwiki: protect non-nit code blocks in README

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agocontrib/wiringPi: fix `shift` module name
Alexandre Terrasa [Sun, 13 May 2018 18:48:46 +0000 (14:48 -0400)]
contrib/wiringPi: fix `shift` module name

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib/core: remove BufferedReader
Lucas Bajolet [Sun, 13 May 2018 13:55:27 +0000 (09:55 -0400)]
lib/core: remove BufferedReader

Since the streams are often already buffered in the libraries we depend
upon, and since it is not used anymore on streams present in the
librarires, we remove it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agoMerge: lib/config: better tool configuration
Jean Privat [Sat, 12 May 2018 01:10:41 +0000 (21:10 -0400)]
Merge: lib/config: better tool configuration

This PR reworks some aspects of the `lib/config`:
* Add option `-?` as help
* Introduce `--stub-man` option (almost the same thing than in `ToolContext`)
* Make `nitmd` use `config` instead of `opts`
* Define a better `tool_description` for `github/loader`

Pull-Request: #2674
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: doc/commands: introduce Markdown rendering for commands
Jean Privat [Sat, 12 May 2018 01:10:40 +0000 (21:10 -0400)]
Merge: doc/commands: introduce Markdown rendering for commands

This PR introduces Markdown rendering for all DocCommands.

Also adds tests.

Pull-Request: #2673
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: Trace system
Jean Privat [Sat, 12 May 2018 01:10:40 +0000 (21:10 -0400)]
Merge: Trace system

To install lttng: https://lttng.org/docs/v2.10/#doc-installing-lttng

To compile using the trace system: add -t or --trace

To test tracing some instances :
lttng create "Nom de la session"
lttng enable-event --userspace Nit_Compiler:Object_Instance
lttng start
--> run your program
lttng stop

To read your CTF trace file:
babeltrace ~/lttng-traces/nom_de_la_session

define TRACEPOINT_INCLUDE "/home/olivier/Bureau/nit/src/nit_compile/traces.h"
This instruction is located into traces.h. You have to adapt it with your specific path.
The dynamical version is the object of the next PR.

Pull-Request: #2666
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agotests: fix tests related to new config options display
Alexandre Terrasa [Fri, 11 May 2018 22:07:02 +0000 (18:07 -0400)]
tests: fix tests related to new config options display

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agoMerge: macOS: skip one of the nitpm tests because of locale issues
Jean Privat [Fri, 11 May 2018 20:01:27 +0000 (16:01 -0400)]
Merge: macOS: skip one of the nitpm tests because of locale issues

The test `nitpm_arg3` exposes an output from Git. It looks like there is locale issue on the macOS CI server changing the output and breaking the tests.

Test diff:
~~~
--- sav//nitpm_args3.res 2018-04-05 22:14:54.000000000 -0400
+++ out/nitpm_args3.res 2018-05-11 02:59:58.000000000 -0400
@@ -1 +1 @@
-Already up-to-date.
+Already up to date.
~~~

I didn't find a clear cause after a quick investigation. This PR as a temporary workaround, feel free to investigate and PR a real fix!

Pull-Request: #2675

6 years agoMerge: opportunity: add a docker-compose.yml file
Jean Privat [Fri, 11 May 2018 20:01:21 +0000 (16:01 -0400)]
Merge: opportunity: add a docker-compose.yml file

Pull-Request: #2677

6 years agoMerge: Small improvements on the oot.sh script
Jean Privat [Fri, 11 May 2018 20:01:18 +0000 (16:01 -0400)]
Merge: Small improvements on the oot.sh script

Pull-Request: #2676

6 years agoMerge: File no buffered
Jean Privat [Fri, 11 May 2018 20:01:08 +0000 (16:01 -0400)]
Merge: File no buffered

Still as part of the Stream refactor, this commit removes the BufferedReader dependency for FileReader.

Note: last commit only to review, the previous one is from #2648

Pull-Request: #2649
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: Added HTTP METHODS to CurlHTTPRequest
Jean Privat [Fri, 11 May 2018 20:01:08 +0000 (16:01 -0400)]
Merge: Added HTTP METHODS to CurlHTTPRequest

Pull-Request: #2655
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: Bitmap fix missing checks
Jean Privat [Fri, 11 May 2018 20:01:06 +0000 (16:01 -0400)]
Merge: Bitmap fix missing checks

Some checks were missing after fixing some warnings in PR #2658, we add these checks here.

Note: the last commit only is relevant, the other comes from #2658

Pull-Request: #2659
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agoMerge: lib/socket: remove BufferedReader superclass
Jean Privat [Fri, 11 May 2018 20:01:05 +0000 (16:01 -0400)]
Merge:  lib/socket: remove BufferedReader superclass

Since BufferedReader is scheduled for removal, we remove it as superclass from the TCPSocket.

As the TCPSocket will be buffered at the system-level, it is not a big problem for performance.

Note: Last commit is to be reviewed only, the others are from #2648

Pull-Request: #2665

6 years agoMerge: Fix Reader::read
Jean Privat [Fri, 11 May 2018 20:01:04 +0000 (16:01 -0400)]
Merge: Fix Reader::read

With the stream refactor being developed and tested alongside, some buggy behaviours are being discovered.
This PR fixes one of such, where calling read on a dead stream caused the program to segfault.

Pull-Request: #2670
Reviewed-by: Jean Privat <jean@pryen.org>

6 years agolib/core: add blocking eof implementation
Lucas Bajolet [Wed, 9 May 2018 01:54:07 +0000 (21:54 -0400)]
lib/core: add blocking eof implementation

eof is a problematic operation for Streams as its state may be decided
by reading input (in sockets for instance).

Because of that, operations relying on it may read one extra byte at the
end of a file, causing the apparition of bad characters (null byte, or
replacement character).

By changing the semantic of eof and making it blocking, we ensure that
querying eof will always produce the appropriate error.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agolib/core: fix read_bytes_to_cstring implementation
Lucas Bajolet [Thu, 10 May 2018 21:49:47 +0000 (17:49 -0400)]
lib/core: fix read_bytes_to_cstring implementation

When reading bytes from both the lookahead and a source, the lookahead
bytes were not kept in the cstring and we re-written by the
raw_read_bytes after that.

This commit fixes that behaviour.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agolib/core: remove BufferedReader as file superclass
Lucas Bajolet [Mon, 7 May 2018 14:48:15 +0000 (10:48 -0400)]
lib/core: remove BufferedReader as file superclass

Since files are already buffered at the libc-level, we do not need to
have a BufferedReader on top of it.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agoopportunity: add a docker-compose.yml file
Jean Privat [Fri, 11 May 2018 16:38:06 +0000 (12:38 -0400)]
opportunity: add a docker-compose.yml file

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agoadd the trace system with a first test which is instance tracing
olivierschirm [Wed, 9 May 2018 20:09:22 +0000 (16:09 -0400)]
add the trace system with a first test which is instance tracing

Signed-off-by: olivierschirm <olive.schirm@gmail.com>

6 years agocontrib/oot.sh: allow an optional list argument
Jean Privat [Fri, 11 May 2018 15:12:52 +0000 (11:12 -0400)]
contrib/oot.sh: allow an optional list argument

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agocontrib/oot.sh: do not error if no makefile
Jean Privat [Fri, 11 May 2018 15:11:54 +0000 (11:11 -0400)]
contrib/oot.sh: do not error if no makefile

Signed-off-by: Jean Privat <jean@pryen.org>

6 years agolib/github: define better `tool_description` for loader
Alexandre Terrasa [Tue, 8 May 2018 22:19:53 +0000 (18:19 -0400)]
lib/github: define better `tool_description` for loader

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib/markdown: nitmd use `config` instead of `options`
Alexandre Terrasa [Tue, 8 May 2018 22:19:25 +0000 (18:19 -0400)]
lib/markdown: nitmd use `config` instead of `options`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib/config: introduce --stub-man option
Alexandre Terrasa [Tue, 8 May 2018 22:18:52 +0000 (18:18 -0400)]
lib/config: introduce --stub-man option

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agolib/config: add `-?` option as help
Alexandre Terrasa [Tue, 8 May 2018 02:54:00 +0000 (22:54 -0400)]
lib/config: add `-?` option as help

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agodoc/commands: introduce Markdown rendering for commands
Alexandre Terrasa [Thu, 3 May 2018 16:42:03 +0000 (12:42 -0400)]
doc/commands: introduce Markdown rendering for commands

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

6 years agomacOS: skip one of the nitpm tests because of locale issues
Alexis Laferrière [Fri, 11 May 2018 14:41:45 +0000 (10:41 -0400)]
macOS: skip one of the nitpm tests because of locale issues

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agoMerge: docker: nitpm requires libcurl, move it up from `full`
Jean Privat [Fri, 11 May 2018 14:33:36 +0000 (10:33 -0400)]
Merge: docker: nitpm requires libcurl, move it up from `full`

This PR should fix the compilation of the nitlang/nit Docker which was broken since adding nitpm.

See: https://hub.docker.com/r/nitlang/nit/builds/bgtphmftqbdp9o7eqhqzn9f/

I've activated email alerts on hub.docker.com to hopefully catch these problems sooner next time.

Pull-Request: #2672

6 years agolib/websocket: refactor websocket as a Protocol
Lucas Bajolet [Wed, 9 May 2018 16:07:40 +0000 (12:07 -0400)]
lib/websocket: refactor websocket as a Protocol

Websocket can be re-implemented as a Protocol to be implemented atop a
TCP stream.

This refactor should be more memory-efficient when handling incoming
data.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agolib/socket: remove BufferedReader superclass
Lucas Bajolet [Tue, 8 May 2018 19:26:53 +0000 (15:26 -0400)]
lib/socket: remove BufferedReader superclass

Since BufferedReader is scheduled for removal, we remove it as a
superclass from the TCPSocket.

As the TCPSocket will be buffered at the system-level, it is not a big
problem for performance.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agolib/core: add protocols for decorator streams
Lucas Bajolet [Wed, 9 May 2018 17:18:51 +0000 (13:18 -0400)]
lib/core: add protocols for decorator streams

Protocol are a class of streams designed to be decorators over others
and provide a high-level interface to protocols.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

6 years agodocker: nitpm requires libcurl, move it up from `full`
Alexis Laferrière [Fri, 11 May 2018 11:26:47 +0000 (07:26 -0400)]
docker: nitpm requires libcurl, move it up from `full`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

6 years agolib/core: add failsafe to UTF8Codec::decode_string
Lucas Bajolet [Fri, 11 May 2018 00:50:14 +0000 (20:50 -0400)]
lib/core: add failsafe to UTF8Codec::decode_string

Calling decode_string on the UTF-8 codec with a negative legth would
cause memmove to crash the program with a segfault.

Adding an assert gives more information on what went wrong and will help
investigate future bugs.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>