Skip to content

Fix NoneType exception for interface dependencies.#3563

Merged
UebelAndre merged 3 commits intobazelbuild:mainfrom
UebelAndre:dylib
Aug 30, 2025
Merged

Fix NoneType exception for interface dependencies.#3563
UebelAndre merged 3 commits intobazelbuild:mainfrom
UebelAndre:dylib

Conversation

@UebelAndre
Copy link
Copy Markdown
Collaborator

@UebelAndre UebelAndre commented Aug 22, 2025

Before this change any dependency with CcInfo which did not contain static or dynamic libraries (e.g. an interface library which has it's own fields for storing the underlying files) would result in the following error:

ERROR: /Users/user/Code/rules_rust/test/unit/cc_info/BUILD.bazel:4:19: in rust_shared_library rule //test/unit/cc_info:rust_dylib_with_interface_lib_dep:
Traceback (most recent call last):
	File "/Users/user/Code/rules_rust/rust/private/rust.bzl", line 126, column 32, in _rust_shared_library_impl
		return _rust_library_common(ctx, "cdylib")
	File "/Users/user/Code/rules_rust/rust/private/rust.bzl", line 190, column 32, in _rust_library_common
		return rustc_compile_action(
	File "/Users/user/Code/rules_rust/rust/private/rustc.bzl", line 1541, column 41, in rustc_compile_action
		dynamic_libraries = ctx.runfiles(files = [
Error in runfiles: at index 0 of files, got element of type NoneType, want File

This pull request fixes this exception.

@UebelAndre UebelAndre changed the title Fix NoneType exception for header-only dependencies. Fix NoneType exception for interface dependencies. Aug 22, 2025
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!

@UebelAndre UebelAndre added this pull request to the merge queue Aug 30, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 30, 2025
@UebelAndre UebelAndre added this pull request to the merge queue Aug 30, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 30, 2025
@UebelAndre UebelAndre enabled auto-merge August 30, 2025 20:11
@UebelAndre UebelAndre added this pull request to the merge queue Aug 30, 2025
Merged via the queue into bazelbuild:main with commit 31d8c8a Aug 30, 2025
3 checks passed
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.

2 participants