Comments (33)
Taking a look.
from rebar3.
Actually, I get the same thing with rebar2:
λ rebar compile
==> merl (compile)
Compiling src/merl_transform.erl failed:
src/merl_transform.erl:none: undefined parse transform 'merl_transform'
It seems some vars are set in the Makefile that correct it:
erlc -DMERL_NO_TRANSFORM -o priv/ src/merl_transform.erl
That is annoying...
from rebar3.
@nuex any update on this? I'm curious how you build it with rebar2.
from rebar3.
@tsloughter I just tried making a new directory with a rebar.config file with only this line:
{deps, [{erlydtl, ".*", {git, "https://github.com/erlydtl/erlydtl.git", "master"}}]}.
I just pulled down rebar2 master and it looks like it compiles fine:
$ rebar get-deps
WARN: Expected /home/nuex/tmp/dtl_test/deps/erlydtl to be an app dir (containing ebin/*.app), but no .app found.
==> dtl_test (get-deps)
WARN: Expected /home/nuex/tmp/dtl_test/deps/erlydtl to be an app dir (containing ebin/*.app), but no .app found.
Pulling erlydtl from {git,"https://github.com/erlydtl/erlydtl.git","master"}
Cloning into 'erlydtl'...
WARN: Expected /home/nuex/tmp/dtl_test/deps/merl to be a raw dependency directory, but no directory found.
WARN: Expected /home/nuex/tmp/dtl_test/deps/eunit_formatters to be an app dir (containing ebin/*.app), but no .app found.
==> erlydtl (get-deps)
WARN: Expected /home/nuex/tmp/dtl_test/deps/merl to be a raw dependency directory, but no directory found.
WARN: Expected /home/nuex/tmp/dtl_test/deps/eunit_formatters to be an app dir (containing ebin/*.app), but no .app found.
Pulling merl from {git,"git://github.com/erlydtl/merl.git",{branch,"erlydtl"}}
Cloning into 'merl'...
Pulling eunit_formatters from {git,"git://github.com/seancribbs/eunit_formatters",
{branch,"master"}}
Cloning into 'eunit_formatters'...
==> merl (get-deps)
==> eunit_formatters (get-deps)
$ rebar compile
==> eunit_formatters (compile)
Compiled src/binomial_heap.erl
Compiled src/eunit_progress.erl
==> erlydtl (compile)
make: Entering directory '/home/nuex/tmp/dtl_test/deps/merl'
erlc -pz ./priv -pa ./ebin -o ebin/ src/merl.erl
erlc -DMERL_NO_TRANSFORM -o priv/ src/merl_transform.erl
erlc -pz ./priv -pa ./ebin -o ebin/ src/merl_transform.erl
erlc -pz ./priv -pa ./ebin -o ebin/ src/merl_tests.erl
make: Leaving directory '/home/nuex/tmp/dtl_test/deps/merl'
Compiled src/erlydtl_parser.yrl
Compiled src/erlydtl_parser.erl
Compiled src/erlydtl_compiler_utils.erl
Compiled src/erlydtl_compiler.erl
Compiled src/i18n/po_generator.erl
Compiled src/filter_lib/erlydtl_dateformat.erl
Compiled src/i18n/sources_parser.erl
Compiled src/i18n/i18n_manager.erl
Compiled src/i18n/po_scanner.erl
Compiled src/erlydtl_deps.erl
Compiled src/filter_lib/erlydtl_slice.erl
Compiled src/erlydtl_contrib_humanize.erl
Compiled src/erlydtl_runtime.erl
Compiled src/erlydtl_scanner.erl
Compiled src/erlydtl_library.erl
Compiled src/erlydtl.erl
Compiled src/erlydtl_unparser.erl
Compiled src/erlydtl_filters.erl
Compiled src/erlydtl_beam_compiler.erl
==> dtl_test (compile)
I'm going to look into this further and see if I can work out what is going on later and see if I can submit a fix.
from rebar3.
Oooo, I see what is going on.
{"(linux|darwin|solaris)", compile, "make -C \"$REBAR_DEPS_DIR/merl\" all -W test"},
We aren't setting that env variable currently and passing it in.
Just passing [] as Env: https://github.com/rebar/rebar3/blob/master/src/rebar_hooks.erl#L8
I hadn't yet looked to see what os vars rebar2 had been setting to see what should be carried over.
from rebar3.
@nuex I just pushed what should be a fix if you want to give a try, I just ran it against erlydtl
and it looked to work fine e9b58f2
from rebar3.
Closing since I pushed a fix and haven't heard anything since.
from rebar3.
i just tried to build merl, and so far no joy
from rebar3.
Yeah, it looks like this may have regressed.
from rebar3.
What is the error?
from rebar3.
Almost the same as the initial error. Thought it was identical at first glance.
===> Compiling merl
===> Compiling /home/ricecake/Projects/knot/_build/default/lib/merl/src/merl_tests.erl failed
/home/ricecake/Projects/knot/_build/default/lib/merl/src/merl_tests.erl:none: undefined parse transform 'merl_transform'
Using the nightly build.
from rebar3.
Are you setting anything in your rebar.config for building merl? The way erlydtl does it will no longer work because it expects a pre-compile hook on erlydtl to run before compilation of merl and that isn't how it works in rebar3. In rebar3 pre-compile hooks are per-app.
Here is what you can do for merl as a dep of a rebar3 project:
{overrides, [{override, merl,
[{pre_hooks,
[{"(linux|darwin|solaris)", compile, "make -C \"$REBAR_DEPS_DIR/merl\" all -W test"},
{"(freebsd|netbsd|openbsd)", compile, "gmake -C \"$REBAR_DEPS_DIR/merl\" all"},
{"win32", compile, "make -C \"%REBAR_DEPS_DIR%/merl\" all -W test"},
{eunit,
"erlc -I include/erlydtl_preparser.hrl -o test"
" test/erlydtl_extension_testparser.yrl"},
{"(linux|darwin|solaris)", eunit, "make -C \"$REBAR_DEPS_DIR/merl\" test"},
{"(freebsd|netbsd|openbsd)", eunit, "gmake -C \"$REBAR_DEPS_DIR/merl\" test"},
{"win32", eunit, "make -C \"%REBAR_DEPS_DIR%/merl\" test"}
]}]}]}.
from rebar3.
Ah, neat. That does indeed allow it to compile.
Thanks for the insight! :)
from rebar3.
Hi @tsloughter, no success here. I guess I'm trying your approach:
{erl_opts, [debug_info]}.
{overrides, [{override, merl,
[{pre_hooks,
[{"(linux|darwin|solaris)", compile, "make -C \"$REBAR_DEPS_DIR/merl\" all -W test"},
{"(freebsd|netbsd|openbsd)", compile, "gmake -C \"$REBAR_DEPS_DIR/merl\" all"},
{"win32", compile, "make -C \"%REBAR_DEPS_DIR%/merl\" all -W test"},
{eunit,
"erlc -I include/erlydtl_preparser.hrl -o test"
" test/erlydtl_extension_testparser.yrl"},
{"(linux|darwin|solaris)", eunit, "make -C \"$REBAR_DEPS_DIR/merl\" test"},
{"(freebsd|netbsd|openbsd)", eunit, "gmake -C \"$REBAR_DEPS_DIR/merl\" test"},
{"win32", eunit, "make -C \"%REBAR_DEPS_DIR%/merl\" test"}
]}]}]}.
{deps, [
{webmachine, {git, "git://github.com/basho/webmachine.git"}},
{erlydtl, {git, "git://github.com/evanmiller/erlydtl.git"}}
]}.
But, I get this error:
rebar3 compile
===> Verifying dependencies...
===> Compiling merl
erlc -pz ./priv -pa ./ebin +debug_info -o ebin/ src/merl_transform.erl
erlc -pz ./priv -pa ./ebin +debug_info -o ebin/ src/merl_tests.erl
===> Compiling /Users/milinostroza/Sandbox/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl/src/merl_transform.erl failed
/Users/milinostroza/Sandbox/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl/src/merl_transform.erl:none: undefined parse transform 'merl_transform'
from rebar3.
@minostro are you on the latest rebar3 (master or download the nightly from rebar3.org)?
from rebar3.
Sorry for not being specific. I'm using master c20ea1c924f4d9a36987b3a8a11b5749c7bbbe7a
Here the version:
rebar3 --version
rebar 3.0.0-alpha-6 on Erlang/OTP 17 Erts 6.4
I tried with the nightly build:
curl https://s3.amazonaws.com/rebar3/rebar3 >> rebar4
➜ ~ chmod u+x rebar4
➜ ~ ./rebar4
escript: exception error: undefined function rebar4:main/1
in function escript:run/2 (escript.erl, line 752)
in call from escript:start/1 (escript.erl, line 276)
in call from init:start_it/1
in call from init:start_em/1
But I got that error.
from rebar3.
Yea, you can't rename it.
I'll try again with your config.
from rebar3.
@tsloughter oops, I didn't realize I cannot change the name of the executable to rebar4
, my bad. I rename it to rebar3
, but the issue is still there.
from rebar3.
Hm, well this sucks, I copied and pasted your config to a new app and it compiled everything fine.
from rebar3.
@tsloughter I'm using OS X Yosemite. The rebar3 versions are the same for the nightly build as well as the one I'm building from master: rebar 3.0.0-alpha-6 on Erlang/OTP 17 Erts 6.4
.
from rebar3.
I'm on linux, so we should be running the same make commands. Also erts 6.4.
from rebar3.
Maybe someone else on this thread can try who is running osx :)
from rebar3.
Can validate, I get the same bug on erts 6-2 on OSX:
===> Compiling /private/tmp/check/_build/default/lib/merl/src/merl_transform.erl failed
/private/tmp/check/_build/default/lib/merl/src/merl_transform.erl:none: undefined parse transform 'merl_transform'
from rebar3.
Hot damn merl_transform tries to applies itself to itself and is intended to be done that way? I'm not familiar enough with make to figure this one out.
@tsloughter what do you have as a make version? I get:
→ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
At this point I'm wondering if it isn't some of the make stuff itself that's failing.
from rebar3.
Yea, merl is weird and annoying. It is part of why I wanted to ditch erlydtl.
λ make --version
GNU Make 4.0
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
from rebar3.
I'm gonna blame the make version. I get the same failure on Make 3.81 on Ubuntu. @minostro can you confirm your version is below 4.0? I'm not set up to upgrade either of my Make versions right now, so I can't try that as a workaround.
from rebar3.
@ferd confirmed.
➜ ~ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
from rebar3.
@ferd @tsloughter I tried it again in a ubuntu (latest), and I was able to rebar3 compile
.
root@8a8e946d1e2a:/ticket-dispenser/multiple_dispenser_otp# make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-pc-linux-gnu
root@8a8e946d1e2a:/ticket-dispenser/multiple_dispenser_otp# rebar3 shell
===> Verifying dependencies...
===> Compiling merl
make: Entering directory `/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl'
erlc -pz ./priv -pa ./ebin +debug_info -o ebin/ src/merl.erl
src/merl.erl:47: Warning: erl_scan:location(): deprecated (will be removed in OTP 19); use erl_anno:location() instead
erlc -DMERL_NO_TRANSFORM +debug_info -o priv/ src/merl_transform.erl
erlc -pz ./priv -pa ./ebin +debug_info -o ebin/ src/merl_transform.erl
erlc -pz ./priv -pa ./ebin +debug_info -o ebin/ src/merl_tests.erl
make: Leaving directory `/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl'
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl/src/merl.erl:47: Warning: erl_scan:location(): deprecated (will be removed in OTP 19); use erl_anno:location() instead
===> Compiling eunit_formatters
===> Compiling erlydtl
make: Entering directory `/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl'
erlc -pz ./priv -pa ./ebin +debug_info -o ebin/ src/merl_tests.erl
make: Leaving directory `/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/merl'
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/erlydtl/include/erlydtl_preparser.hrl:168: Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19); use erl_scan:{category,column,line,location,symbol,text}/1 instead
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/erlydtl/include/erlydtl_preparser.hrl:169: Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19); use erl_scan:{category,column,line,location,symbol,text}/1 instead
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/erlydtl/include/erlydtl_preparser.hrl:173: Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19); use erl_scan:{category,column,line,location,symbol,text}/1 instead
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/erlydtl/include/erlydtl_preparser.hrl:192: Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19); use erl_scan:{category,column,line,location,symbol,text}/1 instead
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/erlydtl/include/erlydtl_preparser.hrl:198: Warning: erl_scan:token_info/2: deprecated (will be removed in OTP 19); use erl_scan:{category,column,line,location,symbol,text}/1 instead
/ticket-dispenser/multiple_dispenser_otp/_build/default/lib/erlydtl/src/erlydtl_filters.erl:527: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
===> Compiling dispenser
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:8:8] [async-threads:0] [kernel-poll:false]
Eshell V7.0 (abort with ^G)
1>
from rebar3.
Well what the hell. So it's not the make version.
from rebar3.
after bashing my head into the wall over this, i am now of the opinion the easiest fix is to add a rebar option like {bypass_rebar, "make"}
to just make rebar not, and run the designated shell command instead.
from rebar3.
if the compile module accepted pa/pz flags it might be possible, but they are limited to invocations of erlc directly
from rebar3.
Is there a solution for erlang runtimes < 18?
from rebar3.
Just curious! Have you found a solution for OTP < 18? One of my library is impacted by same issue. I would say that OTP 17.x is not critical for me but It is nice to have
from rebar3.
Related Issues (20)
- 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
- cover aggregation bug HOT 6
- `REBAR_SRC_DIRS` not available in hook HOT 5
- code:lib_dir/2 is deprecated; this functionality will be removed in a future release HOT 4
- How to execute a Function just before aborting rebar3 shell? HOT 6
- Cannot deploy application because of "Uncaught error in rebar_core" HOT 1
- tests in separate test modules are performed twice by eunit command HOT 6
- error rebar_core HOT 2
- Request new `rebar3` release HOT 4
- rebar3 shell doesn't return prompt HOT 1
- ENV variable replacement with nested configs in releases HOT 3
- Fetching dependency by git ref fails when upgrading to Erlang 26 HOT 2
- `bootstrap --offline` uses https_proxy HOT 3
- rebar3 shell randomly fails on Windows in OTP 27 HOT 4
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.