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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override --jobs option value with an env var in build.rs #43

Merged
merged 1 commit into from May 21, 2019

Conversation

Projects
None yet
2 participants
@mozamimy
Copy link
Contributor

commented May 7, 2019

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 --jobs from out of build.rs.

I guess MAKE_LIBSASS_JOBS is good naming and using environment variable is good solution... But I'm not too confident!

Override --jobs option value with an env var in build.rs
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 mozamimy force-pushed the mozamimy:make-libsass-env branch from c79c6a4 to 3054d96 May 7, 2019

mozamimy added a commit to mozamimy/salmon that referenced this pull request May 7, 2019

Use a fork of sass-rs to resolve build job failures
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

Do not publish crate temporarily
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

@Keats Keats merged commit 949a448 into compass-rs:master May 21, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Keats

This comment has been minimized.

Copy link
Collaborator

commented May 21, 2019

woops sorry, didn't notice that

@mozamimy mozamimy deleted the mozamimy:make-libsass-env branch May 23, 2019

mozamimy added a commit to mozamimy/salmon that referenced this pull request May 23, 2019

Use official sass-rs crate
compass-rs/sass-rs#43 is merged. We can use
`MAKE_LIBSASS_JOBS` environment variable to control job count.

@mozamimy mozamimy referenced this pull request May 23, 2019

Merged

Use official sass-rs crate #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.