WhatsApp / eqwalizer

A type-checker for Erlang
Apache License 2.0
506 stars 27 forks source link

Return all include dirs as absolute paths #49

Open filmor opened 8 months ago

michalmuskala commented 8 months ago

Hi @filmor, thank you for the contribution. Could you explain what problem is this change solving?

filmor commented 8 months ago

Eqwalizer (via ELP) doesn't handle -include("some_header.hrl"). correctly in dependencies of rebar3 projects. I've seen this for amqp_client, gproc and ecron, error like this: image Structure here: https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/amqp_client

As you can see, amqp_client_internal.hrl is in include.

Without this patch, the path is not added to the include_dirs build info in Rust as the Rust code (rightly) expects absolute paths.

The actual problem is not completely solved by this (I think for rebar3 projects you are not filling include_path from include_dirs, not sure what the distinction is here), but it's a required change to fix elp.

ilya-klyuchnikov commented 8 months ago

@filmor - can you share step-by-step instructions to reproduce the behaviour? thanks

filmor commented 8 months ago

I'll try to reproduce the issue, but so far I've only seen the issue on our main codebase. The two submitted patches fix things for me, though.