Skip to content

Commit ba3f2d2

Browse files
author
Dean Wampler
committed
Added a troubleshooting tip for a LANG issue
1 parent 9723b98 commit ba3f2d2

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ This repo contains all the code examples in [Programming Scala, Third Edition](h
3434

3535
The `master` branch and the `3.X.Y` tag releases are for the third edition. The code examples for the second edition are still available. [Download the release tagged 2.1.0](https://github.com/deanwampler/programming-scala-book-code-examples/releases/tag/2.1.0) or check out the `release-2.1.0` branch. While the second edition was published for 2.11. The latest `2.1.0` release and `release-2.1.0` are updated for 2.12 and 2.13. (No more `release-2.X.Y` releases are planned.)
3636

37+
> **TIP:** Several sections offer troubleshooting tips if you encounter problems.
38+
3739
## How the Code Is Used in the Book
3840

3941
In the book's text, when an example corresponds to a file in this distribution, the listing begins with a path in a comment with the following format:
@@ -104,7 +106,7 @@ For other IDEs and text editors, try [Scala Metals](https://scalameta.org/metals
104106

105107
After installing the required plugins, load this project in your IDE, which should detect and use the `sbt` project automatically. For eclipse, run the `sbt eclipse` task to generate project files, then import them.
106108

107-
### Issues with IntelliJ
109+
### Troubleshooting with IntelliJ
108110

109111
One reader reported a problem when trying to run examples in IntelliJ: `scalac: Flag -encoding set repeatedly`. I could confirm this problem and I fixed it as follows:
110112

@@ -167,6 +169,28 @@ HELLO WORLD!
167169
$
168170
```
169171

172+
### Build Troubleshooting
173+
174+
Here are tips for issues users have reported.
175+
176+
#### Internationalization
177+
178+
I didn't check that the tests pass or the scripts work if your language environment isn't English. So, no surprise I guess, a German user reported that three tests failed when running `sbt test` while the `LANG` was set to `de_DE.UTF-8`:
179+
180+
```
181+
[info] Passed: Total 7, Failed 0, Errors 0, Passed 7
182+
[error] Failed: Total 233, Failed 7, Errors 0, Passed 226
183+
[error] Failed tests:
184+
[error] progscala3.fp.combinators.PayrollSuite
185+
[error] progscala3.fp.curry.TupledFuncSuite
186+
[error] progscala3.dsls.payroll.PayrollSuite
187+
[error] (Test / test) sbt.TestsFailedException: Tests unsuccessful
188+
[error] Total time: 2 s, completed 31.07.2021, 16:56:39
189+
```
190+
191+
192+
Setting `export LANG="en_US.UTF-8"; sbt test` works. A PR for this is welcome ;) As an interim step, you could wrap this logic (or the more concise single command `LANG="en_US.UTF-8" sbt test`) in a script or just ignore the three failing tests.
193+
170194
## Feedback
171195

172196
I welcome feedback on the Book and these examples. Please post comments, corrections, etc. to one of the following places:

0 commit comments

Comments
 (0)