Giter VIP home page Giter VIP logo

Comments (4)

slandelle avatar slandelle commented on September 6, 2024 4

I did ask chatgpt about the code in 7ce1e01 and the problem her..

Our profession is doomed.

Again, the first step is to provide a minimal reproducer of your problem.

from scala-maven-plugin.

slandelle avatar slandelle commented on September 6, 2024

Hi,

The following comments only engage myself (I'm the most active maintainer here atm, not the original author).

This is a general advice to all Apache Spark users/maintainers, as I've always observed the same behavior over the years.

How to report a bug

The proper way to report a bug is to provide a good reproducer.
There are several good definitions for what a good reproducer is, including Wikipedia's and Stack Overflow's .

Spark's build is the exact opposite of a minimal reproducer.
Only someone with an interest in Spark would be willing to spend time figuring out how things work there, which I'm not.

Contributing

IMO, when some dependency becomes critical for an organization with decent means, it's the duty of this organization to contribute, not just consume.

So far, the total amount of contributions here from the Spark community has been zero.

Spark is hundreds of contributors and a super rich backing company: Databricks.

In comparison, this project has been for years a one-man on-personal-time army.

Making things very clear: I'm not asking for money, I'm asking for manpower.

from scala-maven-plugin.

bjornjorgensen avatar bjornjorgensen commented on September 6, 2024

@slandelle I did ask chatgpt about the code in 7ce1e01 and the problem her..

this is what it return


private static String computeTargetOption(String target) {
  if (target.equals("1.5") || target.equals("5")) {
    return "jvm-1.5";
  } else if (target.equals("1.6") || target.equals("6")) {
    return "jvm-1.6";
  } else if (target.equals("1.7") || target.equals("7")) {
    return "jvm-1.7";
  } else if (target.equals("1.8") || target.equals("8")) {
    return "jvm-1.8";
  }
  return null;
}

private static String computeReleaseOptionFromTarget(String target) {
  if (target.equals("1.5")) {
    return "5";
  } else if (target.equals("1.6")) {
    return "6";
  } else if (target.equals("1.7")) {
    return "7";
  } else if (target.equals("1.8")) {
    return "8";
  }
  return target;
}

// visible for tests
static List<String> computeBytecodeVersionOptions(
    String target, String release, VersionNumber scalaVersion) {
  List<String> options = new ArrayList<>();
  boolean targetIsDefined = StringUtils.isNotEmpty(target);
  boolean releaseIsDefined = StringUtils.isNotEmpty(release);
  boolean releaseIsSupported = scalaVersion.compareTo(new VersionNumber("2.12.0")) >= 0;
  String releaseOrJavaOutputVersionOptionName =
      scalaVersion.compareTo(new VersionNumber("3.1.2")) >= 0
          ? "-java-output-version"
          : "-release";

  if (releaseIsDefined && releaseIsSupported) {
    // release's default is "maven.compiler.release"'s default, which is null
    options.add(releaseOrJavaOutputVersionOptionName);
    options.add(release);
  } else if (targetIsDefined) {
    // target's default is "maven.compiler.target"'s default, which is 1.8
    if (releaseIsSupported) {
      options.add(releaseOrJavaOutputVersionOptionName);
      options.add(computeReleaseOptionFromTarget(target));
    } else {
      String correctTarget = computeTargetOption(target);
      if (correctTarget != null) {
        options.add("-target:" + correctTarget);
      }
    }
  }
  return options;
}

protected List<String> getScalacOptions() throws Exception {
  List<String> options = new ArrayList<>();
  if (args != null) Collections.addAll(options, args);
  if (StringUtils.isNotEmpty(addScalacArgs)) {
    Collections.addAll(options, StringUtils.split(addScalacArgs, "|"));
  }
  options.addAll(getCompilerPluginOptions());
  options.addAll(computeBytecodeVersionOptions(target, release, findScalaVersion()));

  return options;
}

Can this code help? If so I can try to open a PR with the code.

from scala-maven-plugin.

eejbyfeldt avatar eejbyfeldt commented on September 6, 2024

I looked into this a bit and I think the underlying issue is scala/bug#12824

from scala-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.