-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve Spin support for new instances #7
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Running the scripts here helps Spin to do it in background | ||
# and then make a snapshot to save time at new instance creation. | ||
|
||
./bazel version | ||
|
||
# TODO: Make sure you have "/home/spin/.bazel_binaries/4.1.0/bin_t" in spin user path too. | ||
export PATH="/home/spin/.bazel_binaries/4.1.0/bin_t:$PATH" | ||
# Sets up go to definition in VS Code | ||
tools/scripts/build_compilation_db.sh | ||
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two lines depend on first compiling Sorbet in debug mode. The bazel version changes from time to time, so we need to export the correct version. Also, building the compilation database requires Sorbet to be compiled first. We would need something like this: # Compile Sorbet
# This downloads the correct Bazel version and prints the version to the screen
./bazel build //main:sorbet --config=dbg
# After we build, we need to parse the output here to find out the correct version
BAZEL_VERSION=./bazel version # needs some output processing to get the right version
# Then we can export and build the compilation db
export PATH="/home/spin/.bazel_binaries/${BAZEL_VERSION}/bin_t:$PATH"
tools/scripts/build_compilation_db.sh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the thorough review. I guess, you can change the script to make it more useful when we do that buddy repository from https://github.com/Shopify/spin/issues/2922. |
||
|
||
|
||
# TODO: useful aliases | ||
|
||
# alias compile_sorbet="./bazel build //main:sorbet --config=dbg" | ||
|
||
# comp_run() { | ||
# compile_sorbet && sorbet_run $@ | ||
# } | ||
|
||
# sorbet_run() { | ||
# bazel-bin/main/sorbet $@ --silence-dev-message | ||
# } | ||
|
||
# bazel_test_find() { | ||
# ./bazel query ‘tests(//...)’ | grep $@ | xargs ./bazel test --config=dbg --test_output=errors | ||
# } | ||
Comment on lines
+14
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to append these automatically to the user's zshrc as a last step without messing up the user's own dotfiles config? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was asking myself the same. Did not find a good built-in answer yet. We can add something like mkdir -p ~/zsh.d/
for f in ~/zsh.d/*
do
source $f
done to the default spin zsh config and then just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will make a PR for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merged! Can start hacking 🛠 |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- g++ | ||
- unzip | ||
- zip | ||
pl-at-shopify marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- autoconf | ||
- coreutils | ||
- parallel |
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.
What is this line doing?
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.
./bazel
lazy loads the real Bazel on the first run. As I've spent some time debugging spin logs I find it easier to split steps like installing a package and actually using it to relax the mental load.