{"query_id": "q-en-rust-6bfd1043e57920f5ebdb2f39053599f3a97cc146682b8dfafd0f928d39f82647", "query": "I am attempting to use the () syntax to control how my test binary is compiled. I have created a repro at In , I tell to link 2 static libraries, one with (+whole-archive) and one without (-whole-archive). I add a nonsense link argument so I can inspect the produced link line. I expect to see linked without whole archive. Instead, I see both and libraries linked with --whole-archive: This may be related to the default documented . When I use nightly and specify it works as expected: However, I cannot use the nightly toolchain, so I cannot use , and seems inappropriate for a final binary crate types like cdylib, staticlib, and executables anyway. Tested with 1.62.1 stable and 1.64 nightly. Possibly related issues: ,\nThis is a bug introduced in The backward compatibility condition should look like and not .\nCould you submit a PR with this fix? (We can backport it to beta if it's done in time.)\nSure, I'll create a PR. I'm not sure what tests to include, however. I had been looking at that exact code and almost submitted a PR earlier, but I wasn't sure about the whole context of that code and all the compatibility needs.\nYou can try adding a test case with to . One with and , and another with and without any (the compatibility case).", "positive_passages": [{"docid": "doc-en-rust-4afe5857f53f951490166aa76a1b7c29ce180c19c88275a9279183844654065a", "text": "// be added explicitly if necessary, see the error in `fn link_rlib`) compiled // as an executable due to `--test`. Use whole-archive implicitly, like before // the introduction of native lib modifiers. || (bundle != Some(false) && sess.opts.test) || (whole_archive == None && bundle != Some(false) && sess.opts.test) { cmd.link_whole_staticlib( name,", "commid": "rust_pr_100068"}], "negative_passages": []}
{"query_id": "q-en-rust-6bfd1043e57920f5ebdb2f39053599f3a97cc146682b8dfafd0f928d39f82647", "query": "I am attempting to use the () syntax to control how my test binary is compiled. I have created a repro at In , I tell to link 2 static libraries, one with (+whole-archive) and one without (-whole-archive). I add a nonsense link argument so I can inspect the produced link line. I expect to see linked without whole archive. Instead, I see both and libraries linked with --whole-archive: This may be related to the default documented . When I use nightly and specify it works as expected: However, I cannot use the nightly toolchain, so I cannot use , and seems inappropriate for a final binary crate types like cdylib, staticlib, and executables anyway. Tested with 1.62.1 stable and 1.64 nightly. Possibly related issues: ,\nThis is a bug introduced in The backward compatibility condition should look like and not .\nCould you submit a PR with this fix? (We can backport it to beta if it's done in time.)\nSure, I'll create a PR. I'm not sure what tests to include, however. I had been looking at that exact code and almost submitted a PR earlier, but I wasn't sure about the whole context of that code and all the compatibility needs.\nYou can try adding a test case with to . One with and , and another with and without any (the compatibility case).", "positive_passages": [{"docid": "doc-en-rust-624ae0ac265c5e384b2cc5141d19685b1cc3d46a07c1e1d230e838675c412dca", "text": "# ignore-cross-compile -- compiling C++ code does not work well when cross-compiling # This test case makes sure that native libraries are linked with --whole-archive semantics # when the `-bundle,+whole-archive` modifiers are applied to them. # This test case makes sure that native libraries are linked with appropriate semantics # when the `[+-]bundle,[+-]whole-archive` modifiers are applied to them. # # The test works by checking that the resulting executables produce the expected output, # part of which is emitted by otherwise unreferenced C code. If +whole-archive didn't work", "commid": "rust_pr_100068"}], "negative_passages": []}
{"query_id": "q-en-rust-6bfd1043e57920f5ebdb2f39053599f3a97cc146682b8dfafd0f928d39f82647", "query": "I am attempting to use the () syntax to control how my test binary is compiled. I have created a repro at In , I tell to link 2 static libraries, one with (+whole-archive) and one without (-whole-archive). I add a nonsense link argument so I can inspect the produced link line. I expect to see linked without whole archive. Instead, I see both and libraries linked with --whole-archive: This may be related to the default documented . When I use nightly and specify it works as expected: However, I cannot use the nightly toolchain, so I cannot use , and seems inappropriate for a final binary crate types like cdylib, staticlib, and executables anyway. Tested with 1.62.1 stable and 1.64 nightly. Possibly related issues: ,\nThis is a bug introduced in The backward compatibility condition should look like and not .\nCould you submit a PR with this fix? (We can backport it to beta if it's done in time.)\nSure, I'll create a PR. I'm not sure what tests to include, however. I had been looking at that exact code and almost submitted a PR earlier, but I wasn't sure about the whole context of that code and all the compatibility needs.\nYou can try adding a test case with to . One with and , and another with and without any (the compatibility case).", "positive_passages": [{"docid": "doc-en-rust-b6731058b5b36a612c3849f7ce661953e5a368440fb315c251e35e53770074fd", "text": "-include ../../run-make-fulldeps/tools.mk all: $(TMPDIR)/$(call BIN,directly_linked) $(TMPDIR)/$(call BIN,indirectly_linked) $(TMPDIR)/$(call BIN,indirectly_linked_via_attr) all: $(TMPDIR)/$(call BIN,directly_linked) $(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive) $(TMPDIR)/$(call BIN,directly_linked_test_minus_whole_archive) $(TMPDIR)/$(call BIN,indirectly_linked) $(TMPDIR)/$(call BIN,indirectly_linked_via_attr) $(call RUN,directly_linked) | $(CGREP) 'static-initializer.directly_linked.' $(call RUN,directly_linked_test_plus_whole_archive) --nocapture | $(CGREP) 'static-initializer.' $(call RUN,directly_linked_test_minus_whole_archive) --nocapture | $(CGREP) -v 'static-initializer.' $(call RUN,indirectly_linked) | $(CGREP) 'static-initializer.indirectly_linked.' $(call RUN,indirectly_linked_via_attr) | $(CGREP) 'static-initializer.native_lib_in_src.'", "commid": "rust_pr_100068"}], "negative_passages": []}
{"query_id": "q-en-rust-6bfd1043e57920f5ebdb2f39053599f3a97cc146682b8dfafd0f928d39f82647", "query": "I am attempting to use the () syntax to control how my test binary is compiled. I have created a repro at In , I tell to link 2 static libraries, one with (+whole-archive) and one without (-whole-archive). I add a nonsense link argument so I can inspect the produced link line. I expect to see linked without whole archive. Instead, I see both and libraries linked with --whole-archive: This may be related to the default documented . When I use nightly and specify it works as expected: However, I cannot use the nightly toolchain, so I cannot use , and seems inappropriate for a final binary crate types like cdylib, staticlib, and executables anyway. Tested with 1.62.1 stable and 1.64 nightly. Possibly related issues: ,\nThis is a bug introduced in The backward compatibility condition should look like and not .\nCould you submit a PR with this fix? (We can backport it to beta if it's done in time.)\nSure, I'll create a PR. I'm not sure what tests to include, however. I had been looking at that exact code and almost submitted a PR earlier, but I wasn't sure about the whole context of that code and all the compatibility needs.\nYou can try adding a test case with to . One with and , and another with and without any (the compatibility case).", "positive_passages": [{"docid": "doc-en-rust-5c287c509077516e7d8920d4d582ea5496786a7d313c94b12f29b1ce5a9a9665", "text": "$(TMPDIR)/$(call BIN,directly_linked): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked.rs -l static:+whole-archive=c_static_lib_with_constructor # Native lib linked into test executable, +whole-archive $(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked_test_plus_whole_archive.rs --test -l static:+whole-archive=c_static_lib_with_constructor # Native lib linked into test executable, -whole-archive $(TMPDIR)/$(call BIN,directly_linked_test_minus_whole_archive): $(call NATIVE_STATICLIB,c_static_lib_with_constructor) $(RUSTC) directly_linked_test_minus_whole_archive.rs --test -l static:-whole-archive=c_static_lib_with_constructor # Native lib linked into RLIB via `-l static:-bundle,+whole-archive`, RLIB linked into executable $(TMPDIR)/$(call BIN,indirectly_linked): $(TMPDIR)/librlib_with_cmdline_native_lib.rlib $(RUSTC) indirectly_linked.rs", "commid": "rust_pr_100068"}], "negative_passages": []}
{"query_id": "q-en-rust-6bfd1043e57920f5ebdb2f39053599f3a97cc146682b8dfafd0f928d39f82647", "query": "I am attempting to use the () syntax to control how my test binary is compiled. I have created a repro at In , I tell to link 2 static libraries, one with (+whole-archive) and one without (-whole-archive). I add a nonsense link argument so I can inspect the produced link line. I expect to see linked without whole archive. Instead, I see both and libraries linked with --whole-archive: This may be related to the default documented . When I use nightly and specify it works as expected: However, I cannot use the nightly toolchain, so I cannot use , and seems inappropriate for a final binary crate types like cdylib, staticlib, and executables anyway. Tested with 1.62.1 stable and 1.64 nightly. Possibly related issues: ,\nThis is a bug introduced in The backward compatibility condition should look like and not .\nCould you submit a PR with this fix? (We can backport it to beta if it's done in time.)\nSure, I'll create a PR. I'm not sure what tests to include, however. I had been looking at that exact code and almost submitted a PR earlier, but I wasn't sure about the whole context of that code and all the compatibility needs.\nYou can try adding a test case with to . One with and , and another with and without any (the compatibility case).", "positive_passages": [{"docid": "doc-en-rust-67471abdd0ddc9119e2079c17e37000dac506c26c58ff18e79b3e69938c381a3", "text": " use std::io::Write; #[test] fn test_thing() { print!(\"ran the test\"); std::io::stdout().flush().unwrap(); } ", "commid": "rust_pr_100068"}], "negative_passages": []}
{"query_id": "q-en-rust-b9bac5eeea90d943d4c64a4113c95a2330a5912785a3a86724f8233e15b7e0db", "query": ": and then if I increase the recursion limit enough... adding a backtrace gives nothing new, however, compiling on nightly gives the following: