-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
prebuild assets location resolution at runtime #3304
Comments
Hi, did you see https://sharp.pixelplumbing.com/install#custom-prebuilt-binaries ? |
Yup I did but my understanding is i have to set them during "npm install" and not after? |
Would symlinks suffice? You'd need to link the |
Unfortunately no because the build sandbox is readonly :( |
Have you considered installing libvips from package manager (or from source)? |
Yup I've kinda tried but bazel manages all external dependencies and is very explicit (e.g download this file from this host with this checksum) and trying to re-compile is pretty hard. I also cannot install it to a global location because it's non-hermetic. Or maybe I'm misunderstanding your suggestion? |
Did you see the example provided by Bazel at https://github.com/bazelbuild/rules_nodejs/tree/stable/e2e/nodejs_image ? |
Yup pulling in Docker is definitely an option I was just wondering if it can be done w/o it :) I'd love to understand the complexity of making those deps runtime as well. |
There's another example at https://github.com/aspect-build/rules_js/tree/main/e2e/npm_link_package if you hadn't seen it. |
Yup rules_js is in beta and requires a decent LOE to migrate. It's in our roadmap but at least not until it's stabler. |
@longlho Were you able to make any progress with this? |
Closing due to inactivity but please feel free to reopen with more details if further help is required. In summary, from what I've seen, https://github.com/aspect-build/rules_js offers the best approach, and even uses sharp as an example in its tests. |
Just documenting this in case someone is having the same issue on Nix, since like Bazel it also works with a strict sandbox. I'm building a Next.js app which is packaged with Nix's buildNpmPackage. Include pkgs.buildNpmPackage rec {
pname = "my-project";
version = "0.0.1";
src = pkgs.lib.cleanSource ./.;
npmDepsHash = "some hash";
npmPackFlags = [ "--ignore-scripts" ];
nativeBuildInputs = [
pkgs.python3 # needed by buildNpmPackage
pkgs.pkg-config
];
buildInputs = [
pkgs.vips
];
PKG_CONFIG_PATH = pkgs.pkg-config;
} |
Anyone interested in sandboxed builds should probably subscribe to #3750 for updates. |
Question about an existing feature
What are you trying to achieve?
I'm trying to integrate sharp in our bazel build which is hermetic and uses sandbox for everything. Effectively what I'm looking for is:
Is there a way to do that?
When you searched for similar issues, what did you find that might be related?
#3270
#2741
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this question
Please provide sample image(s) that help explain this question
The text was updated successfully, but these errors were encountered: