Skip to content
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

Fix global cache config overriding #2683

Merged
merged 3 commits into from
Feb 19, 2022
Merged

Conversation

ferd
Copy link
Collaborator

@ferd ferd commented Feb 15, 2022

There was some confusion in the code:

  • rebar_dir:global_config() returns the default path
  • rebar_dir:global_config(State) returns the configured path based on
    the ENV overrides, and defaults to global_config() if nothing is
    given

Since no State term existed at this point in time, we just called out
directly to the argument-free version of the call, but this ignored all
overrides. Instead, we call it with an initialized rebar_state:new() to
properly handle configuration from users, and then use the actual
configured state (if any).

@ferd ferd force-pushed the fix-global-config-loading branch from bf1fe96 to 74a16a8 Compare February 15, 2022 14:28
There was some confusion in the code:

- `rebar_dir:global_config()` returns the default path
- `rebar_dir:global_config(State)` returns the configured path based on
  the ENV overrides, and defaults to `global_config()` if nothing is
  given

Since no State term existed at this point in time, we just called out
directly to the argument-free version of the call, but this ignored all
overrides. Instead, we call it with an initialized `rebar_state:new()` to
properly handle configuration from users, and then use the actual
configured state (if any).
@ferd ferd force-pushed the fix-global-config-loading branch from 74a16a8 to ffae612 Compare February 15, 2022 14:35
@ferd ferd requested a review from tsloughter February 16, 2022 14:56
@ferd ferd merged commit 8b9b74a into erlang:main Feb 19, 2022
ferd added a commit that referenced this pull request Jun 18, 2022
New features:

- [Add --offline option and REBAR_OFFLINE environment variable](#2643)
- [Add support for project-local plugins](#2697)
- [Add eunit --test flag](#2684)

Experimental features for which we promise no backwards compatibility in
the near future:

- [Experimental vendoring provider](#2689)
  - [Support plugins in experimental vendor provider](#2702)

Other changes:

- [Support OTP 23..25 inclusively](#2706)
- [Bump Relx to 4.7.0](#2718)
  - [Use `erlexec` directly in relx helper functions](erlware/relx#902)
  - [Make rlx_util:parse_vsn parse integer versions](erlware/relx#913)
  - [fix awk script check_name() in extended_bin](erlware/relx#915)
  - [avoid crash when overlay is malformed](erlware/relx#916)
  - [keep attributes when stripping beams](erlware/relx#906)
  - [Fix {include_erts,true} in Windows releases](erlware/relx#914)
  - [ensure the erl file is writable before copying dyn_erl to it](erlware/relx#903)
  - Various tests added
- [Properly carry overlay_vars settings for files in relx](#2711)
- [Track mib compilation artifacts](#2709)
- [Attempt to find apps in git subdirs (sparse checkouts)](#2687)
- [Do not discard parameters --system_libs and --include-erts when duplicate values exist](#2695)
- [Use default `depth` parameter for SSL](#2690)
- [Fix global cache config overriding](#2683)
- [Error out on unknown templates in 'new' command](#2676)
- [Fix a typo](#2674)
- [Bump certifi to 2.9.0](#2673)
- [add a debug message in internal dependency fetching code](#2672)
- [Use SPDX id for license in template and test](#2668)
- [Use default branch for git and git_subdir resources with no revision](#2663)

Signed-off-by: Fred Hebert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant