Open SquallATF opened 3 years ago
@SquallATF this is certainly not an environment we've tried before. I'm surprised that the JVM under Cygwin is reporting os.name == "Windows"
, but I guess it does.
I'd certainly review a patch to make this condition handle your use case. What do you propose? Perhaps we could look at some environment variables (say, SHELL
)? Actually OSTYPE
looks hopeful. What do you think?
Sounds like OSTYPE
is a bash
-ism; maybe we check that and fall back to uname
? I'm not sure what's best and most efficient here.
I think just test SHELL
it is ok, OSTYPE
is not a environment variables.
another probleam is rust can not run linker-wrapper.sh
directly.
https://github.com/rust-lang/rust/blob/6fd7a6dc0f5c4c8fd51d57c0f4f795d52481f904/compiler/rustc_codegen_ssa/src/back/link.rs#L154-L171
Huh, I didn't realize that OSTYPE
was a built-in and not an environment variable. How irritating.
What do you propose to do about Rust invoking the linker wrapper under Cygwin? I suppose that we can invoke $SHELL linker-wrapper.sh ...
, if that works in practice? Or do we still want to use the .bat
file under Cygwin?
Basically, I'll happily review a patch for this, but I'm not going to address it myself.
https://github.com/mozilla/rust-android-gradle/blob/aff8cdb1fbb9d28469cff98ab6c5ed60a764e12c/plugin/src/main/kotlin/com/nishtahir/CargoBuildTask.kt#L183
if run gradlew under Msys2 or Cygwin and use windows java will also report
os.name
isWindows
, so that will always invokelinker-wrapper.bat
notlinker-wrapper.sh
. but if Cygwin native command run under winshell, will expand linker response file to command arguments and that causeArgument list too long
error. https://github.com/cygwin/cygwin/blob/44eb4163234089e8830b018dbcf6a08333eab202/winsup/cygwin/dcrt0.cc#L337-L343Wish test if shell is bash then run
linker-wrapper.sh
notlinker-wrapper.bat
under windows.