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

[Bug] Cannot run program "zip" exception reported when Windows system compiles #941

Closed
1 of 2 tasks
s7monk opened this issue Apr 19, 2023 · 13 comments
Closed
1 of 2 tasks
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@s7monk
Copy link
Contributor

s7monk commented Apr 19, 2023

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master

Compute Engine

Flink

Minimal reproduce step

Because the paimon-e2e-tests module adds the zip configuration.After I update the code, compile with Windows system and report Cannot run program "zip" exception.

I put the zip.exe file in the bin directory of jdk, the problem is solved。

微信截图_20230419082919

What doesn't meet your expectations?

no

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@s7monk s7monk added the bug Something isn't working label Apr 19, 2023
@zhuangchong
Copy link
Contributor

You may encounter a "Cannot run program 'zip'" exception. This is because Windows does not have the zip command installed by default, so Maven cannot find the executable.

To fix this, you need to have the zip command installed on your Windows system. You can download GNU zip for Windows from http://gnuwin32.sourceforge.net/packages/zip.htm, then add zip.exe to your system PATH environment variable.

@JingsongLi
Copy link
Contributor

We can use jar instead of zip.

@tsreaper tsreaper added the good first issue Good for newcomers label May 11, 2023
@q977734161
Copy link
Contributor

I am willing to try this ticket, counld you assign it to me!

@tsreaper
Copy link
Contributor

tsreaper commented Jun 1, 2023

@q977734161 thanks for your interest in contributing! Before assigning you to this ticket, could you briefly explain how are you going to fix this issue? Which command are you going to use instead of zip -d?

@lianghuan-xatu
Copy link

lianghuan-xatu commented Jun 2, 2023

@q977734161 thanks for your interest in contributing! Before assigning you to this ticket, could you briefly explain how are you going to fix this issue? Which command are you going to use instead of zip -d?

please assign it to me, and I will use the command "jar cvf test.jar dir/* --exclude dir/unwanted_directory/ --exclude dir/unwanted_file" instead of the command 'zip -d'. Thx!

@q977734161
Copy link
Contributor

q977734161 commented Jun 7, 2023

@tsreaper still use zip -d, but i am going to use maven-antrun-plugin instead of exec-maven-plugin ,At the same time, add the judgment script ,If the system is Windows , use certutil to download zip. exe, and then use the command zip - d; Otherwise, execute zip - d directly.

<if>
        <contains string="${os.name}" substring="Mac"/>
          <then>
                    <exec executable="certutil">
                            <arg line="-urlcache -split -f http://stahlworks.com/dev/zip.exe /tmp/paimon-e2e-tests-jars/zip.exe"></arg>
                    </exec>
                     <exec executable="/tmp/paimon-e2e-tests-jars/zip.exe">
                            <arg line=" -d /tmp/paimon-e2e-tests-jars/bundled-hadoop.jar org/apache/commons/cli/CommandLine.class"></arg>
                     </exec>
            </then>
            <else>
                     <exec executable="zip">
                          <arg line=" -d /tmp/paimon-e2e-tests-jars/bundled-hadoop.jar org/apache/commons/cli/CommandLine.class"></arg>
                      </exec>
            </else>
</if>

@tsreaper
Copy link
Contributor

Hi @lianghuan-xatu @q977734161 , thanks for your solutions. In my opinion, using jar is a better solution than downloading zip.exe, because Paimon is a Java project and user must have jdk to build it. @lianghuan-xatu please submit a pull request as soon as possible.

@q977734161
Copy link
Contributor

I think using jar is not very convenient either. We need to decompress the jar package , delete the class, and then package it. As jar do not support decompressing to the specified directory, Many commands are needed in the process
and different operating system commands are incompatible. It is necessary to write different scripts for each operating system.

@tsreaper
Copy link
Contributor

Hi @q977734161 , thanks for your feedback.

You mentioned that for our current jar solution, it might be "necessary to write different scripts for each operating system". However your certutil solution is also exclusive to Windows as we don't have cerutil on Mac or Linux. I guess writing scripts for different operating system is not a strong downside.

Also, what I like the jar solution most is that it uses existing applications in the user's environment, rather than downloading a new one.

@q977734161
Copy link
Contributor

Got it, I understand what your think now

@dbac
Copy link

dbac commented Jul 28, 2024

Why does the bug close without fixing it?
@tsreaper @JingsongLi

@dbac
Copy link

dbac commented Jul 28, 2024

http://stahlworks.com/dev/zip.exe

I found that download this file to windows system32 will do

@tsreaper
Copy link
Contributor

Hi @dbac , we currently does not guarantee the compilation and usage of Paimon on Windows.

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

No branches or pull requests

7 participants