Giter Club home page Giter Club logo

Comments (7)

facundominguez avatar facundominguez commented on May 25, 2024

I tried it in centos and it seems to work. To produce the following output, I edited bazel-genfiles/clotestbin-cc-pie.sh as follows:

    #!/usr/bin/env bash
-   set -eu
+   set -eux
    tmpdir=$(mktemp -d)
    trap "rm -rf '$tmpdir'" EXIT
    unzip -q "$0" -d "$tmpdir" 2> /dev/null || true
    "$tmpdir/clotestbin-cc-pie-closure_wrapper"
    exit 0
$ bazel-genfiles/clotestbin-cc-pie.sh
+++ mktemp -d
++ tmpdir=/tmp/tmp.LrouJaUrK4
++ trap 'rm -rf '\''/tmp/tmp.LrouJaUrK4'\''' EXIT
++ unzip -q bazel-genfiles/clotestbin-cc-pie.sh -d /tmp/tmp.LrouJaUrK4
++ true
++ /tmp/tmp.LrouJaUrK4/clotestbin-cc-pie-closure_wrapper
hello cc
++ exit 0
++ rm -rf /tmp/tmp.LrouJaUrK4

If the script can't find /tmp/tmp.LrouJaUrK4/clotestbin-cc-pie-closure_wrapper as it says, the most likely cause is that unzip -q bazel-genfiles/clotestbin-cc-pie.sh -d /tmp/tmp.LrouJaUrK4 doesn't output the files where we expect.

from clodl.

guibou avatar guibou commented on May 25, 2024

You are right. That's just the missing unzip. I'm changing the title to reflact that clodl closures are not working on system without unzip.

from clodl.

facundominguez avatar facundominguez commented on May 25, 2024

Sounds good. Do you have any proposals for a fix?

We could check if unzip is present and produce a better error message. Is this what you expect?

from clodl.

guibou avatar guibou commented on May 25, 2024

It would be better yes.

Why using unzip? Isn't tar or gunzip more portable? I've tested on docker containers, tar and gunzip are always present in ubuntu, debian, arch, centos and nixos. However unzip was not present in any of the docker image I pulled for theses distributions.

from clodl.

mboes avatar mboes commented on May 25, 2024

from clodl.

facundominguez avatar facundominguez commented on May 25, 2024

Clodl uses zip, the same as jars. But we never use clodl to build a jar. At least sparkle creates the jars using java_library, not clodl.

@guibou if you need another format, it could be added as an option. If you want to eliminate zip, then we would need to teach sparkle to extract the new format, but it is probably not worth the trouble.

from clodl.

thufschmitt avatar thufschmitt commented on May 25, 2024

Having clodl output tar archives would be really handy when using it to build containers since the container_image rule from rules_docker can directly take a tgz as input.
Atm the way I use it is that I have a genrule which unzip the clodl-generated archive and re-packs it with tar, but that's far from optimal

from clodl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.