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

Bunch of tiny fixes for macos #790

Closed
wants to merge 4 commits into from
Closed

Conversation

evgeniiz321
Copy link
Contributor

No description provided.

@@ -222,7 +222,7 @@ def upload_via_http_gate_curl(
large_object = is_object_large(filepath)
if large_object:
# pre-clean
_cmd_run("rm pipe -f")
_cmd_run("rm pipe -f || true")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dangerous

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make something more darwin-specific here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it dangerous? we just ignore the RC here, if something is not ok, we will fail on the next command. I'm not sure it is worth it to adapt the code to macos here, since the problem is only in the rm -f returning non zero RC on macos if there is nothing to remove. But if we want, I can try to get rid of pipes here at all

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can fail for some other reason and you won't notice. At least if the problem doesn't affect the next command. But you're right in that mkfifo is the main thing here, if it works then we don't care much about rm. Does it all happen in tmp directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it happens in the current working directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's worse. Maybe we can feed curl in some other way then or use some pythonic library instead of curl. This named pipe trick came from the HTTP gateway documentation. There CLI tooling only was used, so there were not a lot of choices. But in a test it seems kludgy, this pipe can be left in FS if something goes wrong.

Evgeniy Zayats added 4 commits May 3, 2024 19:34
@evgeniiz321 evgeniiz321 force-pushed the ezayats/fix-environment-sh branch from b7c4331 to c848ad8 Compare May 3, 2024 23:35
@evgeniiz321 evgeniiz321 marked this pull request as draft May 4, 2024 03:48
@evgeniiz321 evgeniiz321 closed this May 7, 2024
@evgeniiz321 evgeniiz321 deleted the ezayats/fix-environment-sh branch May 7, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants