-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take into account "fallback to container" when determining where nati…
…ve-image gets executed Sometimes we need to do things differently based on whether the native build happens within a container or not. Before this patch, we used to determine that based exclusively on explicit configuration. After this patch, we correctly take into account that we sometimes need to "fall back" to containers even though the configuration didn't mention anything about containers, simply because native-image isn't installed. The previous behavior used to lead to at least one bug: when debugging GraalVM's JVM, we determined the address to bind to based on whether we're running in a container or not, and [here we used to make the wrong choice](https://github.com/quarkusio/quarkus/blob/635a848bb8022e4ca6e945af7e62edc32a288588/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java#L780-L784), resulting in the JVM debug agent being inaccessible from the Docker host. See also https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/quarkus.2Enative.2Edebug-build-process/near/345399379
- Loading branch information
Showing
13 changed files
with
192 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
.../src/main/java/io/quarkus/deployment/pkg/builditem/NativeImageRunnerFactoryBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.quarkus.deployment.pkg.builditem; | ||
|
||
import io.quarkus.builder.item.SimpleBuildItem; | ||
import io.quarkus.deployment.pkg.steps.NativeImageBuildRunner; | ||
|
||
/** | ||
* The resolved factory for the native image runner. | ||
*/ | ||
public final class NativeImageRunnerFactoryBuildItem extends SimpleBuildItem { | ||
private final NativeImageBuildRunner.Factory buildRunnerFactory; | ||
|
||
public NativeImageRunnerFactoryBuildItem(NativeImageBuildRunner.Factory buildRunnerFactory) { | ||
this.buildRunnerFactory = buildRunnerFactory; | ||
} | ||
|
||
public NativeImageBuildRunner.Factory getBuildRunnerFactory() { | ||
return buildRunnerFactory; | ||
} | ||
|
||
public boolean isContainerBuild() { | ||
return buildRunnerFactory.isContainerBuild(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 21 additions & 2 deletions
23
...deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildLocalRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.