-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
fix nightly testing + updates #7386
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
|
||
# Platform switching | ||
|
||
To run, `cd` into this directory and run this in your terminal: | ||
|
||
```bash | ||
roc run | ||
roc --build-host --suppress-build-host-warning rocLovesC.roc | ||
``` | ||
|
||
This will run `main.roc` because, unless you explicitly give it a filename, `roc run` | ||
defaults to running a file named `main.roc`. Other `roc` commands (like `roc build`, `roc test`, and so on) also default to `main.roc` unless you explicitly give them a filename. | ||
|
||
## About this example | ||
|
||
This uses a very simple platform which does nothing more than printing the string you give it. | ||
|
||
The line `main = "Which platform am I running on now?\n"` sets this string to be `"Which platform am I running on now?"` with a newline at the end, and the lines `packages { pf: "c-platform/main.roc" }` and `provides [main] to pf` specify that the `c-platform/` directory contains this app's platform. | ||
## About these examples | ||
|
||
This platform is called `c-platform` because its lower-level code is written in C. There's also a `rust-platform`, `zig-platform`, and so on; if you like, you can try switching `pf: "c-platform/main.roc"` to `pf: "zig-platform/main.roc"` or `pf: "rust-platform/main.roc"` to try one of those platforms instead. They all do similar things, so the application won't look any different. | ||
They use a very simple [platform](https://www.roc-lang.org/platforms) which does nothing more than printing the string you give it. | ||
|
||
If you want to start building your own platforms, these are some very simple example platforms to use as starting points. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
app [main] { pf: platform "c-platform/main.roc" } | ||
|
||
# run with `roc --build-host --suppress-build-host-warning rocLovesZig.roc` | ||
# may require: | ||
# ubuntu: sudo apt install build-essential clang | ||
# fedora: sudo dnf install clang | ||
|
||
# run with `roc --build-host --suppress-build-host-warning rocLovesC.roc` | ||
|
||
main = "Roc <3 C!\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
app [main] { pf: platform "zig-platform/main.roc" } | ||
|
||
# run with `roc --build-host --suppress-build-host-warning rocLovesZig.roc` | ||
# To run: | ||
# cd examples/platform-switching/zig-platform | ||
# mkdir glue | ||
# cp crates/compiler/builtins/bitcode/src/* ./glue | ||
# cd - | ||
# roc --build-host --suppress-build-host-warning rocLovesZig.roc | ||
|
||
main = "Roc <3 Zig!\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ which includes the Roc compiler and some helpful utilities. | |
|
||
1. Check everything worked by executing `roc version` | ||
|
||
1. Install libc development files and ld (binutils) if you'd like to use the repl (`roc repl`): | ||
1. If you'd like to use the repl (`roc repl`); install libc development files and ld (binutils) : | ||
- On Ubuntu/Debian: | ||
|
||
```sh | ||
|
@@ -41,37 +41,10 @@ which includes the Roc compiler and some helpful utilities. | |
sudo dnf install glibc-devel binutils | ||
``` | ||
|
||
## How to install Roc platform dependencies | ||
|
||
This step is not necessary if you only want to use the [basic-cli platform](https://github.com/roc-lang/basic-cli), like in the tutorial. | ||
But, if you want to compile Roc apps with other platforms (either in [`examples/`](https://github.com/roc-lang/roc/tree/main/examples) or in your own projects), | ||
you'll need to install one or more of these platform languages too. | ||
|
||
1. Install the Rust compiler, for apps with Rust-based platforms: | ||
|
||
```sh | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
``` | ||
|
||
1. For Zig-based platforms: [download zig 0.13.0](https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz), extract the archive and add export PATH=$PATH:~/path/to/zig to your shell startup script (.profile, .zshrc, …). | ||
|
||
1. Install a C compiler, for apps with C-based platforms: | ||
Comment on lines
-44
to
-58
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. The overwhelming majority of Roc users does not need this. |
||
1. Run [hello world](https://github.com/roc-lang/examples/blob/main/examples/HelloWorld/main.roc): | ||
|
||
```sh | ||
# On a Debian-based distro like Ubuntu | ||
sudo apt update && sudo apt install build-essential clang | ||
|
||
# On an RPM-based distro like Fedora | ||
sudo dnf check-update && sudo dnf install clang | ||
``` | ||
|
||
```sh | ||
# Note: If you installed Rust in this terminal session, you'll need to open a new one first! | ||
./roc examples/platform-switching/rocLovesRust.roc | ||
|
||
./roc examples/platform-switching/rocLovesZig.roc | ||
|
||
./roc examples/platform-switching/rocLovesC.roc | ||
roc hello.roc | ||
``` | ||
|
||
## Next Steps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This has changed to use a glue folder like below