Comments (12)
+1 to _build
also could you have arbitrary subdirs like windows
, freebsd
etc or are you going to just restrict it to prod
and dev
?
from rebar3.
I wasn't planning to restrict it. Would subdirs like windows
make sense for rebar3
? Not that I'm saying you won't be able to name them that, but seems like something a user would do before releases in relx
not building BEAM files.
I also plan to do this change of build profiles for relx
.
from rebar3.
you might want to make different api calls (via os:cmd
or whatever) on different platforms. it would be nice to be able to handle this with rebar profiles rather than platform defines. i can think of a few other reasons to want arbitrary profiles too, windows
was just the first that came to mind
from rebar3.
Ah, yea, good point. Now for how these should be configured.
{profiles, [{dev, [
{erl_opts,
[debug_info,
warnings_as_errors]}
]}
]
}.
Just something like that and then if a profile is set it merges the contents of the list from the profile with the rest of the config values. And the output dir I guess would just be atom_to_list(Profile)
.
from rebar3.
that looks great, although you need pretty clear merging rules. maybe lists are appended and everything else is replaced?
from rebar3.
Yup, that is what I was thinking.
@ferd ?
from rebar3.
What would the default profile be?
from rebar3.
@ferd I suppose either default
or dev
.
One issue I realized is, maybe we should do this structure instead:
_build
├── lib
├── dev
│ └── releases
├── plugins
│ └── lib
├── prod
│ └── releases
└── test
└── lib
Where we could also replace the name lib
with deps
. But we should probably share the project deps like this. And then each profile can have their own deps declared that are installed into their subdirectory, like test deps and plugins.
from rebar3.
I agree lib
makes more sense at the top-level there. Worst case will be the compile options that may change cross profiles.
The downside of this remains booting a shell with it.
erl -pa ebin -env ERL_LIBS _build/lib:_build/test/lib
Or the more expected
erl -pa ebin _build/lib/*/ebin _build/test/lib/*/ebin
Because most people don't use the rest.
Of course we could focus more work on rebar3 shell <profile>
and build these on users' behalf. Of course that would also add in needs for dialyzer ... <profile>
and whatnot for other commands, and then asks the question of whether profiles should be per-provider, or always handled by rebar3 itself to avoid errors.
Having it be visible could be interesting because relx
with a dev profile could use different configuration than the default one, but yeah.
I'm for the general idea of moving things to _build
, and I agree the different profiles are needed, but need some thinking (along with possibly dropping the test deps mechanism currently in there?)
from rebar3.
My idea was to have it all set before getting to providers. And maybe just using env vars like how DEBUG
is done. Or maybe either or, allow an env var or a --profile
.
$ PROFILE=prod rebar3 compile
Hm, but some providers, like ct
and eunit
will want to use those specific profiles... That makes it a bit trickier.
And definitely want this for relx
, I was planning to add it on top of relx
itself separately, and rebar3
will be able to pass what the profile should be to relx
. Note that the release
provider also currently supports taking the relx
config from rebar.config
. If that isn't defined then it wil llook for relx.config
.
from rebar3.
Working on a document of how profiles work, open for comment: https://gist.github.com/tsloughter/1e16d70268182db1415a
from rebar3.
This change is made in #31
from rebar3.
Related Issues (20)
- New command 'alias' HOT 2
- "Newly added dep is locked at a lower level" (also) reported when upgrade command is issued HOT 4
- Executing rebar3 throwing escript exception HOT 1
- Templates not found on Fedora Linux HOT 4
- `rebar3 tree` formats its output very badly when called together with OTP26 HOT 4
- Question: Sharing modules between multiple applications
- Many [r3_hex_http] ... is deprecated in favour of ... messages during compilation and upgrades HOT 1
- are there checksum available ? HOT 4
- Escript creation failure reason swallowed by post-hook failure. HOT 1
- Possible error in rebar_core HOT 1
- Uncaught error in rebar_core when running rebar3 shell HOT 1
- when use -name, remote_console connect failed HOT 1
- "Did you mean ...?" suggestions for misspelled commands HOT 7
- rebar3 auto: Error loading module enotify HOT 1
- Tag usage in newer rebar3 versions HOT 14
- Hooks env variables documentation HOT 1
- {mode, ...} overrides variables explicitly set in the profile
- rebar3 killed spawned processes after compile HOT 1
- Dependency post_hooks clean override not executed. HOT 3
- `rebar3 version` compiles dependencies before outputting value HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rebar3.