Skip to content

Need to specify UTF-8 encoding for run/t9915 #2791

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

Closed
abeln opened this issue Jun 22, 2017 · 1 comment
Closed

Need to specify UTF-8 encoding for run/t9915 #2791

abeln opened this issue Jun 22, 2017 · 1 comment

Comments

@abeln
Copy link
Contributor

abeln commented Jun 22, 2017

Steps:

  1. check out fresh dotty repo as per instructions in http://dotty.epfl.ch/docs/usage/getting-started.html
  2. build dotty
  3. run vulpix t9915

Expected:
The test passes.

This repros consistently in our lab's server, but passes in my laptop.

Actual:
It fails with

[info] Test dotty.tools.dotc.CompilationTests.runAll started
-- [E006] Unbound Identifier Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:3:14 ---------------
3 |  val c = new C_1
  |              ^^^
  |              not found: type C_1
-- Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:4:9 ------------------------------------------
4 |  assert(c.nulled == "X\u0000ABC")    // "X\000ABC"
  |         ^
  |         unspecified error
-- Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:5:9 ------------------------------------------
5 |  assert(c.supped == "????????")
  |         ^
  |         unspecified error
-- [E006] Unbound Identifier Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:7:9 ----------------
7 |  assert(C_1.NULLED == "X\u0000ABC")  // "X\000ABC"
  |         ^^^
  |         not found: C_1
-- [E006] Unbound Identifier Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:8:9 ----------------
8 |  assert(C_1.SUPPED == "????????")
  |         ^^^
  |         not found: C_1
-- [E006] Unbound Identifier Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:10:9 ---------------
10 |  assert(C_1.NULLED.size == "XYABC".size)
   |         ^^^
   |         not found: C_1
-- [E006] Unbound Identifier Error: /u4/anietoro/src/dotty/compiler/../tests/run/t9915/Test_2.scala:11:9 ---------------
11 |  assert(C_1.SUPPED.codePointCount(0, C_1.SUPPED.length) == 8)
   |         ^^^
   |         not found: C_1
    Compilation failed for: '../tests/run/t9915' 
@abeln
Copy link
Contributor Author

abeln commented Jun 22, 2017

Relevant chat logs:

Guillaume Martres
Could it be that the system is not in UTF-8 for some reason?
and we don't pass -encoding UTF-8 to javac, so something explodes, but isn't visible in the logs?

Abel Nieto
maybe, let me take a look
incidentally, the "compilePos" failure is fixed if i sort the input files
i'll send you a pr

Guillaume Martres
What's the output of sys.props("file.encoding") in a scala repl?

Abel Nieto
val res0: String = "ANSI_X3.4-1968"

Guillaume Martres
haha what
apparently that means ASCII
okay, so what happens when you do javac tests/run/t9915/C_1.java ?

Abel Nieto
you got it

> anietoro@plg2:~/src/dotty$ javac tests/run/t9915/C_1.java
tests/run/t9915/C_1.java:6: error: unmappable character for encoding ASCII
    public static final String SUPPED = "????????????????????????????????";
                                         ^

Guillaume Martres
nice.
So there are two bugs here:

  • We need to pass -encoding UTF-8 to javac for this test
  • We somehow lose the compiler messages output and it doesn't appear in the logs
    _

@abeln abeln changed the title Test failure in run/t9915 Need to specify UTF-8 encoding for run/t9915 Jun 22, 2017
smarter added a commit that referenced this issue Jul 31, 2017
Fix #2791: add reasons for failure to vulpix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants