Skip to content
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

scalac ant task does not accept fork="true" in 2.10.0-M7 #6268

Closed
scabug opened this issue Aug 21, 2012 · 10 comments
Closed

scalac ant task does not accept fork="true" in 2.10.0-M7 #6268

scabug opened this issue Aug 21, 2012 · 10 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Aug 21, 2012

The scalac task does not accept fork="true" in Scala 2.10.0-M7. It does accept fork="false".

compile-main:
[scalac] Compiling 196 source files to /Users/bv/nobkp/delus/r18for210M3/target/jar_contents
[scalac] Compiling 4 source files to /Users/bv/nobkp/delus/r18for210M3/target/jar_contents
[scalac] Compiling 0 scala and 3 java source files to /Users/bv/nobkp/delus/r18for210M3/target/jar_contents
[scalac] Usage: scalac
[scalac] where possible standard options include:
[scalac] -Dproperty=value Pass -Dproperty=value directly to the runtime system.
[scalac] -J Pass directly to the runtime system.
[scalac] -P:: Pass an option to a plugin
[scalac] -X Print a synopsis of advanced options.
[scalac] -bootclasspath Override location of bootstrap class files.
[scalac] -classpath Specify where to find user class files.
[scalac] -d <directory|jar> destination for generated classfiles.
[scalac] -dependencyfile Set dependency tracking file.
[scalac] -deprecation Emit warning and location for usages of deprecated APIs.
[scalac] -encoding Specify character encoding used by source files.
[scalac] -explaintypes Explain type errors in more detail.
[scalac] -extdirs Override location of installed extensions.
[scalac] -feature Emit warning and location for usages of features that should be imported explicitly.
[scalac] -g: Set level of generated debugging info. (none,source,line,vars,notailcalls) default:vars
[scalac] -help Print a synopsis of standard options
[scalac] -javabootclasspath Override java boot classpath.
[scalac] -javaextdirs Override java extdirs classpath.
[scalac] -language: Enable one or more language features.
[scalac] -no-specialization Ignore @Specialize annotations.
[scalac] -nobootcp Do not use the boot classpath for the scala jars.
[scalac] -nowarn Generate no warnings.
[scalac] -optimise Generates faster bytecode by applying optimisations to the program
[scalac] -print Print program with Scala-specific features removed.
[scalac] -sourcepath Specify location(s) of source files.
[scalac] -target: Target platform for object files. All JVM 1.5 targets are deprecated. (jvm-1.5,jvm-1.5-fjbg,jvm-1.5-asm,jvm-1.6,jvm-1.7,msil) default:jvm-1.6
[scalac] -toolcp Add to the runner classpath.
[scalac] -unchecked Enable additional warnings where generated code depends on assumptions.
[scalac] -uniqid Uniquely tag all identifiers in debugging output.
[scalac] -usejavacp Utilize the java.class.path in classpath resolution.
[scalac] -verbose Output messages about what the compiler is doing.
[scalac] -version Print product version and exit.
[scalac] @ A text file containing compiler arguments (options and source files)
[scalac]
[scalac] Deprecated settings:
[scalac] -make: Recompilation detection policy (all,changed,immediate,transitive,transitivenocp) default:all
[scalac] deprecated: this option is unmaintained. Use sbt or an IDE for selective recompilation.
[scalac]

The branch you can use to reproduce the problem is:

https://scalatest.googlecode.com/svn/branches/r18for210M7

Just say "ant test" and it will happen very quickly.

@scabug
Copy link
Author

scabug commented Aug 21, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6268?orig=1
Reporter: @bvenners
Other Milestones: 2.10.0

@scabug
Copy link
Author

scabug commented Sep 10, 2012

@jsuereth said:
Its appears like you're sending only java sources to Scalac when there is no scala sources. Can you validate this is the behavior? I think that's why it's not working.

@scabug
Copy link
Author

scabug commented Sep 11, 2012

@jsuereth said (edited on Sep 11, 2012 5:44:01 PM UTC):
Ok, so this simple test works:

<?xml version="1.0" encoding="UTF-8"?>

<project name="test-simple" default="compile">
  <description>
Super simple test for Scala

  <target name="init">
     <!-- Define project CLASSPATH. -->
    <property name="base.dir" value="../../.."/>
    <property name="pack.dir" value="${base.dir}/build/pack/"/>
    <property name="build.dir" value="classes"/>
    <property name="src.dir" value="src"/>
    <path id="scala.classpath">
      <fileset dir="${pack.dir}/lib/"> <include name="*.jar" /> </fileset>
    </path>

    <!-- Define scala compiler, scaladoc, etc command -->
    <taskdef resource="scala/tools/ant/antlib.xml">
      <classpath refid="scala.classpath" />
    </taskdef>
  </target>

  <target name="compile" depends="init">
    <mkdir dir="${build.dir}"/>

    <scalac srcdir="${src.dir}" destdir="${build.dir}"
            classpathref="scala.classpath" fork="true">
      <include name="**/*.scala"/>
    </scalac>
  </target>
</project>

Time to investigate if the "too many argument" handling is broken.

@scabug
Copy link
Author

scabug commented Sep 11, 2012

@jsuereth said:
I'm unable to reproduce your build problem local on your full build and also with the small sample included. This is on Ubuntu.

Could you have a stale or malformed caching isssue?

@scabug
Copy link
Author

scabug commented Sep 11, 2012

@jsuereth said:
Ok tracked it down to a broken refactoring here: scala/scala@963aabbeb4

@scabug
Copy link
Author

scabug commented Sep 11, 2012

@jsuereth said:
scala/scala#1288

@scabug
Copy link
Author

scabug commented Sep 11, 2012

@paulp said:
FYI, I went that way because unparsing -i "foo bar.scala" as in the pull request will give us -i:foo bar.scala. Not that the world will be full of workingness when you have spaces in your path.

@scabug
Copy link
Author

scabug commented Sep 12, 2012

@jsuereth said:
The issue is that your patch needed to merge the list of string into one:

def unparse = if(values.isEmpty) Nil 
              else name :: (value mkString " ") :: Nil

I went the less code route, assuming it still parses. Like I said, I couldn't tell if we had automated tests, I just validated against scalatest and the ant build in that commit. I think we should add some partest setting tests so we avoid breaking each other!

@scabug scabug closed this as completed Sep 12, 2012
@scabug
Copy link
Author

scabug commented Sep 12, 2012

@paulp said:
"I think we should add some partest setting tests so we avoid breaking each other!"

Well yeah, we should have done that five years ago. As always, the obstacle to script tests (which is the meaningful way to test command line properties - from the command line) is windows. Whenever I have tried to check in anything in this area, I have had to revert it. I no longer try. For the glory of windows, we have no tests here for anyone.

@scabug
Copy link
Author

scabug commented Sep 12, 2012

@jsuereth said:
That I can fix. Since we have the pull request validation now, we can set up tests which only run on "platform foo" and be reasonably assured they'll prevent bad code from entering the repo.

I'll put that on the list of things to fix in partest.

@scabug scabug added this to the 2.10.0-M7 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants