-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add wkdev-setup-default-clang script #65
base: main
Are you sure you want to change the base?
Conversation
This allows easily installing and switching between different clang toolchains
df8d268
to
6947e62
Compare
ln -s "/usr/bin/${command}-18" "/usr/local/bin/${command}"; \ | ||
done && ln -s "/usr/bin/lld-18" "/usr/local/bin/ld.lld"; | ||
# Convenience symlinks for clang tools, the VSCode extension doesn't find these by default. | ||
# FIXME: Reduce code duplication with `wkdev-set-default-clang`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to invoke this script from here, no? Maybe at a later point in the script, but still..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wkdev-sdk scripts are not in the image. We could copy them and then remove them, feels not great either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as you copy and remove in the same layer, there is no increase an image size -- I agree looks odd, but helps reducing code duplication...
echo "" | ||
|
||
# Sanity check versions Ubuntu actually has. | ||
if (( $version < 14 )) || (( $version > 18)); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a fan of ${foo}
over $foo
-- can you adapt to keep things consistent wrt to the other scripts?
echo "" | ||
|
||
# Sanity check versions Ubuntu actually has. | ||
if (( $version < 14 )) || (( $version > 18)); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe introduce some minVersion/maxVersion variables in the pre-amble? Makes it easier to find and not forget about the other place that now use 14/18 (help text below)
|
||
# Sanity check versions Ubuntu actually has. | ||
if (( $version < 14 )) || (( $version > 18)); then | ||
echo "$version is not a valid value (between 14-18)." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
local output_path | ||
if [ "$EUID" -eq 0 ]; then | ||
output_path='/usr/local/bin' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could either omit the single quotes, or use double-quotes as we do for all the other strings, unless we do need to avoid variable replacments within the strings.
This allows easily installing and switching between different clang toolchains