forked from erlang/rebar3
-
Notifications
You must be signed in to change notification settings - Fork 0
update rebar3 #1
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
Open
enirood-p
wants to merge
344
commits into
greyorange:main
Choose a base branch
from
erlang:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will help testability and to better self-contain the implementation
This now looks like:
...
===> Compiling apps/rebar/src/fake_mod.erl failed
┌─ apps/rebar/src/fake_mod.erl:
│
5 │ diagnostic(A) ->
│ ╰── variable 'A' is unused
┌─ apps/rebar/src/fake_mod.erl:
│
6 │ X = add(5 / 0),
│ ╰── evaluation of operator '/'/2 will fail with a 'badarith' exception
┌─ apps/rebar/src/fake_mod.erl:
│
11 │ add(X, Y) -> X + Y.
│ ╰── function add/2 is unused
And supports colors with a weak heuristic based on regexes that I expect
we'll need to fix and expand later to cover more compiler-specific
rules.
As reported in a comment in #2090 the current mechanism only breaks on a \n and does not even respect the \r\n grapheme cluster. So instead of using string functions, we go to regular expressions where we can specify both endings without a problem.
Support CRLF in shell ENV files
This avoids an issue with Erlang/OTP 26 where the IO hangs when shelled out on Windows. See erlang/otp#7261.
Support rich compiler error messages
I hadn't seen this because all my projects use warnings_as_errors, but the warnings were never properly wired up. This patch fixes that by adding the proper callbacks and invoking them from the 3 erlang-related compilers we support.
Fixup: rich compiler output in warnings
Add simple Erlang LS config
The function `collect_default_refcount/1` of `rebar_git_resource` did not log the error message when it failed to get the vsn number with its `git log` command. A diagnostic error message is now printed with the status code and output message of the failing command.
While investigating the work required to support #2803, I found out that the code was already in place. However, despite the code being there, we still passed the old `ssl_verify_hostname:verify_fun/3` function of pre-21.0 on top of it, which I supposed ignored the check. So this change reworks the flow such that we fall back to the legacy check only if it isn't supported by the OTP library at this point. Getting this going would require someone to build a new release on an Erlang copy older than OTP-21 (which is no longer supported) which is unlikely. This follows guidelines from https://erlef.github.io/security-wg/secure_coding_and_deployment_hardening/ssl
…-vsn-command Print diagnostic when failing to get VSN with Git
Defer hostname check to OTP when supported
The current mechanism had a few oddities, as reported in #2811: - `rebar3 do a,b` runs `a` then `b` - `rebar3 as profile task --a=b,c` runs the task with the flag `a` set to `b,c` - `rebar3 as profile task -a b,c` runs the task with the flag `a` set to `b`, and then tries to run `c` as a task - `rebar3 as profile task -a b, c` runs the task with the flag `a` set to `b`, and then tries to run `c` as a task So the issue is that to pass a comma to an argument, we can only do so when it exists as a long form argument (`--flag`) and that it does not contain spaces. This patch attempts to correct things by making the white-space following the comma significant. If it's missing, it gets grouped as a single entity. If it's there, the task is considered to be split. This becomes significant for commands that internally parse the `,` to allow list of args (such as `rebar3 release --relnames one,two`) which were only invokable as `relnames=one,two`, and not the spaced version nor the short version (`m one,two`), which should now be supported. This should *not* break any backwards compatibility, but there is the possibility that users who did invoke many commands with both arguments and sequences without spaces (`rebar3 do release --relname a,tar`) now get broken commands. I don't quite know if we'd be okay taking that risk, so this is up for comments I guess.
…nimum-otp-vsn Add app name to "OTP release ~ts or later is required" msg
Improve documentation
Support env variable substitution with defaults in rebar shell
relx: do not discard command line parameters when parameter is not in…
Instead of calling ec_semver directly, all version-related calls go through this module; This makes it easy to swap later when hex_core exposes an appropriate replacement in the future. It was not possible to use `verl` or other libraries here, since rebars/erlang_commons parsing was different in a number of edge cases: - rebar allows version bounds with 2 components, like `< 1.0` or `== 1.2`. - rebar allows approximate bounds with more than 3 components, like `~> 1.5.6-rc.0` To continue to support these, the new module also uses ec_semver under the hood, but extends the custom constraint parser to also support `and` and `or` constraints used by Elixir or Gleam. Constraints are modelled as a match function without a pure data representation. This has to be assumed to be an implementation detail that might change in the future when a need arises.
Notable changes include: - find_highest_matching_ now just calls resolve_version_ with a pessimistic constraint - cmp* variants are gone - is_valid get removed in favour of handling the error case after trying to parse
CT: disable cth_readable_failonly hook when verbose option is set
IPv6 support for getting Hex packages
fix the version range parser to support and/or version constraints
fix rebar_app_info:source/1 spec
Filter out dependencies marked as optional in Hex package metadata. Rebar3 does not support optional dependencies, so they should not be fetched or compiled. This fixes issues where optional Mix-only transitive dependencies would cause build failures. Bump PACKAGE_INDEX_VERSION to invalidate existing caches. Fixes #2977
Ignore optional Hex package dependencies
Found via `codespell -S vendor -L cant,manuel,nd` and `typos --hidden --format brief`
…omp_mode Add middlebox_comp_mode to global options
Update vendored version of hex_core to v0.12.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.