Skip to content

Difficulty including file from a dependency, for the dependency #2610

Open
@kennedyjosh

Description

@kennedyjosh

Environment

% ./rebar3 report compile
Rebar3 report
 version 3.16.1
 generated at 2021-08-26T20:51:42+00:00
=================
Task: compile
Entered as:
  compile
-----------------
Operating System: x86_64-apple-darwin20.4.0
ERTS: Erlang/OTP 23 [erts-11.2.2.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] [dtrace]
Root Directory: /usr/local/Cellar/erlang@23/23.3.4.5_1/lib/erlang
Library directory: /usr/local/Cellar/erlang@23/23.3.4.5_1/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.10.0
certifi: 2.6.1
cf: 0.3.1
common_test: 1.20.2.2
compiler: 7.6.9.1
crypto: 4.9.0.2
cth_readable: 1.5.1
dialyzer: 4.3.1.1
edoc: 0.12
erlware_commons: 1.5.0
eunit: 2.6
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 4.0.1
inets: 7.3.2.1
kernel: 7.3.1.2
providers: 1.8.1
public_key: 1.10.0.1
relx: 4.4.0
sasl: 4.0.2
snmp: 5.8.0.1
ssl_verify_fun: 1.1.6
stdlib: 3.14.2.2
syntax_tools: 2.5
tools: 3.4.4

-----------------
Escript path: /Users/josh/Code/project/rebar3
Providers:
  app_discovery as clean clean compile compile compile cover ct cut deps dialyzer do docs edoc escriptize eunit get-deps help install install_deps key list lock new owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user version xref 

My project, project, has a dependency, dep0. The (simplified) file structure is as follows:

project
  | _build
    | default
      | lib
        | dep0
          | include
            | proto
              | out.hrl
          | proto
            | out.proto
          | src
            | proto
              | out.erl
          | rebar.config
  | include
  | src
  | test
  rebar.config

Current behaviour

I compile project using rebar3 compile. The proto compiler works (successfully compiling out.erl and out.hrl where they belong) but I get an error:

_build/default/lib/dep0/src/proto/out.erl:48: can't find include file "out.hrl"

dep0 compiles successfully on its own (aka, not as a dependency). The config file for dep0 includes the include/proto dir:

{erl_opts, [nowarn_deprecated_function,
            warn_export_all,
            {lager_truncation_size, 15360}, %% 15KB
            {i, "include/proto"},
            {i, "_build/default/plugins/gpb/include"}]}.

In addition, I have tried adding the include/proto dir to project's config:

{erl_opts, [nowarn_deprecated_function,
            {i, "include"},
            {i, "include/proto"},
            %% ...
            {i, "_build/default/lib/dep0/include"},
            {i, "_build/default/lib/dep0/include/proto"},
            %% ...
]}.

Expected behaviour

I expect compilation to succeed as I have told rebar (in the dependency and the main project) where to find the file its complaining about, but compilation fails when it cannot find the file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportquestion relative to usage or functionality of rebar3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions