Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Correct current script dir detection for GCC #23179

Merged
merged 4 commits into from
Mar 18, 2019

Conversation

franksinankaya
Copy link

Current path detection was fixed in clang script but skipped in gcc. Copy and paste the solution.

@franksinankaya
Copy link
Author

@am11 @jkotas @janvorli

@franksinankaya
Copy link
Author

franksinankaya commented Mar 12, 2019

@dotnet-bot retest Ubuntu x64 Checked CoreFX Tests
@dotnet-bot retest Ubuntu x64 Checked Innerloop Build and Test

@franksinankaya franksinankaya force-pushed the gcc_cleanup_11 branch 2 times, most recently from 147cd97 to 2f951a4 Compare March 12, 2019 20:22
@franksinankaya franksinankaya force-pushed the gcc_cleanup_11 branch 6 times, most recently from e652adc to ec9aa04 Compare March 14, 2019 01:25
@franksinankaya
Copy link
Author

Time to check in?

@janvorli
Copy link
Member

I still keep thinking why the gen-buildsys-gcc.sh should not be a bash script. All of our other scripts are bash ones and so just one of them being more general shell script doesn't seem to be beneficial. And if that script was bash too, we could leave the script path extraction as it was in the clang script and would not have to pass it as an extra argument.

@franksinankaya
Copy link
Author

I think the platform where @am11 is planning to use gcc doesn't have bash. He made me remove it during code review.

@janvorli
Copy link
Member

I think the platform where @am11 is planning to use gcc doesn't have bash

The build.sh and other scripts we use are bash, so it seems unnecessary to have just one script more general when it is sourced from a bash one anyways.

@franksinankaya
Copy link
Author

@am11: looking at you for the full story.

Are we trying to make shellcheck happy or is there a real reason behind no-BASHism?

@am11
Copy link
Member

am11 commented Mar 16, 2019

At the point when it was added, there was no bash specific feature being used, so I proposed this change so to use the dependencies sparingly. Now that we have this file being sourced, if we need to resolve ScriptPath using BASH[] variable, we can change line#1 in gcc file from sh to bash. However, if we can avoid it, that would be better. Other platforms also keep their build script POSIX compatible, as well as the scripts they ship with products for runtime; to keep them dependency-free and portable by design.

I started with by conveting all (58) *.sh in repo, mostly it is straightforward and some cases, such as build-test.sh, require bit of a refctoring around the usage of arrays. The idea was to provide a 1:1 drop-in POSIX script replacement. This is to remove dependency from build and run times. Mainly the Bash specific feature used in dotnet repos is array, which could be extracted out as few helper functions (http://www.etalabs.net/sh_tricks.html).

@franksinankaya
Copy link
Author

I can keep this version since it does work.

@franksinankaya
Copy link
Author

@dotnet-bot retest coreclr-ci
@dotnet-bot retest coreclr-ci (Build Linux arm64 debug)
@dotnet-bot retest coreclr-ci (Build Linux_musl arm64 checked)

@janvorli
Copy link
Member

Ok, let's keep the gen-buildsys-gcc.sh as universal shell script.

@franksinankaya
Copy link
Author

@dotnet-bot test CentOS7.1 x64 Checked Innerloop Build and Test please

@franksinankaya
Copy link
Author

I think we have beaten this change enough.

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@janvorli janvorli merged commit 7c0849e into dotnet:master Mar 18, 2019
@franksinankaya franksinankaya deleted the gcc_cleanup_11 branch March 18, 2019 17:54
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…up_11

Correct current script dir detection for GCC

Commit migrated from dotnet/coreclr@7c0849e
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants