Commit graph

138 commits

Author SHA1 Message Date
Mohammad Fawaz
37deaee8fc
Bump to v0.30.0 (#3249)
Also ran `cargo update` as this is a minor release.
2022-11-02 15:40:29 -04:00
Alex Hansen
dc8e5f6b84
v0.29.0 (#3222)
Lots of breaking changes. Will go in after:
- [x] https://github.com/FuelLabs/sway/pull/3218
- [x] https://github.com/FuelLabs/sway/pull/3223
2022-10-31 21:13:49 +00:00
Mohammad Fawaz
84f9aad376
Bump to v0.28.1 (#3142)
Mainly to publish https://github.com/FuelLabs/sway/pull/3140
2022-10-25 17:31:48 +00:00
Mohammad Fawaz
598bbf6785
Bump to v0.28.0 (#3114) 2022-10-25 17:31:02 +11:00
bing
642c4b01dd
refactor(forc): extract tracing utils from forc-util into dedicated forc-tracing (#3108)
closes #3107 

For the motivation for this PR, refer to the issue linked above.

This PR extracts all `tracing` related util functions from `forc-util`
and puts them into a dedicated `forc-tracing` crate. There is a minor
code change
[here](https://github.com/FuelLabs/sway/pull/3108/files#diff-fb650e8292a5d6bc84d8a261393ff2cabe324b5162c40ee5cf23af57ff4dcf58R161-R164)
because it is the only place that `forc-explore` uses `forc-util` (so we
can eliminate the dependency entirely), but other than that this PR is
mostly just moving code around and updating deps as required for crates
dependent on the moved `tracing` utils.

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2022-10-24 11:10:21 +00:00
Sophie Dankel
6421a55229
[LSP] Replace logging with tracing (#2925)
Related https://github.com/FuelLabs/sway/issues/2286

Replacing the tower_lsp logging with calls to the `tracing` lib.

Added an option to `init_tracing_subscriber` to allow all tracing logs
to be piped through stderr instead of split between stderr/stdio.
Because the main thread in the LSP uses stdio to communicate with the
LSP client, tracing logs must go through stderr.

<img width="1018" alt="image"
src="https://user-images.githubusercontent.com/47993817/193706774-2868ee6a-f62d-4a6e-b137-4aff09214536.png">

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2022-10-24 05:34:11 +00:00
Mohammad Fawaz
40f1e79de0
Bump to v0.27.0 (#3100)
https://github.com/FuelLabs/sway/pull/2909 is technically breaking for
someone previoysly using `not()` directly, so I'm releasing `0.27.0`
instead of `0.26.1`.

Pending:
- [x] https://github.com/FuelLabs/sway/pull/3099
- [x] https://github.com/FuelLabs/sway/pull/3096
- [x] https://github.com/FuelLabs/sway/pull/3091
- [x] https://github.com/FuelLabs/sway/pull/3080
- [x] `cargo update`
2022-10-23 20:30:18 -04:00
Mohammad Fawaz
f05d7f6416
Bump to v0.26.0 (#3023)
Also run `cargo update`
2022-10-13 13:32:01 -04:00
Mazdak Farrokhzad
01908247a3
CompileWarning -> sway_error (#2981)
Moves `CompileWarning` into `sway_error`. This is work towards #2734.
After this PR, we can integrate warnings into `Handler` so that it is
functionally on par with `CompileResult`, and then remains to use
`Handler` in various places, which can probably be done incrementally
over a series of PRs.

This also moves `style` and `IntegerBits` into `sway-types`. The former
is also made more "pure".
2022-10-11 22:30:23 +02:00
Mazdak Farrokhzad
2c448d95af
Lexer + Parser recovery & Gathering errors in sway-error (#2891)
This PR achieves a couple of related things.

1. All compiler errors are moved into the common `sway-error` crate. The
`Handler` type is now also moved there, and now uses `CompileError`
instead of `ParseError`. That's also the main goal, to generalize
`Handler` to all sorts of errors, which will help solve
https://github.com/FuelLabs/sway/issues/2734 soon.

2. Using 1, we can now also emit `LexError`s into the `Handler`, so this
enables lexer recovery.

3. Lexer recovery is added for e.g., `42y8`, which fixes
https://github.com/FuelLabs/sway/issues/2865.

4. Lexer recovery is added for `'abc'` char literals, which fixes
https://github.com/FuelLabs/sway/issues/2864. The AST supports them, but
the rest of the compiler does not, so this will be useful later on, but
was good for recovery framework testing.

5. Lexer recovery is added for mismatched open/close delimiters, e.g.,
`fn foo() { )`.

6. Lexer recovery is added for unexpected closing delimiters, e.g., `fn
foo() }`.

7. Lexer recovery is added for unclosed delimiters.

8. Parser recovery is added for `let x =`, which fixes
https://github.com/FuelLabs/sway/issues/2815.

9. Misc lexer refactoring and simplifications are made.
2022-10-10 12:10:54 +02:00
mitchmindtree
dab1c74b2a
Remove Rust integration testing behaviour from forc test in anticipation of unit testing support (#2264)
This PR is a WIP that aims to address the first 3 steps in #1833.

This is in anticipation of using `forc test` to support unit testing
(rather than Rust integration testing) #1832.

The `forc test` command remains for now, but outputs a message
explaining that the command is now reserved for unit testing and links
to the issues above.

## TODO

- [x] Create a new `sway-test-rs` repo or similar that can be used as a
`cargo generate` template.
- [x] Update Rust integration testing docs in the Sway book to describe
how to use the `cargo generate` command to easily add Sway integration
testing to an existing Rust project.

## Follow-up

- Create a `forc-test-rs` crate that re-exports and extends `fuels` with
useful `forc` functionality for integration testing (e.g. re-exporting
`forc_pkg::build` to ensure sway code is built and available under
`out/` at the start of testing).
2022-10-10 12:27:13 +11:00
Mohammad Fawaz
dfa6224932
Bump to v0.25.2 (#2973)
Another quick release to publish
https://github.com/FuelLabs/sway/pull/2972 to unblock the SDK team.
Pending
- [x] https://github.com/FuelLabs/sway/pull/2972
2022-10-07 11:20:52 -04:00
Emily Herbert
4e9a5ae61a
Create a language module (#2955) 2022-10-07 13:49:40 +11:00
Mohammad Fawaz
cc9740bea1
Bump to v0.25.1 (#2959)
Mainly to publish https://github.com/FuelLabs/sway/pull/2947
2022-10-06 11:18:52 -04:00
Mohammad Fawaz
0f84734f6f
Bump to v0.25.0 (#2942)
- Also ran `cargo update`.

Pending:
- [x] https://github.com/FuelLabs/sway/pull/2941
- [x] https://github.com/FuelLabs/sway/pull/2940
- [x] https://github.com/FuelLabs/sway/pull/2890
2022-10-05 15:38:50 -04:00
Sophie Dankel
e6afd8987e
Add --log-level and --silent to forc (#2870)
Closes https://github.com/FuelLabs/sway/issues/2375
https://github.com/FuelLabs/sway/issues/2362

Related https://github.com/FuelLabs/sway/pull/2798

1. adds a global `--log-level` option.

1. changes "forc completions --shell" short form from "-s" to "-S"
because "-s" is now globally the short form of "--silent"
1. similarly, changes "forc addr2line --search-dir" short from from "-s"
to "-S"
1. adds a global `--silent` option to all forc commands and renames the
old silent mode to "terse mode".

What used to be called silent mode was not really silent; it would still
output 1 line if there were warnings or errors during the build (for
example, during CI runs).
 
There is still a need for a non-global option for terse mode because the
test harness runs the build commands directly (without the CLI), so
there's no way to pass the global options into the command (for example,
`forc::test::forc_check::check` which takes a `forc::cli::CheckCommand`
argument).

I can't simply set the log level to "ERROR" for the test harness
(effectively like a terse mode) because it would be applied to all tests
running in that thread, and some of the tests depend on the INFO output
to stdout to determine if the test passed. To have separate log levels
for `ir_generation` and `e2e_vm_tests`, we'd have to separate those into
separate build steps.
2022-09-28 23:16:58 +00:00
Mohammad Fawaz
e695606d88
Bump to v0.24.5 (#2840)
Co-authored-by: Toby Hutton <toby@grusly.com>
2022-09-24 08:22:05 -04:00
Sophie Dankel
56dc0f4105
Make verbose flag a global option in forc (#2798)
Closes https://github.com/FuelLabs/sway/issues/2305

Adds the `--verbose` flag to all forc commands and makes it so
`tracing::debug` logs shows when `-v` or `--verbose` is used, and
`tracing::trace` logs show when `-vv` is used.

If both `RUST_LOG` and the verbose flag are set, the verbose flag takes
precedence.

Tested with permutations of:
```
cargo run -p forc -- clean --verbose
cargo run -p forc -- init -vv
```

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: Kaya Gökalp <kayagokalp@sabanciuniv.edu>
2022-09-22 19:10:15 +00:00
Alex Hansen
c8ce718782
0.24.4 (#2794)
Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>
2022-09-16 08:43:02 -04:00
Sophie Dankel
542b435ab5
Replace colored printlns with tracing (#2764)
* Replace colored printlns with tracing

* ERROR only

* Revert "ERROR only"

This reverts commit 0d0320db9c.

* Make tests read from both stdout and stderr

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2022-09-15 23:04:04 +00:00
Mohammad Fawaz
95cd150cac
Bump to v0.24.3 (#2766)
Bump to v0.24.3
2022-09-12 11:44:19 -04:00
Mohammad Fawaz
057e83aee8
Bump to v0.24.2 (#2756)
Bump to v0.24.2

Co-authored-by: Alex Hansen <alex@alex-hansen.com>
2022-09-09 11:57:27 -04:00
Mohammad Fawaz
54e1a340e6
Bump to v0.24.1 (#2747)
Bump to 0.24.1
2022-09-07 17:40:03 -04:00
Mohammad Fawaz
ea4f1b7885
Bump to v0.24.0 (#2730)
* bump to v0.24.0

* Merge with master
2022-09-06 13:01:12 -04:00
Mohammad Fawaz
b696495c8f
Bump to v0.23.0 (#2703)
bump to 0.23.0

Co-authored-by: Alex Hansen <alex@alex-hansen.com>
2022-09-02 18:20:32 -04:00
Mohammad Fawaz
c486eabc3e
Bump to v0.22.1 (#2685)
bump to v0.22.1
2022-08-31 22:54:46 -04:00
Mohammad Fawaz
6e1fbca21f
Bump to v0.22.0 (#2673)
* Bump to v0.22.0

* Update lock file
2022-08-31 21:49:35 -04:00
Mohammad Fawaz
32b5b142b5
Bump to v0.21.0 (#2651)
Bump to v0.21.0

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
2022-08-29 22:02:51 -04:00
Mohammad Fawaz
6a8116fcee
Bump to v0.20.2 (#2584)
Bump to v0.20.2
2022-08-18 23:40:55 -04:00
Mohammad Fawaz
21887f4b32
Bump to v0.20.1 (#2578)
* Add forc client metadata to Cargo.toml

* bump to v0.21.1
2022-08-18 15:02:14 -07:00
Emily Herbert
fc3a05d87d
Bump to v0.20.0 (#2565)
* bump to v0.20.0

* run cargo update and update forc-client

Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>
2022-08-18 15:25:28 -04:00
Mohammad Fawaz
6808861389
Bump to v0.19.2 (#2481)
bump to v0.19.2
2022-08-08 15:47:20 -06:00
Mohammad Fawaz
1202e790c1
Bump to v0.19.1 (#2437)
Bump to v0.19.1
2022-08-01 11:11:46 -04:00
Mohammad Fawaz
5c716e1ba5
Bump to v0.19.0 (#2393)
Bump to v0.19.0
2022-07-27 20:00:33 -04:00
Vaivaswatha N
3f2f3b1b60
Fix utf8 related bug in computing window for errors and warnings. (#2343)
Closes #2297
2022-07-19 06:52:17 +00:00
Mohammad Fawaz
3bd8eaf4a0
Bump to v0.18.1 (#2304)
bump to v0.18.1
2022-07-11 23:23:17 -04:00
Mohammad Fawaz
ada0d294a6
Bump to v0.18.0 (#2268) 2022-07-08 19:12:28 -04:00
Mohammad Fawaz
fa003ff1e2
Account for characters that are larger than 1 byte when displaying warnings and errors (#2267) 2022-07-08 02:01:53 +00:00
Mohammad Fawaz
b81bcd9652
Bump to v0.17.0 (#2174)
* bump to 0.17.0

* Also run cargo update
2022-07-01 15:12:20 -04:00
Alex Hansen
2e9c381924
Fix new clippy lints. (#2192)
appease clippy
2022-06-30 22:32:19 +01:00
Mohammad Fawaz
7920330d34
Bump to v0.16.2 (#2105)
* bump to v0.16.2

* Fix one test not pointing to local std
2022-06-24 15:02:08 -04:00
Mohammad Fawaz
dcf22453ae
Bump to v0.16.1 (#2037)
Bump to 0.16.1
2022-06-17 23:03:40 +03:00
Mohammad Fawaz
948f7aba42
Bump to v0.16.0 (#1998)
bump to 0.16.0
2022-06-16 13:30:17 -04:00
Mohammad Fawaz
eab07e48bc
Bump to v0.15.2 (#1920) 2022-06-09 14:37:56 -04:00
Emily Herbert
3afc08d66e
Use the Spanned trait everywhere (#1881)
* Use Spanned everywhere.

* clippy
2022-06-06 21:27:31 -05:00
Mohammad Fawaz
a34b4b99fc
bump to 0.15.1 (#1871) 2022-06-06 13:45:20 -04:00
Mohammad Fawaz
ee7822c411
bump to v0.15.0 (#1835) 2022-06-06 11:45:18 -04:00
Kaya Gökalp
d76dbef0dd
welcome colors back to default (#1837) 2022-06-03 15:49:11 +03:00
Mohammad Fawaz
60c626cf48
bump to 0.14.5 (#1793) 2022-06-01 16:19:51 -04:00
Mohammad Fawaz
b067a7dd64
bump to v0.14.4 (#1753) 2022-05-28 14:52:01 -04:00