)]}' { "commit": "6c6885302fd94f41b060013ea94eeb0d886124e2", "tree": "39b0e33c05ecb82f75e22051489d8f681da82bcd", "parents": [ "c46f0d71c492e58b2c5d0f151d085065982b8430" ], "author": { "name": "Eli Lipsitz", "email": "elipsitz@fb.com", "time": "Thu Jul 15 16:37:51 2021 -0700" }, "committer": { "name": "Commit Bot", "email": "commit-bot@chromium.org", "time": "Fri Jul 16 22:41:45 2021 +0000" }, "message": "Link Rust binaries against transitive public_deps\n\nAn earlier commit, 646a62e, changed how Rust links against native\ndependencies. Rather than a `-l...` argument to instruct rustc to\nlink against the specified library, GN uses `-Clink-arg\u003d` to bypass\nrustc and directly instruct the linker to link the native library.\n\nOne implication of this change is that Rust binaries no longer link\nagainst native libraries that they transitively depend on through\na Rust library dependency\u0027s public dependency.\n\nMore concretely, say Rust binary A depends on Rust library B,\nwhich depends on native library C, which also declares a public_dep\non D. B is therefore allowed to use D, and must link against it.\nHowever, B isn\u0027t actually linked -- A is the binary that gets\nlinked. If A uses a method from B that uses a method from D, A\nmust link against D.\n\nAfter the previously mentioned change, A no longer links against D.\nIf B were to explicitly depend on D (rather than depend on it through\nC\u0027s public_deps), this would work.\n\nThis commit fixes the issue by ensuring that public dependencies on\nshared libraries are propagated up through the list of Rust\ntransitive library dependencies, allowing the final Rust binary\nto link against all necessary native libraries.\n\nChange-Id: I374167db1b9338f42426f1cbd6f15dd535358d94\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/12001\nReviewed-by: Tyler Mandry \u003ctmandry@google.com\u003e\nCommit-Queue: Tyler Mandry \u003ctmandry@google.com\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "8d3f07ec9c06e856f30ca0870d79a67a693b6245", "old_mode": 33188, "old_path": "src/gn/ninja_rust_binary_target_writer_unittest.cc", "new_id": "b03b2cb3b0908b6c723adf6730ad8ffe8988ea29", "new_mode": 33188, "new_path": "src/gn/ninja_rust_binary_target_writer_unittest.cc" }, { "type": "modify", "old_id": "bd3fb5851bd531e7ffc8135673858add3fdf411c", "old_mode": 33188, "old_path": "src/gn/target.cc", "new_id": "5600f46e9f45379145794270df572cf328f6b92e", "new_mode": 33188, "new_path": "src/gn/target.cc" } ] }