GithubHelp home page GithubHelp logo

Comments (7)

tsloughter avatar tsloughter commented on July 21, 2024

The package name is only use in rebar.config. In .app.src you use the application name.

from relx.

tsloughter avatar tsloughter commented on July 21, 2024

Same for the list of applications in the release, as in the list of apps in {relx, [{release, {r, "1"}, [app_1]}]}. The only place package name is ever used is deps.

from relx.

choptastic avatar choptastic commented on July 21, 2024

Thanks, I hadn't noticed the {AppName, {pkg, PkgName}} option here: https://hex.pm/docs/rebar3_usage (hiding in plain sight)

It's notable that https://hex.pm/docs/rebar3_publish does specify that you can add pkg_name to the .app.src file, but it doesn't specifically mention that if you do that, you'll also need to specify the package name in rebar.config, otherwise bad things might happen.

I also see that the pkg_name term for the .app.src isn't specified anywhere on rebar3.org, and seems to only exist on hex.pm. I will contact the hex.pm team to suggest updates to the documentation, unless you happen to know if the documentation for hex.pm exists somewhere in a publicly editable state.

Thanks again.

from relx.

tsloughter avatar tsloughter commented on July 21, 2024

Oooh, that is about naming the package you are publishing, not the dependency of a package. If you need to name your package different you put pkg_name in your .app.src like in the docs. But that is just publishing data.

from relx.

choptastic avatar choptastic commented on July 21, 2024

Indeed, but once that's done, it's not currently clear that doing so means you must also specify the package name explicitly in rebar deps as {AppName, {pkg, PkgName}}. That bit wasn't obvious (to me, anyway).

This was one of those situations where I wasn't really sure which app or config was at fault, since it's an interplay between rebar3, hex, and relx. But since the error itself manifested when making a release with relx, that's where I went with my questions.

So, in short, I've learned that:

  1. Specifying {pkg_name, PackageName} in .app.src, means you must:
  2. Specify {AppName, {pkg, PackageName}} in deps in rebar.config, otherwise:
  3. relx will crash when making a release.

As this isn't a bug with relx, but can be a little difficult to troubleshoot if misconfigured, I propose some improved error messages with this PR: #893

Hopefully this is okay!

Thanks again for the help!

from relx.

tsloughter avatar tsloughter commented on July 21, 2024

It should actually fail earlier than a release build. rebar3 should fail to build the application if you use {deps, [PackageName]}. So I'm not sure how you were able to get passed that?

from relx.

choptastic avatar choptastic commented on July 21, 2024

I'm not sure, but I'm not doing anything particularly crazy.

The package that set this off was erl_pipeline (with app name pipeline).

But I tested making a bare application and specifying erl_pipeline as the only dependency (where it should be {pipeline, {pkg, erl_pipeline}}), rebar3 compile pulls deps and compiles just fine.

from relx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.