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

[FLINK-37181][build] Fix MacOS sha256sum tool compile error #26034

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gaborgsomogyi
Copy link
Contributor

@gaborgsomogyi gaborgsomogyi commented Jan 21, 2025

What is the purpose of the change

The maven command is failing in the following way due to a wrongly working MacOS tool called sha256sum:

Running `/Users/gaborsomogyi/flink/mvnw`...
Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.
Investigate or delete /Users/gaborsomogyi/flink/.mvn/wrapper/maven-wrapper.jar to attempt a clean download.
If you updated your Maven version, you need to update the specified wrapperSha256Sum property.

The issue is that sha256sum is not working as described in the manual:

In all cases, each file listed on the command line is processed separately.  If no files are listed on the command line, or a file name is given as -, input is taken from stdin instead.

Manual test:

$ echo '3d8f20ce6103913be8b52aef6d994e0c54705fb527324ceb9b835b338739c7a8  /Users/gaborsomogyi/flink/.mvn/wrapper/maven-wrapper.jar' | sha256sum -c    
usage: sha256sum [-bctwz] [files ...]
$ echo '3d8f20ce6103913be8b52aef6d994e0c54705fb527324ceb9b835b338739c7a8  /Users/gaborsomogyi/flink/.mvn/wrapper/maven-wrapper.jar' | sha256sum -c -  
/Users/gaborsomogyi/flink/.mvn/wrapper/maven-wrapper.jar: OK

In short sha256sum works only when file name is given as - so in this PR I've added explicit file name.

Brief change log

Added explicit file name to sha256sum and shasum.

Verifying this change

Manually on MacOS and linux.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@jiefei30
Copy link
Contributor

Very strange, I'm not sure if this is the reason. When I cloned flink at the beginning of last month, I could still run mvnw under macos. A few weeks later, I ran mvnw again and the same problem occurred as yours

@gaborgsomogyi
Copy link
Contributor Author

If you think the root cause is something different then please share the details. In my case the mentioned code caused it.
Does this work on your end?

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 21, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@gaborgsomogyi
Copy link
Contributor Author

cc @gyfora

@jiefei30
Copy link
Contributor

If you think the root cause is something different then please share the details. In my case the mentioned code caused it. Does this work on your end?

Sorry I can't provide more details, I always get Maven wrapper SHA-256 verification failure now, but your modification did solve this problem under macos

@gaborgsomogyi
Copy link
Contributor Author

Good to hear it's working on your side too.

@gaborgsomogyi
Copy link
Contributor Author

Some unrelated tests are flaky so restarting.

@gaborgsomogyi
Copy link
Contributor Author

@flinkbot run azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants