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

[1.x] Fix win terminal #1040

Merged
merged 12 commits into from
Jun 20, 2024
11 changes: 5 additions & 6 deletions .github/workflows/early-access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ on:
pull_request:

env:
JAVA_VERSION: '17'
JAVA_VERSION: '22'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
default-build:
name: 'Default build (without Graal)'
name: 'Default build (without GraalVM)'
if: startsWith(github.event.head_commit.message, '[release] Release ') != true
runs-on: ubuntu-latest
steps:
Expand All @@ -57,7 +57,7 @@ jobs:
path: integration-tests/target/mvnd-tests/**/daemon*.log

native-build:
name: 'Build with Graal on ${{ matrix.os }}'
name: 'Build with GraalVM on ${{ matrix.os }}'
if: startsWith(github.event.head_commit.message, '[release] Release ') != true
strategy:
fail-fast: false
Expand Down Expand Up @@ -92,18 +92,17 @@ jobs:
fi
echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: 'Set up Graal'
- name: 'Set up GraalVM'
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'graalvm'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: 'Maven clean'
run: ./mvnw clean -Dmrm=false -V -B -ntp -e

- name: 'Patch Graal libs for only requiring glibc 2.12'
- name: 'Patch GraalVM libs for only requiring glibc 2.12'
if: ${{ env.OS == 'linux' }}
shell: bash
run: |
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ on:
- '*'

env:
JAVA_VERSION: '17'
JAVA_VERSION: '22'

jobs:
build:
name: 'Build with Graal on ${{ matrix.os }}'
name: 'Build with GraalVM on ${{ matrix.os }}'
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -64,18 +64,17 @@ jobs:
fi
echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: 'Set up Graal'
- name: 'Set up GraalVM'
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'graalvm'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: 'Maven clean'
run: ./mvnw clean -Dmrm=false -B -ntp -e

- name: 'Patch Graal libs for only requiring glibc 2.12'
- name: 'Patch GraalVM libs for only requiring glibc 2.12'
if: ${{ env.OS == 'linux' }}
shell: bash
run: |
Expand Down Expand Up @@ -145,12 +144,11 @@ jobs:
fi
echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV

- name: 'Set up Graal'
- name: 'Set up GraalVM'
uses: graalvm/setup-graalvm@v1
with:
version: ${{ env.GRAALVM_VERSION }}
java-version: ${{ env.JAVA_VERSION }}
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: 'Build source distribution'
Expand Down
11 changes: 7 additions & 4 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>

<!-- GraalVM SVM: provided, uses only to configure native image build -->
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
Expand Down Expand Up @@ -99,7 +101,6 @@
<maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
<excludes>
<exclude>org.jline:jline-terminal-ffm</exclude>
<exclude>org.graalvm.nativeimage:svm</exclude>
</excludes>
</enforceBytecodeVersion>
</rules>
Expand Down Expand Up @@ -220,12 +221,14 @@
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<configuration>
<metadataRepository>
<enabled>true</enabled>
</metadataRepository>
<skip>false</skip>
<mainClass>org.mvndaemon.mvnd.client.DefaultClient</mainClass>
<imageName>mvnd</imageName>
<buildArgs>--no-server
--no-fallback
--allow-incomplete-classpath
<buildArgs>--no-fallback
-H:+UnlockExperimentalVMOptions
${graalvm-native-static-opt}
${graalvm-native-glibc-opt}
-H:IncludeResources=org/mvndaemon/mvnd/.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public static void main(String[] argv) throws Exception {
}
}

// Diag
if (Environment.DIAG.removeCommandLineOption(args) != null) {
org.jline.terminal.impl.Diag.diag(System.out);
return;
}

// Serial
if (Environment.SERIAL.removeCommandLineOption(args) != null) {
System.setProperty(Environment.SERIAL.getProperty(), Boolean.toString(true));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public enum Environment {
STATUS(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--status"),
/** Stop all daemon instances registered in the registry specified by <code>mvnd.registry</code> */
STOP(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--stop"),
/** Terminal diagnosis */
DIAG(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--diag"),
/** Use one thread, no log buffering and the default project builder to behave like a standard maven */
SERIAL("mvnd.serial", null, Boolean.FALSE, OptionType.VOID, Flags.OPTIONAL, "mvnd:-1", "mvnd:--serial"),

Expand Down
4 changes: 4 additions & 0 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
<groupId>org.apache.maven.daemon</groupId>
<artifactId>mvnd-daemon</artifactId>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-native</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/distro/bin/mvnd-bash-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ _mvnd()
_get_comp_words_by_ref -n : cur prev

local mvnd_opts="-1"
local mvnd_long_opts="--color|--completion|--purge|--raw-streams|--serial|--status|--stop"
local mvnd_long_opts="--color|--completion|--diag|--purge|--raw-streams|--serial|--status|--stop"
local mvnd_properties="-Djava.home|-Djdk.java.options|-Dmaven.multiModuleProjectDirectory|-Dmaven.repo.local|-Dmaven.settings|-Dmvnd.buildTime|-Dmvnd.builder|-Dmvnd.cancelConnectTimeout|-Dmvnd.connectTimeout|-Dmvnd.coreExtensionsExclude|-Dmvnd.daemonStorage|-Dmvnd.debug|-Dmvnd.debug.address|-Dmvnd.duplicateDaemonGracePeriod|-Dmvnd.enableAssertions|-Dmvnd.expirationCheckDelay|-Dmvnd.home|-Dmvnd.idleTimeout|-Dmvnd.jvmArgs|-Dmvnd.keepAlive|-Dmvnd.logPurgePeriod|-Dmvnd.maxHeapSize|-Dmvnd.maxLostKeepAlive|-Dmvnd.minHeapSize|-Dmvnd.minThreads|-Dmvnd.noBuffering|-Dmvnd.noDaemon|-Dmvnd.noModelCache|-Dmvnd.pluginRealmEvictPattern|-Dmvnd.propertiesPath|-Dmvnd.rawStreams|-Dmvnd.registry|-Dmvnd.rollingWindowSize|-Dmvnd.serial|-Dmvnd.socketConnectTimeout|-Dmvnd.socketFamily|-Dmvnd.threadStackSize|-Dmvnd.threads|-Dstyle.color|-Duser.dir|-Duser.home"
local opts="-am|-amd|-B|-C|-c|-cpu|-D|-e|-emp|-ep|-f|-fae|-ff|-fn|-gs|-h|-l|-N|-npr|-npu|-nsu|-o|-P|-pl|-q|-rf|-s|-T|-t|-U|-up|-V|-v|-X|${mvnd_opts}"
local long_opts="--also-make|--also-make-dependents|--batch-mode|--strict-checksums|--lax-checksums|--check-plugin-updates|--define|--errors|--encrypt-master-password|--encrypt-password|--file|--fail-at-end|--fail-fast|--fail-never|--global-settings|--help|--log-file|--non-recursive|--no-plugin-registry|--no-plugin-updates|--no-snapshot-updates|--offline|--activate-profiles|--projects|--quiet|--resume-from|--settings|--threads|--toolchains|--update-snapshots|--update-plugins|--show-version|--version|--debug|${mvnd_long_opts}"
Expand Down
3 changes: 3 additions & 0 deletions dist/src/main/provisio/maven-distro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<artifact id="org.jline:jline-terminal-jni">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.jline:jline-native">
<exclusion id="*:*"/>
</artifact>
</artifactSet>

<fileSet to="/">
Expand Down
19 changes: 11 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
<assertj.version>3.26.0</assertj.version>
<commons-compress.version>1.26.2</commons-compress.version>
<!-- cannot upgrade graalvm to 23.0.0 which requires JDK >= 20 -->
<graalvm.version>22.3.1</graalvm.version>
<graalvm.version>23.1.3</graalvm.version>
<graalvm.plugin.version>0.10.2</graalvm.plugin.version>
<groovy.version>4.0.21</groovy.version>
<jakarta.inject.version>1.0</jakarta.inject.version>
<jline.version>3.26.1</jline.version>
<jline.version>3.26.2</jline.version>
<maven.version>3.9.8</maven.version>
<!-- Keep in sync with Maven -->
<maven.resolver.version>1.9.20</maven.resolver.version>
Expand Down Expand Up @@ -126,12 +126,6 @@
<version>${commons-compress.version}</version>
</dependency>

<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graalvm.version}</version>
</dependency>

<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
Expand Down Expand Up @@ -295,6 +289,11 @@
<artifactId>jline-terminal-ffm</artifactId>
<version>${jline.version}</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-native</artifactId>
<version>${jline.version}</version>
</dependency>

<dependency>
<groupId>info.picocli</groupId>
Expand Down Expand Up @@ -538,6 +537,10 @@
<excludes>
<exclude>org.jline:jline-terminal-ffm</exclude>
</excludes>
<ignoredScopes>
<!-- GraalVM SVM and deps are 17+, but are provided and used only for Native -->
<ignoredScopes>provided</ignoredScopes>
</ignoredScopes>
</enforceBytecodeVersion>
</rules>
<fail>true</fail>
Expand Down