summaryrefslogtreecommitdiff
path: root/src/rebar_compiler.erl
Commit message (Collapse)AuthorAgeFilesLines
* Fix duplicate module naming in edoc test suite dataTino Breddin2019-04-161-3/+3
|
* Fix Parallel CompilationFred Hebert2019-03-291-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | This patch does two things: 1. it broadens the interface for the compiler module so that non-first-file modules can possibly be parallelized. This is done by dynamically switching on `[ListOfFiles]`, which remains sequential as before, or `{[SeqPriority], [Parallel]}`, which divides regular files between higher priority ones and those that can be in parallel 2. implements this mechanism in the rebar compiler, based on the erl file digraph. If a file has an in-neighbour, it is depended on by another file. The mechanism therefore makes it so all files that have dependants get compiled in their strict relative sequential order first, and then the undepended-on files get compiled together in parallel. By running: ./rebar3 ct --suite test/rebar_compile_SUITE.erl --case \ recompile_when_parse_transform_inline_changes --repeat 50 the previous iteration of this would rapidly fail, and this one succeeds every time.
* Enable parallel buildMaxim Fedorov2019-03-281-1/+55
| | | | | Support for parallel compilation of *.erl file was dropped before 3.0 release. However, our tests for a project containing ~500 source files show substantial gain, lowering compilation time from 58 seconds to 18 on a MacBook Pro 15" (4 cores, 8 threads), and to just 10 seconds on Xeon-D machine.
* Fix handling of updated files in extra_src_dirsFred Hebert2019-02-011-24/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes cases where changes in .hrl files would not be picked up in .erl files that are in extra source directories (such as those defined with `extra_src_dirs` or modules in the test/ directory during a CT or Eunit run). The problem was due to the way the Directed Acyclic Graph (DAG) of dependencies between files was being loaded and stored by the compiler modules. Prior to this fix, a single DAG would be used for all runs. On a regular run, the prior DAG is loaded from disk, re-checked, and if changed, it would get re-written to disk with the changes deciding what to re-compile. However, whenever extra source directories were specified, a second run would be done which swaps target directories around in the compiler modules. Bug 1: this second run was done without properly tracking the private .hrl files (in src/), so the changes were invisible. This has been fixed by re-adding the paths. The problem is that the DAG handling is self-contained; just invoking it was sufficient to get it loaded and rewritten to disk. But since runs with extra src dirs were done on different sets, the compilation of extra src dirs would be done with bad historical data (all the modules in src/ are dropped, all those in test/ are re-added); this DAG was then written to disk once again, polluting the next non-extra run. This is bug 2, and it is fixed by adding an optional label to each run so that a regular or extra compile round can be distinguished, each tracking their own files in their own DAG. A single test (and a lot of diffing) were sufficient for this.
* Fix typespecs of new compiler behaviourFred Hebert2018-11-231-1/+3
|
* fix needed_files type specTristan Sloughter2018-11-181-1/+2
|
* check last modified time on erl files for xrl and yrl files before compilingTristan Sloughter2018-11-091-2/+11
|
* Fix a bug in compiler path handlingFred Hebert2018-10-111-4/+3
| | | | Also handle some formatting
* compiler behaviour (#1893)Tristan Sloughter2018-10-051-0/+304
* add compile type for dynamic project compilation * new rebar_compiler abstraction for running multiple compilers rebar_compiler is a new behaviour that a plugin can implement to be called on any ues of the compile provider to compile source files and keep track of their dependencies. * fix check that modules in .app modules list are from src_dirs * use project_type to find module for building projects * allow plugins to add project builders and compilers