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

Proposal to improve SASS binary handling #75

Closed
drupol opened this issue Oct 9, 2024 · 0 comments · Fixed by #76
Closed

Proposal to improve SASS binary handling #75

drupol opened this issue Oct 9, 2024 · 0 comments · Fixed by #76

Comments

@drupol
Copy link
Contributor

drupol commented Oct 9, 2024

Hello,

Today, I attempted to build a new instance of the Symfony demo on NixOS, and you can find the log here: https://gist.github.com/drupol/31f96f358e9d35e1095f0ba5dd92c056.

Downloading and attempting to run a binary on NixOS will almost never work. This is due to hard-coded paths in the executable.
(source: https://wiki.nixos.org/wiki/Packaging/Binaries)

Why fixing this matters:

  1. To improve hermetic builds: by addressing this issue, we can enhance the isolation of builds for Symfony applications using this bundle. Since the builds should run in a fully isolated environment (no network access), we need a way to provide the SASS binary as a pre-requisite and avoid the build system downloading it.
  2. dependency clarity: this will also ensure we know exactly which dependencies the build system requires upfront, making the build process more predictable and maintainable.
  3. offline builds: making sure that "offline" builds of a Symfony app using this bundle will work

Proposed fix

To address this, I suggest modifying the behaviour of SassBuilder. Instead of downloading the SASS binary at build-time, it should first check if the binary is already available in the current system's path. If it finds the binary, it should use that, and only download the file if it is not found.

The current flow looks like this:

flowchart TD
    A[Find SASS Binary]
    A --> E[Download the file using the existing procedure]
Loading

I propose updating it to the following:

flowchart TD
    A[Find SASS Binary]
    A --> C{Is the SASS binary available in the system path?}
    C -->|Yes| D[Return the path to the binary]
    C -->|No| E[Download the file using the existing procedure]
Loading

This change would prevent unnecessary downloads and make the build process smoother on systems like NixOS and Guix.

Let me know what you think of the idea.

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 a pull request may close this issue.

1 participant