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

Hermetic Core Utilities #409

Closed

Conversation

mattyclarkson
Copy link

This expands it usage in the shell script for other core utilities in more of the shell scripts.

The usage of xargs could be rewritten in pure Bash, maybe.

Hoping to get rules_oci to a point where it require zero tooling from the host 🤞

We use `xargs` which is not part of `coreutils`.

The part that uses `xargs` could be rewritten with something similar to:

```sh
while IFS= read -r LINE; do
    # Do something with `$LINE`
    # _or_ use `IFS` splitting to process the tag file
done < "${TAG_FILE}"
```
@mattyclarkson
Copy link
Author

Related to #385 in terms of hermetic-ness of the project.

@thesayyn
Copy link
Collaborator

Hey, thank you for the PR. I would love to land this, but currently there's a problem with the coreutils toolchain on darwin/arm64 where if rosetta is disabled, it fails horribly.

@thesayyn
Copy link
Collaborator

cross-ref: uutils/coreutils#4104

@thesayyn
Copy link
Collaborator

This is now unblocked, we will accept the PR once we upgrade bazel-lib here.

@thesayyn thesayyn added the blocked Blocked on some other work label Nov 14, 2023
@alexeagle
Copy link
Collaborator

Along with Bazel 7 release we'll drop Bazel 5 support, that will be our chance to make a 2.0 release here, which in turn lets us make the breaking change of requiring bazel-lib 2.0. Sorry this got tied up in our semver ...

@mattyclarkson
Copy link
Author

No worries. We use xargs here

if [[ -e "${TAGS_FILE:-}" ]]; then
  cat "${TAGS_FILE}" | xargs -n1 "${CRANE}" tag $(cat "${REFS}")
fi

The docs say:

a .txt file containing tags, one per line.

if [[ -e "${TAGS_FILE:-}" ]]; then
  for IFS= read -r TAG; do
    "${CRANE}" tag $(cat "${REFS}")
  done <"${TAGS_FILE}"
fi

Which would get rid of another external program.

I can put up a separate PR or add it to this one, if that is something we'd be happy to take.

@thesayyn thesayyn added this to the bazel-lib 2.0 milestone Dec 12, 2023
@thesayyn
Copy link
Collaborator

thesayyn commented May 8, 2024

@mattyclarkson do you mind rebasing this PR against 2.x, and we'll land it there?

@thesayyn
Copy link
Collaborator

Okay closing this as it's not landable as is. Feel free to create a new PR rebased on top 2.x.

@thesayyn thesayyn closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on some other work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants