[SERVER-22134] Build system should acknowledge user based environment Created: 11/Jan/16  Updated: 11/Jan/16  Resolved: 11/Jan/16

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Valentin Kuznetsov Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

When user would like to build a custom build of MongoDB and use his/her own set of tools (gcc/python) the MongoDB scons build system should acknowledge user based environment, i.e. reads proper location of compiler, python, LD_LIBRARY_PATH, etc. This will allow to build MognoDB on old system and use custom environment with tools in non-standard location.



 Comments   
Comment by Valentin Kuznetsov [ 11/Jan/16 ]

Andrew, I rebuilt with proposed option MongoDB in our environment and it builds fine. You may close this issue. Thanks for explanation.

Comment by Ramon Fernandez Marina [ 11/Jan/16 ]

Copying Andrew's comment from the pull request here for convenience:

Hi @vkuznet - This isn't the right way to do this. SCons, as part of its design, intentionally does not allow environment variables into the build by default. This is intended to ensure reproducible builds, and this is actually a feature that we support.

However, we do recognize that sometimes, as in your case, you need to do this. So, we have provided a mechanism to allow users to externally script injections into the SCons environment.

This is accomplished by configuring SCons 'Variables'. Among those variables is `ENV`, which contains a dictionary of shell environment variables that should be propagated into the environment of processes started by SCons.

While Variables are typically configured on the command line (e.g. `scons VAR=value`), it is clear that the `ENV` variable cannot be configured in this manner (how would you specify the dictionary?). Instead, we have provided the ability to load Variables from a file, with the SCons flag `--variables-files`.

The `--variables-files` option takes a delimiter separated list of files and loads Variable definitions from them. In particular, we have provided a pre-canned Variables file that explicitly imports the calling shell environment to handle situations like the one you have described:

https://github.com/mongodb/mongo/blob/master/etc/scons/propagate_shell_environment.vars

Invoking SCons as:

scons --variables-files=etc/scons/propagate_shell_environment.vars ...

will achieve the same effect as the change you have made in this pull request, without unconditionally forcing it on all users of the MongoDB build system.

Comment by Andrew Morrow (Inactive) [ 11/Jan/16 ]

vkuznet - Please see my comment in that PR for why this is not the desired solution.

Comment by Valentin Kuznetsov [ 11/Jan/16 ]

Here is proposed fix: https://github.com/mongodb/mongo/pull/1057

Generated at Thu Feb 08 03:59:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.