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

Fails to create release when there is a non-Erlang deps (such as rebar raw dependencies) #30

Closed
nivertech opened this issue Sep 10, 2013 · 11 comments

Comments

@nivertech
Copy link

Relx fails to build a release, because I have a non-Erlang dependency without ebin folder or with empty ebin folder.
Like this one:
https://github.com/basho/node_package

There is also something called rebar raw dependencies [1] and I believe that more correct behaviour for Relx is either copy them to release or ignore them, but not to fail release creation altogether.

basho/rebar#217 (comment)

$ ./relx
Starting relx build process ...
Resolving OTP Applications from directories:
    /home/me/ws/myproject/lib
    /home/me/ws/myproject/deps
    /usr/local/lib/erlang/lib

no beam files found in directory /home/me/ws/myproject/deps/node_package/ebin

Usage: relx [-n <relname>] [-v <relvsn>] [-g <goal>] [-u <upfrom>]
            [-o <output_dir>] [-l <lib_dir>]
            [--disable-default-libs [<disable_default_libs>]]
            [-V [<log_level>]] [-a <override_app>] [-c [<config>]]
            [-r <root_dir>] [*release-specification-file*]

  -n, --relname           Specify the name for the release that will be 
                          generated
  -v, --relvsn            Specify the version for the release
  -g, --goal              Specify a target constraint on the system. These 
                          are usually the OTP
  -u, --upfrom            Only valid with relup target, specify the 
                          release to upgrade from
  -o, --output-dir        The output directory for the release. This is 
                          `./` by default.
  -l, --lib-dir           Additional dirs that should be searched for OTP 
                          Apps
  --disable-default-libs  Disable the default system added lib dirs (means 
                          you must add them all manually [default: false]
  -V, --verbose           Verbosity level, maybe between 0 and 2 [default: 
                          1]
  -a, --override_app      Provide an app name and a directory to override 
                          in the form <appname>:<app directory>
  -c, --config            The path to a config file [default: ]
  -r, --root              The project root directory

$ 
@nivertech
Copy link
Author

In case of node_package app, it does have a ebin/node_package.app file, which specifies empty modules list.
So it implicitly indicates thata there are no .beam files to look for.

{application,node_package,
             [{description,"RPM/Debian/Solaris packaging templates for Erlang Nodes"},
              {vsn,"1.2.1"},
              {modules,[]},
              {registered,[]},
              {applications,[]}]}.

@nivertech
Copy link
Author

Adding dummy beam file solves this problem. This is just a workaround - not perfect.

$ cd deps/node_package/ebin/
[ebin ((1.2.1))]$ touch dummy.beam
[ebin ((1.2.1))]$ cd ../../..
$ ./relx
Starting relx build process ...
Resolving OTP Applications from directories:
    /home/me/ws/myproject/lib
    /home/me/ws/myproject/deps
    /usr/local/lib/erlang/lib

Resolving available releases from directories:
    /home/me/ws/myproject/lib
    /home/me/ws/myproject/deps
    /usr/local/lib/erlang/lib

Resolved myproject-0.0.1
release successfully created!
$

@tsloughter
Copy link
Member

Hmm, this will actually conflict with a problem someone had where they wanted it to skip "apps" that didn't have beam files. But I am blanking though, @ericbmerritt do you remember? And relcool repo issues are gone.

Maybe that was why we added the skip_apps option... You can add these which have no beam files to your relx.config file under {skip_apps, []}.

@tsloughter
Copy link
Member

Ah, I remember a little more now, we don't want to skip apps with no beam files because that should mean the app is not compiled and something went wrong. So we added skip_apps.

@ericbmerritt
Copy link
Member

Actually #7 should solve this problem. We just need to finish it up, the original submitter never came back.

@nivertech
Copy link
Author

skip_apps doesn't work for me - using relx master

My relx.config file:

{
    release, {myapp, "0.0.1"},
    [myapp]
}.

{sys_config, "./bin/sys.config"}.

% skip OTP apps without .beam files
{skip_apps, [node_package]}.

Fails on:

$ ./relx 
Starting relx build process ...
Resolving OTP Applications from directories:
    /home/me/ws/myapp/lib
    /home/me/ws/myapp/deps
    /usr/local/lib/erlang/lib

no beam files found in directory /home/me/ws/myapp/deps/node_package/ebin

Usage: relx [-n <relname>] [-v <relvsn>] [-g <goal>] [-u <upfrom>]
            [-o <output_dir>] [-l <lib_dir>]
            [--disable-default-libs [<disable_default_libs>]]
            [-V [<log_level>]] [-a <override_app>] [-c [<config>]]
            [-r <root_dir>] [*release-specification-file*]

  -n, --relname           Specify the name for the release that will be 
                          generated
  -v, --relvsn            Specify the version for the release
  -g, --goal              Specify a target constraint on the system. These 
                          are usually the OTP
  -u, --upfrom            Only valid with relup target, specify the 
                          release to upgrade from
  -o, --output-dir        The output directory for the release. This is 
                          `./` by default.
  -l, --lib-dir           Additional dirs that should be searched for OTP 
                          Apps
  --disable-default-libs  Disable the default system added lib dirs (means 
                          you must add them all manually [default: false]
  -V, --verbose           Verbosity level, maybe between 0 and 2 [default: 
                          1]
  -a, --override_app      Provide an app name and a directory to override 
                          in the form <appname>:<app directory>
  -c, --config            The path to a config file [default: ]
  -r, --root              The project root directory

$

@tsloughter
Copy link
Member

Hm, that's no good. I'll look into this. As well as I'll try to get #7 done so skip_apps isn't needed either.

@tsloughter
Copy link
Member

@nivertech can you give master a try? We just merged a fix in #42

@nivertech
Copy link
Author

It works now, even without {skip_apps, [...]}.
Is this OK?

@jwilberding
Copy link
Member

@nivertech I believe that is supposed to be the correct behavior.

@tsloughter
Copy link
Member

Oops, replied in the wrong place. '@nivertech Yup, now it checks that it has a beam file for all modules listed in the applications .app file. So if there are none listed it is still considered valid if there are no beam files.'

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

No branches or pull requests

4 participants