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

build errors on windows 10 #261

Closed
duke-arioch opened this issue Jun 25, 2020 · 14 comments · Fixed by #262
Closed

build errors on windows 10 #261

duke-arioch opened this issue Jun 25, 2020 · 14 comments · Fixed by #262
Assignees
Labels
bug Something isn't working
Milestone

Comments

@duke-arioch
Copy link

duke-arioch commented Jun 25, 2020

on mvn k8s:build i get the following output:

[INFO] Scanning for projects...
[INFO]
[INFO] -----------< org.eclipse.jkube.quickstarts.maven:helloworld >-----------
[INFO] Building Eclipse JKube :: Quickstarts :: Maven :: Hello World 1.0.0-alpha-4
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.0.0-alpha-4:build (default-cli) @ helloworld ---
[INFO] k8s: Running in Kubernetes mode
[INFO] k8s: Building Docker image in Kubernetes mode
[ERROR] k8s: Failed to execute the build ['basedir' must be an absolute path starting with / (and not '/maven')]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.681 s
[INFO] Finished at: 2020-06-25T08:38:32-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.0.0-alpha-4:build (default-cli) on project helloworld: Failed to execute the build: 'basedir' must be an absolute path starting with / (and not '/maven') -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

docker version:

# docker --version
Docker version 19.03.8, build afacb8b

maven version:

# mvn --version
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T15:00:29-04:00)
...
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_211\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
@rohanKanojia
Copy link
Member

rohanKanojia commented Jun 25, 2020

@duke-arioch : Thanks for your bug report. Could you please share your logs with -X enabled? Do you have a sample project we can use in order to reproduce your issue?

@duke-arioch
Copy link
Author

duke-arioch commented Jun 25, 2020

Thanks Rohan! I have added the below file with -X.

I did not do anything but clone the repo per the instructions and then execute the maven command

(edit) - this output was from the mvn k8s:build command. after the full command failed, i broke it up and found mvn clean install was successful. then executed k8s:build afterwards on its own

out.txt

@rohanKanojia
Copy link
Member

ah, looks like this line the culprit, I think platform-independent File.separator should be used here:
https://github.com/eclipse/jkube/blob/b573deb75fb5d6a78263c3a3e0a73e73923186be/jkube-kit/config/image/src/main/java/org/eclipse/jkube/kit/config/image/build/DockerFileBuilder.java#L376-L380

Would you like to create a PR to fix this?

@manusa manusa added the bug Something isn't working label Jun 25, 2020
@manusa
Copy link
Member

manusa commented Jun 25, 2020

I wonder why our windows test is not failing

@manusa manusa added this to the 1.0.0 milestone Jun 25, 2020
@duke-arioch
Copy link
Author

Quick check I did not see the test setting the base dir - maybe i missed it? default is '/maven' in any case, which would not trigger it.

@manusa
Copy link
Member

manusa commented Jun 25, 2020

Quick check I did not see the test setting the base dir - maybe i missed it? default is '/maven' in any case, which would not trigger it.

Yes, but I don't see this being overridden in the hello-world example either. We need to check.

Anyway, before implementing the (easy) fix, we first need to modify the windows integration test to make it fail. We need guarantees and to make sure that any other change we make in the future won't break JKube for Windows users.

@manusa
Copy link
Member

manusa commented Jun 25, 2020

ah, looks like this line the culprit, I think platform-independent File.separator should be used here:
https://github.com/eclipse/jkube/blob/b573deb75fb5d6a78263c3a3e0a73e73923186be/jkube-kit/config/image/src/main/java/org/eclipse/jkube/kit/config/image/build/DockerFileBuilder.java#L376-L380

Would you like to create a PR to fix this?

Also, probably something like !new File(dir).isAbsolute() is what we need, absolute paths never start with \ in Windows (they start with a drive letter)

@duke-arioch
Copy link
Author

duke-arioch commented Jun 25, 2020

i think i got it - was considering helping out with a pull request but wanted to get build going first - i saw this:

Running org.eclipse.jkube.kit.common.util.EnvUtilTest
Tests run: 32, Failures: 2, Errors: 0, Skipped: 1, Time elapsed: 0.309 sec <<< FAILURE! - in org.eclipse.jkube.kit.common.util.EnvUtilTest
testPrepareAbsoluteSourceDirPath(org.eclipse.jkube.kit.common.util.EnvUtilTest)  Time elapsed: 0 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<test-project[/target/]testDir> but was:<test-project[\target\]testDir>
        at org.eclipse.jkube.kit.common.util.EnvUtilTest.testPrepareAbsoluteSourceDirPath(EnvUtilTest.java:270)

@manusa
Copy link
Member

manusa commented Jun 25, 2020

Our tests are not platform independent, many of them will fail on windows :(

Not sure that the failing test is related to our current problem. If you can, maybe try out this project in your machine: https://github.com/jkubeio/jkube-integration-tests/tree/master/projects-to-be-tested/windows (Although maybe it won't work either because it's using a windows containers image, and you're probably running regular Docker)

@duke-arioch
Copy link
Author

I will play around when I have some time later today - if I see something useful I will submit a PR

@duke-arioch
Copy link
Author

Let me know if there's a slack or discord etc for this project - in the meantime, where does the code under test execute - is it part of the build, ie creating the image or otherwise working outside of it, or is it going into the image? and what drives whether a windows or linux image is built? and yes - I am running docker for windows, and using their default WSL2 image. Let me know if there's a better forum for all my dumb questions - as I am new to this project!

@RamazanKara
Copy link

Same Issue, Eclipse on Windows 10 is not working. Is there any fix I can apply?

@rohanKanojia
Copy link
Member

You can ask your questions on our gitter channel https://gitter.im/eclipse/jkube

@manusa manusa self-assigned this Jun 26, 2020
@manusa
Copy link
Member

manusa commented Jun 26, 2020

GitHub actions environment for windows is run in some sort of *nix compatible shell, so it will be hard to upgrade our IT to fail for this.
I'll try a complete build-apply iteration on my Windows machine and fix this or any other bug I find. We can take care of IT later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants