Skip to content

Very strange cwd-dependent behavior #2187

Open
@CAD97

Description

@CAD97

Input C/C++ Header

I'm sorry, I have absolutely no idea how to go about minimizing this. (However, the linked headers have no system dependencies, at least.)

Bindgen Invocation

In this repo:

/crates/fmod-studio-sys>     bindgen inc/fmod_studio.h -o bindings.rs --no-prepend-enum-name \
    --blocklist-file inc/fmod.h \
    --blocklist-file inc/fmod_codec.h \
    --blocklist-file inc/fmod_common.h \
    --blocklist-file inc/fmod_dsp.h \
    --blocklist-file inc/fmod_dsp_effects.h \
    --blocklist-file inc/fmod_errors.h \
    --blocklist-file inc/fmod_output.h

/crates/fmod-studio-sys/inc> bindgen     fmod_studio.h -o bindings.rs --no-prepend-enum-name \
    --blocklist-file     fmod.h \
    --blocklist-file     fmod_codec.h \
    --blocklist-file     fmod_common.h \
    --blocklist-file     fmod_dsp.h \
    --blocklist-file     fmod_dsp_effects.h \
    --blocklist-file     fmod_errors.h \
    --blocklist-file     fmod_output.h

Expected Results

These two invocations would generate identical or nearly identical results.

Actual Results

The invocation from /crates/fmod-studio-sys uses old rust-target idioms (e.g. __BindgenUnionField instead of union) and does not include the definitions from the blocklisted files.

The invocation from /crates/fmod-studio-sys/inc uses current rust-target idioms (e.g. union instead of __BindgenUnionField) and includes the definitions from the blocklisted files.

--dump-preprocessed-input shows the only preprocessed input difference as the line directives' filenames. Something spooky is going on.

> bindgen --version
bindgen 0.59.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions