Skip to content

Conversation

@chouquette
Copy link
Contributor

Some software might require to be able to load their dependencies at build time.

In my case, python3 will attempt to load the freshly built modules to ensure they are functional. If the dependency can't be found, the module is either deactivated or the build fails, depending on the module.

This change will automatically populate LD_LIBRARY_PATH on linux & freebsb, DYLD_LIBRARY_PATH on macOS, and resorts to no-op for windows.

I'm not sure about the windows flavors, besides the fact that not returning a string from increment_ld_library_path would cause this error:

Traceback (most recent call last):
	File "C:/bzl/bazel/d42blgaa/external/rules_foreign_cc+/foreign_cc/configure.bzl", line 70, column 33, in _configure_make
		return cc_external_rule_impl(ctx, attrs)
	File "C:/bzl/bazel/d42blgaa/external/rules_foreign_cc+/foreign_cc/private/framework.bzl", line 513, column 29, in cc_external_rule_impl
		convert_shell_script(ctx, script_lines),
	File "C:/bzl/bazel/d42blgaa/external/rules_foreign_cc+/foreign_cc/private/framework/helpers.bzl", line 74, column 43, in convert_shell_script
		return convert_shell_script_by_context(create_context(ctx), script)
	File "C:/bzl/bazel/d42blgaa/external/rules_foreign_cc+/foreign_cc/private/framework/helpers.bzl", line 90, column 31, in convert_shell_script_by_context
		script = [do_function_call(line, shell_context) for line in script]
	File "C:/bzl/bazel/d42blgaa/external/rules_foreign_cc+/foreign_cc/private/framework/helpers.bzl", line 186, column 46, in do_function_call
		(funname, after) = get_function_name(text.strip(" "))
Error: 'NoneType' value has no field or method 'strip'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant