Skip to content

feat: Option to search sass executable#94

Open
qdequippe wants to merge 1 commit intoSymfonyCasts:mainfrom
qdequippe:detect-binary
Open

feat: Option to search sass executable#94
qdequippe wants to merge 1 commit intoSymfonyCasts:mainfrom
qdequippe:detect-binary

Conversation

@qdequippe
Copy link

I recently encountered this issue (see #84) during a deployment to a cloud environment. Since this specific environment restricts the installation of external binaries, I suggest adding a configuration option that allows the bundle to automatically download the appropriate binary during cloud build phase.

@qdequippe qdequippe changed the title feat: Option to search sass executable or not feat: Option to search sass executable Jan 23, 2026
Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

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

Hm, I think we don't need that extra arguemnt, how about simplify the business logic in that method?

Comment on lines +187 to +191
$binaryPath = $this->binaryPath;

if (null === $binaryPath && $this->searchBinary) {
$binaryPath = (new ExecutableFinder())->find('sass');
}
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure we need this searchBinary extra parameter? Why we can't just tweak this logic to:

Suggested change
$binaryPath = $this->binaryPath;
if (null === $binaryPath && $this->searchBinary) {
$binaryPath = (new ExecutableFinder())->find('sass');
}
$binaryPath = $this->binaryPath;
if (null === $binaryPath) {
$binaryPath = (new ExecutableFinder())->find('sass');
}

Copy link
Author

Choose a reason for hiding this comment

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

Yes I need it because in my case $this->binaryPath is null so $binaryPath will be null and an executable will be found.

I want to force $binaryPath to be null here, thanks to that SassBinary will download the binary locally.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, that's what I'm talking about... if you have binaryPath set to null, then this code should be enough for you to find the binary:

        $binaryPath = $this->binaryPath;
        if (null === $binaryPath) {
            $binaryPath = (new ExecutableFinder())->find('sass');
        }

Or you don't want the bundle to use your global sass locally and always download the new one?

Copy link
Author

Choose a reason for hiding this comment

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

Or you don't want the bundle to use your global sass locally and always download the new one?

yes that's it! :)

@bocharsky-bw
Copy link
Member

bocharsky-bw commented Feb 12, 2026

Hey @qdequippe , sorry for the long reply! OK, once again, what are we trying to solve here that can't be achieved with the changes we have in master so far? As I understand, right now, if the path isn't specified explicitly in the config, we will try to find the path for executable sass. If it's installed in the system globally - we will use that path. If it's not - we will download the latest ourselves, right?

You suggest a config option that will help to decide if we should search the executable path or not. It would help to force downloading the latest version even if Sass is installed in the system globally, right? But if you have a Sass bin globally installed in your system, why would you want to not use it then? I mean, you can update it yourself globally to the latest. Or if you don't use that global sass - maybe you should delete it completely from your system, which will automatically fallback to download the latest by the bundle?

I mean, we're trying to add more config options here that might be just redundant and confusing. Why don't you want to solve this a different way, which is more appropriate IMO. Could you explain your point of view, please?

@qdequippe
Copy link
Author

hi @bocharsky-bw my use case is that on my hosting provider there is a version of the sass binary that does not supports --source-map (an older version). I can't update this binary (because it is managed by my hosting provider) neither add another binary during the building phase of deployment. All I can do is to rely on this bundle to download the correct binary for me during the "compile phase". But as it finds a saas binary on the system (invalid one) it will not download a new one and the "compile phase" fails.

I would like to have an option to say to the bundle "ok download the binary everytime" :)

I hope I've been clear, feel free to ask if not

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