This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Override --jobs option value with an env var in build.rs#43
Merged
Keats merged 1 commit intocompass-rs:masterfrom May 21, 2019
Merged
Override --jobs option value with an env var in build.rs#43Keats merged 1 commit intocompass-rs:masterfrom
Keats merged 1 commit intocompass-rs:masterfrom
Conversation
This patch enables build.rs to override --jobs option value of make command with MAKE_LIBSASS_JOBS environment variable. In typical containerization system (e.g. Docker), the number of CPU cores which is visible from a process jailed into a container can be greater than the container limitation. This change is useful in the above situation. (Of course, not only that!)
mozamimy
added a commit
to mozamimy/salmon
that referenced
this pull request
May 7, 2019
I have created a pull request to resolve the problem. However, the PR is not accepted yet. compass-rs/sass-rs#43
mozamimy
added a commit
to mozamimy/salmon
that referenced
this pull request
May 11, 2019
Now we are using forked sass-rs. https://github.com/mozamimy/sass-rs/tree/make-libsass-env We can publish salmon crate after merge following PR. compass-rs/sass-rs#43
Collaborator
|
woops sorry, didn't notice that |
mozamimy
added a commit
to mozamimy/salmon
that referenced
this pull request
May 23, 2019
compass-rs/sass-rs#43 is merged. We can use `MAKE_LIBSASS_JOBS` environment variable to control job count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch enables build.rs to override --jobs option value of
make command with MAKE_LIBSASS_JOBS environment variable.
In typical containerization system (e.g. Docker), the number of CPU cores
which are visible from a process jailed into a container can be greater than
the container limitation.
This change is useful in the above situation. (Of course, not only that!)
I am developing a my own static site generator named Salmon. That app uses this crate to compile Sass files. This wrapper library is great for me 😃! I appreciate maintainers' contributions.
I am trying automation of release the app, however, sometimes a building job is failed like https://circleci.com/gh/mozamimy/salmon/93 memory allocation error.
CircleCI is using Docker for containerization technology to isolate each build environment. The building process by build.rs finds the number of CPU is 36 with current implementaion. However, the actual given CPU cores are two and the memory limitation is 4096MB.
So I want to inject the parameter of
--jobsfrom out of build.rs.I guess
MAKE_LIBSASS_JOBSis good naming and using environment variable is good solution... But I'm not too confident!