summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Unhang logger when swapping the TTY in shellFred Hebert2019-01-311-1/+23
| | | | | | | | | | | | | | | | | Starting with OTP-21.2.3, some output appears to be sent to the shell while we're taking down the TTY, which ends up stalling the whole log flow for the default handler. I don't have proof but suspect this is due to the system logging going directly from the ERTS runtime to the logger, which may be trigger when we kill the TTY driver. This patch makes it so whenever we detect that logger is active, we save the default config, disable the default logger, and only then we can kill the TTY driver. Once the driver is started and all the group leaders have been rewritten, the default logger is re-added. This all takes place _before_ the logger configuration is updated as part of booting apps, and the change should be fully backwards compatible.
* Use double quotes in git shell command on WindowsAmelia Bellamy-Royds2019-01-241-2/+2
| | | | | | | | Partially reverts commit f52a115ea9d66c812f68200383d769ac300a2828 Fixes #2003 Needs tests to prevent a future regression.
* Merge pull request #2000 from ferd/reorder-deps-treeFred Hebert2019-01-241-1/+2
|\ | | | | Reorder rebar3 tree output on umbrella apps
| * Reorder rebar3 tree output on umbrella appsFred Hebert2019-01-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes it so umbrella projects get ordered in a way more in-line with what we do with non-umbrellas. For example, a non-umbrella app (rebar3 itself) gives output like: └─ rebar─3.8.0+build.4270.refaece1d7 (project app) ├─ bbmustache─1.6.0 (hex package) ├─ certifi─2.3.1 (hex package) ├─ cf─0.2.2 (hex package) ├─ cth_readable─1.4.2 (hex package) ├─ erlware_commons─1.3.1 (hex package) ├─ eunit_formatters─0.5.0 (hex package) ├─ getopt─1.0.1 (hex package) ├─ hex_core─0.4.0 (hex package) ├─ parse_trans─3.3.0 (hex package) ├─ providers─1.7.0 (hex package) ├─ relx─3.28.0 (hex package) └─ ssl_verify_fun─1.1.3 (hex package) The current (prior to this patch) output for an umbrella project looks like this: ├─ bootstrap─0.0.2 (git repo) ├─ dirmon─0.1.0 (project app) ├─ fake─0.1.0 (project app) ├─ file_monitor─0.1 (git repo) ├─ peeranha─0.1.0 (git repo) │ ├─ gproc─0.5 (git repo) │ ├─ interclock─0.1.2 (git repo) │ │ ├─ bitcask─1.7.0 (git repo) │ │ │ └─ lager─2.1.1 (hex package) │ │ │ └─ goldrush─0.1.6 (hex package) │ │ └─ itc─1.0.0 (git repo) │ └─ merklet─1.0.0 (git repo) ├─ recon─2.2.2 (git repo) └─ uuid─1.5.0 (git repo) └─ quickrand─1.5.0 (git repo) Which kind of looks odd because the layout represents the dependencies of deps as declared by the rebar3 config files, but mix up the project apps as dependencies. This turns out to break expectations, and some external tools (such as Blackduck's dep detection -- see https://github.com/blackducksoftware/hub-detect/blob/d8a0f2281a056aec04e3f8aecd22bbbe9a2a6f3e/hub-detect/src/main/groovy/com/blackducksoftware/integration/hub/detect/detector/hex/Rebar3TreeParser.java) which were developed with regular apps in mind, but not umbrellas. This PR changes things by reordering all project apps at the root level and putting them first, and then indenting all deps below them. The same app now looks like: ├─ dirmon─0.1.0 (project app) └─ fake─0.1.0 (project app) ├─ bootstrap─0.0.2 (git repo) ├─ file_monitor─0.1 (git repo) ├─ peeranha─0.1.0 (git repo) │ ├─ gproc─0.5 (git repo) │ ├─ interclock─0.1.2 (git repo) │ │ ├─ bitcask─1.7.0 (git repo) │ │ │ └─ lager─2.1.1 (hex package) │ │ │ └─ goldrush─0.1.6 (hex package) │ │ └─ itc─1.0.0 (git repo) │ └─ merklet─1.0.0 (git repo) ├─ recon─2.2.2 (git repo) └─ uuid─1.5.0 (git repo) └─ quickrand─1.5.0 (git repo) Now the project apps are back at the top, and all the dependencies follow at one level of indentation below. There is no recorded change for single-app projects.
* | Merge pull request #2001 from ferd/fix-perf-regressionFred Hebert2019-01-231-1/+1
|\ \ | | | | | | Fix performance regression in compiler around behaviours
| * | Fix performance regression in compilerFred Hebert2019-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the commit at https://github.com/erlang/rebar3/commit/8c4a74a3ed9ddd9841e6596ca86b81f3d43906c0 introduced a recursive search for build elements, it accidentally did so using a function that accepts a regex for its match. In doing so, if a behaviour or include had a name such as `common_prefix` and that multiple other modules used the name `common_prefix_<rest_of_name>`, all the other files would be seen as dependencies to be checked in a directed graph. This resulted in continuous re-checking of files that kept depending on each others and blew the compile time up exponentially. By using a delimitation on the regex (^<modulename>$), the build comes back down to finding only the right files and becomes fast again.
* | | Safe unicode handlingFred Hebert2019-01-231-2/+2
| | |
* | | Merge branch 'working-systests-on-darwin' of ↵Fred Hebert2019-01-231-3/+14
|\ \ \ | |/ / |/| | | | | https://github.com/starbelly/rebar3 into starbelly-working-systests-on-darwin
| * | Remove dup quotation opBryan Paxton2018-12-101-1/+0
| | |
| * | strip trailing forward slash on recrusive cp for darwinBryan Paxton2018-12-091-3/+15
| | | | | | | | | | | | | | | | | | | | | - fixes systests on darwin where previously the recursive cp would fail due to everything being copied after the last forward slash. Specifically, everything in `systest/all_SUITE_data/` would be copied but not `all_suite_data` dir itself which the tests expected.
* | | Avoid linebreak on command lineFred Hebert2019-01-231-2/+2
| | |
* | | Merge branch '1944-git-shell-eval-bug' of ↵Fred Hebert2019-01-231-2/+3
|\ \ \ | |_|/ |/| | | | | https://github.com/starbelly/rebar3 into starbelly-1944-git-shell-eval-bug
| * | Use single vs escaped double quotesBryan Paxton2018-12-091-2/+3
| |/
* | add repo_name to repoconfig used with hex_core to be compatible (#1996)Tristan Sloughter2019-01-131-1/+4
| |
* | fix case clause when is_supported is not in process dictionaryMikael Lixenstrand2019-01-111-2/+1
| |
* | Back to git-based versioningFred Hebert2019-01-051-1/+1
| |
* | Bump to 3.8.0Fred Hebert2019-01-051-1/+1
| |
* | Remove unnecessary clauses in update_package/3Eric Meadows-Jönsson2019-01-041-4/+0
| |
* | Merge pull request #1986 from ericmj/emj/mirror-ofFred Hebert2019-01-012-13/+35
|\ \ | | | | | | Update hex_core and add mirror_of repo config
| * | Improve error messageEric Meadows-Jönsson2019-01-011-4/+3
| | |
| * | Update hex_core and add mirror_of repo configEric Meadows-Jönsson2018-12-302-13/+36
| | |
* | | Remove deprecated hex field maintainers (#1987)Bryan Paxton2018-12-311-3/+1
| | | | | | | | | | | | - removed deprecated maintainers field from config template in rebar_prv_packages
* | | Refactor normalizemopp2018-12-301-6/+10
| | |
* | | Use format_error/1mopp2018-12-301-1/+3
| | |
* | | Revert try-catchmopp2018-12-301-12/+8
| | |
* | | Use ?PRV_ERROR instead of throwing errormopp2018-12-301-1/+1
| | |
* | | Add --generator option for eunitmopp2018-12-291-11/+33
|/ /
* | Merge pull request #1979 from ferd/ct-failfastFred Hebert2018-12-182-4/+140
|\ \ | | | | | | Add a --fail_fast switch to common test
| * | Add a --fail_fast switch to common testFred Hebert2018-12-172-4/+140
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switch aborts the rebar3 run after the first test failure is reported. Since Common Test does not support this feature and it can be useful for interactive development (a demand from one of the teams I work with), I decided to add the feature as an experimental CT hook. The hook notices any test failure, and forcefully aborts the current script execution, but only during the initialization phase of the next test; this ensure that all other hooks for a post-test failure have the time to do things right. The CT logs _will_ be interupted, and hooks of all kinds may also suffer. Since this might be a bit tricky to support internally, I will be fine with a review that results in "no, Fred. Please test this in a project plugin first" or if I get told to use profiles to mature the feature (i.e. `rebar3 as failfast ct ...`) with a custom hook declaration.
* | Code documentation that the PR was for backwards compatilityStuart Thackray2018-12-182-2/+11
| |
* | Tidy Deps plugin to provide the download/3Stuart Thackray2018-12-112-0/+8
|/ | | | | | For issue https://github.com/erlang/rebar3/issues/1974 Revert "add rebar.lock to template gitignore" This reverts commit 8fb8a91130e0e5c239bb837b9adc4ad71e5806b8.
* implement mib_first_files support in rebar_compiler_mibStefan Grundmann2018-12-051-3/+34
| | | | mostly copy/paste from rebar_compiler_erl
* Merge pull request #1965 from starbelly/single-module-xref-supportFred Hebert2018-12-041-2/+4
|\ | | | | Support ignoring entire modules in xref results
| * Support ignoring whole modules in xref resultsBryan Paxton2018-12-021-2/+4
| | | | | | | | | | | | | | - Added support to rebar_prv_xref for filtering out whole module. A module may now be added to the list of xref_ignores in rebar.config or via -ignore_xref() module attribute - Added unit test for whole module filtering support to xref CT suite
* | fix pkg name during update by using pkg_name understood by hexAndrás Boroska2018-12-021-2/+4
| |
* | Merge pull request #1963 from ferd/swap-builder-dep-orderFred Hebert2018-12-012-4/+8
|\ \ | |/ |/| Fix load order for custom project builders and parse transforms
| * Review comments addressedFred Hebert2018-12-011-1/+3
| |
| * Clear app details cache before checking in pathsFred Hebert2018-11-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The app data, when set by `rebar3_app_discover` basically does not include the modules if it was derived from the .app.src file, even if at a later point the modules were compiled. Since there is currently no clear way to add that information reliably across all compiler versions in all types of compilers, we simply clear the cache and re-derive the information when required. This might have a small performance cost, but is required for correctness whenever an application's first build is run. Specifically, this bug was detected when a plugin included lager's parse transform, and the application itself also required it, but two distinct versions were needed. This patch finalizes fixing this issue.
| * Ensure the right deps are in pathFred Hebert2018-11-281-0/+1
| | | | | | | | | | Compile time with parse transforms needs to have the deps first in scope before the plugins
| * Fix load order for custom project buildersFred Hebert2018-11-281-1/+1
| | | | | | | | | | | | | | | | | | Due to building dependencies with potential artifacts such as parse transforms or macros, project builder plugins should be included in the path, but _after_ deps are loaded. Doing otherwise means that if any of the dependencies is required at compile time, those of a plugin might get used first.
* | fix for mix projects that don't have app.src files (#1964)Tristan Sloughter2018-11-302-2/+6
|/
* back to git based versioningFred Hebert2018-11-271-1/+1
|
* Bump to 3.7.5Fred Hebert2018-11-271-1/+1
|
* Merge pull request #1957 from tsloughter/subdir-behavioursFred Hebert2018-11-271-10/+1
|\ | | | | search subdirectories as well for imports/transforms/behaviours
| * search subdirectories as well for imports/transforms/behavioursTristan Sloughter2018-11-251-10/+1
| |
* | Merge pull request #1959 from ferd/fix-cover-pathsFred Hebert2018-11-271-2/+1
|\ \ | | | | | | Fix path coverage loading artifacts
| * | Fix path coverage loading artifactsFred Hebert2018-11-261-2/+1
| |/ | | | | | | | | | | | | | | | | | | The old path handling routine would force loading a bunch of applications, but it did not necessarily unload them aside from specific calls that the other test handlers used to need to do, but no longer needed under the updated path management of 3.7.0. The leftover calls in the cover compilation bits caused some apps to be loaded and to remain loaded before tests started.
* | Merge pull request #1949 from aronisstav/add-more-help-hintFred Hebert2018-11-271-1/+3
|\ \ | |/ |/| Add hint for `rebar3 new help` on `rebar3 help new`
| * Add hint for `rebar3 new help` on `rebar3 help new`Stavros Aronis2018-11-221-1/+3
| |