Skip to content

Adjust env for bindgen compilation.#916

Merged
illicitonion merged 5 commits intobazelbuild:mainfrom
grafica:fix_bindgen_includes_and_env
Aug 31, 2021
Merged

Adjust env for bindgen compilation.#916
illicitonion merged 5 commits intobazelbuild:mainfrom
grafica:fix_bindgen_includes_and_env

Conversation

@sayrer
Copy link
Copy Markdown
Contributor

@sayrer sayrer commented Aug 29, 2021

This fixes #899 by putting XCODE_VERSION_OVERRIDE, APPLE_SDK_VERSION_OVERRIDE, APPLE_SDK_PLATFORM in the env.

@google-cla google-cla Bot added the cla: yes label Aug 29, 2021
Copy link
Copy Markdown
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread bindgen/bindgen.bzl
}
cc_toolchain, feature_configuration = find_cc_toolchain(ctx)
_, _, linker_env = get_linker_and_args(ctx, ctx.attr, cc_toolchain, feature_configuration, None)
env.update(**linker_env)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need any special handling in the case of clashes with things we explicitly set? e.g. should we be prepending/appending to the LD_LIBRARY_PATH rather than overwriting it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's that issue, and whether the the system include directories from the cc_toolchain should be added. I'm inclined to leave it as I've written it, and adjust if people have problems with it, since this patch is clearly a step forward.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sounds reasonable - let's see how we go!

@illicitonion
Copy link
Copy Markdown
Collaborator

Can you push a rebase/merge-main, and I'll merge to main? :)

@sayrer
Copy link
Copy Markdown
Contributor Author

sayrer commented Aug 31, 2021

We should have the user in #899 contribute their test repo as an example, to get some coverage on this.

@illicitonion illicitonion merged commit 96e2d5b into bazelbuild:main Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust_bindgen fails on macOS due to fatal error: 'TargetConditionals.h' file not found

2 participants