{"thread":{"id":"65933","subject":"Re: [PATCH v4 2/2] Makefile: support universal macOS builds via RUST_TARGETS","startedAt":"2026-07-06T18:36:53Z","lastAt":"2026-07-06T18:36:53Z","messageCount":1,"participants":["Shardul Natu"],"isPatch":true,"patchVersion":4,"patchTotal":2},"messages":[{"id":"547256","messageId":"CABaQWZfS0utG6jfLcHTgHGYo_BTVJr=ZO4NuBDRPKRh+UF4Cvw@mail.gmail.com","threadId":"65933","inReplyTo":null,"subject":"Re: [PATCH v4 2/2] Makefile: support universal macOS builds via RUST_TARGETS","fromName":"Shardul Natu","fromEmail":"snatu@google.com","sentAt":"2026-07-06T18:36:40Z","receivedAt":"2026-07-06T18:36:53Z","isPatch":true,"body":"> I was wondering why no other target declares an explicit dependency on\n> RUST_LIB. As it turns out, all the other targets that link \"$(LIBS)\" all\n> already depend on \"$(GITLIBS)\", which includes both \"$(LIB_FILE)\" and\n> \"$(RUST_LIB)\". So shouldn't we also depend depend on \"$(GITLIBS)\" here\n> instead of on either of the other two variables?\n\nAh, a much cleaner cleanup! Done\n\n\n> s/rust/Rust/\nDone\n\n\n> With this we now have both:\n>\n> - target/$ARCH/$BUILD_CONFIG/\n>\n> - target/$BUILD_CONFIG/\n>\n> Is there any reason why we have to have those two different layouts\n> instead of swapping the order in the first item so that all artifacts\n> are in \"target/$BUILD_CONFIG/\"? Essentially, what I'm proposing instead\n> is:\n>\n> - \"target/$BUILD_CONFIG/\" for the final universal executable.\n>\n> - \"target/$BUILD_CONFIG/$ARCH\" for the per-arch artifacts.\n\nWhen you invoke \"cargo build --release --target x86_64-apple-darwin\",\nCargo automatically places the resulting artifacts under\n\"target/x86_64-apple-darwin/release/\".\n\nIf we tried to force Cargo to output under \"target/release/$ARCH\" by\npassing a custom \"--target-dir\", Cargo would still append its required\n\"$ARCH/$BUILD_CONFIG/\" structure inside that custom directory, resulting\nin nested paths like \"target/release/$ARCH/$ARCH/release/libgitcore.a\",\nor otherwise breaking Cargo's internal dependency caching and artifact\nsharing across builds.\n\nAnd so, we have to have \"target/$ARCH/$BUILD_CONFIG/\" for per-arch artifacts.\n"}]}