Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #134067

Closed
wants to merge 42 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
529aae6
wasi/fs: Improve stopping condition for <ReadDir as Iterator>::next
osiewicz Nov 18, 2024
692c19a
Refactor ReadDir into a state machine
osiewicz Nov 26, 2024
f4ab982
chore: Improve doc comments
osiewicz Nov 26, 2024
9142cae
add `LinkageInfo` to keep track of how we figured out the linkage
folkertdev Aug 8, 2024
bdf64e1
squashed changes to inlining and const eval
folkertdev Jul 19, 2024
d67a5c0
test the new global asm output of naked functions
folkertdev Jul 19, 2024
a93192c
add `InstructionSetAttr::as_str` and make the type `Copy`
folkertdev Jul 20, 2024
49a297a
squashed changes to tests
folkertdev Jul 20, 2024
589ebb8
make naked functions always have external linkage *in LLVM*. If we do…
folkertdev Jul 26, 2024
2e24cdb
squashed changes:
folkertdev Aug 11, 2024
64420b6
skip `predefine_fn` for naked functions
folkertdev Nov 30, 2024
cf738f6
Revert "add `LinkageInfo` to keep track of how we figured out the lin…
folkertdev Nov 30, 2024
868668e
Run `cargo update` and update licenses
clubby789 Nov 25, 2024
30847eb
use vendor sources by default on dist tarballs
onur-ozkan Dec 4, 2024
a6aaef1
update `build.vendor` documentation
onur-ozkan Dec 4, 2024
9ca9b41
add a change entry for new default on `build.vendor`
onur-ozkan Dec 4, 2024
18f8657
Pass -bnoipath when adding rust upstream dynamic crates
Aug 9, 2024
1ae1f8c
Clarify comment
daltenty Dec 6, 2024
3109f07
Replace sa_sigaction with sa_union.__su_sigaction for AIX.
xingxue-ibm Dec 6, 2024
ab2ee7a
Use option "-sf" for the AIX "ln" command.
xingxue-ibm Dec 6, 2024
f884f18
Move tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`
Zalathar Dec 7, 2024
0a48b96
Move more tests into `tests/ui/link-native-libs`
Zalathar Dec 7, 2024
88669ae
Don't use AsyncFnOnce::CallOnceFuture bounds for signature deduction
compiler-errors Dec 7, 2024
9eb35a0
fix the `naked-asan` test
folkertdev Dec 1, 2024
c4d7f1d
implement `TargetSelection::is_cygwin` function
onur-ozkan Dec 8, 2024
d3b5340
handle cygwin environments in `install::sanitize_sh`
onur-ozkan Dec 8, 2024
5e66869
Pass the arch rather than full target name to windows_registry::find_…
bjorn3 Dec 6, 2024
2d8a871
Downgrade cc
clubby789 Dec 8, 2024
999aed4
Add URL to test cases
notriddle Dec 9, 2024
b531854
rustdoc: rename `issue-\d+.rs` tests to have meaningful names
notriddle Dec 9, 2024
4e3d98c
Rollup merge of #128004 - folkertdev:naked-fn-asm, r=Amanieu
jieyouxu Dec 9, 2024
7dccbd7
Rollup merge of #133184 - osiewicz:wasm-fix-infinite-loop-in-remove-d…
jieyouxu Dec 9, 2024
d30f500
Rollup merge of #133456 - clubby789:cargo-update, r=ChrisDenton
jieyouxu Dec 9, 2024
0a9bcd8
Rollup merge of #133853 - onur-ozkan:use-vendor-directory-on-dist-bui…
jieyouxu Dec 9, 2024
445eda8
Rollup merge of #133955 - bjorn3:cc_pass_arch_only, r=ChrisDenton
jieyouxu Dec 9, 2024
bf1bd97
Rollup merge of #133967 - daltenty:daltenty/bnoipath, r=jieyouxu
jieyouxu Dec 9, 2024
a53b203
Rollup merge of #133970 - xingxue-ibm:sigaction, r=nnethercote
jieyouxu Dec 9, 2024
2a224ed
Rollup merge of #133980 - xingxue-ibm:ln-option-aix, r=jieyouxu
jieyouxu Dec 9, 2024
721916a
Rollup merge of #133996 - Zalathar:ui-link-native-libs, r=jieyouxu
jieyouxu Dec 9, 2024
2619da7
Rollup merge of #134017 - compiler-errors:call-once-deduction, r=jiey…
jieyouxu Dec 9, 2024
6de5012
Rollup merge of #134023 - onur-ozkan:132507, r=jieyouxu
jieyouxu Dec 9, 2024
e6f32e8
Rollup merge of #134053 - notriddle:notriddle/issue-d, r=GuillaumeGomez
jieyouxu Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle cygwin environments in install::sanitize_sh
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Dec 8, 2024
commit d3b53408789ad749b027a1932459e22bc2685622
25 changes: 13 additions & 12 deletions src/bootstrap/src/core/build_steps/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const SHELL: &str = "sh";

/// We have to run a few shell scripts, which choke quite a bit on both `\`
/// characters and on `C:\` paths, so normalize both of them away.
fn sanitize_sh(path: &Path) -> String {
fn sanitize_sh(path: &Path, is_cygwin: bool) -> String {
let path = path.to_str().unwrap().replace('\\', "/");
return change_drive(unc_to_lfs(&path)).unwrap_or(path);
return if is_cygwin { path } else { change_drive(unc_to_lfs(&path)).unwrap_or(path) };

fn unc_to_lfs(s: &str) -> &str {
s.strip_prefix("//?/").unwrap_or(s)
Expand Down Expand Up @@ -71,6 +71,7 @@ fn install_sh(
let prefix = default_path(&builder.config.prefix, "/usr/local");
let sysconfdir = prefix.join(default_path(&builder.config.sysconfdir, "/etc"));
let destdir_env = env::var_os("DESTDIR").map(PathBuf::from);
let is_cygwin = builder.config.build.is_cygwin();

// Sanity checks on the write access of user.
//
Expand Down Expand Up @@ -103,14 +104,14 @@ fn install_sh(

let mut cmd = command(SHELL);
cmd.current_dir(&empty_dir)
.arg(sanitize_sh(&tarball.decompressed_output().join("install.sh")))
.arg(format!("--prefix={}", prepare_dir(&destdir_env, prefix)))
.arg(format!("--sysconfdir={}", prepare_dir(&destdir_env, sysconfdir)))
.arg(format!("--datadir={}", prepare_dir(&destdir_env, datadir)))
.arg(format!("--docdir={}", prepare_dir(&destdir_env, docdir)))
.arg(format!("--bindir={}", prepare_dir(&destdir_env, bindir)))
.arg(format!("--libdir={}", prepare_dir(&destdir_env, libdir)))
.arg(format!("--mandir={}", prepare_dir(&destdir_env, mandir)))
.arg(sanitize_sh(&tarball.decompressed_output().join("install.sh"), is_cygwin))
.arg(format!("--prefix={}", prepare_dir(&destdir_env, prefix, is_cygwin)))
.arg(format!("--sysconfdir={}", prepare_dir(&destdir_env, sysconfdir, is_cygwin)))
.arg(format!("--datadir={}", prepare_dir(&destdir_env, datadir, is_cygwin)))
.arg(format!("--docdir={}", prepare_dir(&destdir_env, docdir, is_cygwin)))
.arg(format!("--bindir={}", prepare_dir(&destdir_env, bindir, is_cygwin)))
.arg(format!("--libdir={}", prepare_dir(&destdir_env, libdir, is_cygwin)))
.arg(format!("--mandir={}", prepare_dir(&destdir_env, mandir, is_cygwin)))
.arg("--disable-ldconfig");
cmd.run(builder);
t!(fs::remove_dir_all(&empty_dir));
Expand All @@ -120,7 +121,7 @@ fn default_path(config: &Option<PathBuf>, default: &str) -> PathBuf {
config.as_ref().cloned().unwrap_or_else(|| PathBuf::from(default))
}

fn prepare_dir(destdir_env: &Option<PathBuf>, mut path: PathBuf) -> String {
fn prepare_dir(destdir_env: &Option<PathBuf>, mut path: PathBuf, is_cygwin: bool) -> String {
// The DESTDIR environment variable is a standard way to install software in a subdirectory
// while keeping the original directory structure, even if the prefix or other directories
// contain absolute paths.
Expand All @@ -146,7 +147,7 @@ fn prepare_dir(destdir_env: &Option<PathBuf>, mut path: PathBuf) -> String {
assert!(path.is_absolute(), "could not make the path relative");
}

sanitize_sh(&path)
sanitize_sh(&path, is_cygwin)
}

macro_rules! install {
Expand Down
Loading