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

initial scons 3.0.1 and python3 build support #1195

Closed
wants to merge 6 commits into from
Closed

initial scons 3.0.1 and python3 build support #1195

wants to merge 6 commits into from

Conversation

bmanojlovic
Copy link

This PR allows building mongo with use of latest (3.0.1) scons which now uses python3 by default.
There are still a lot of rough edges but on the end it allows building binary mongod

python version:

abuild@pc:~/rpmbuild/BUILD/mongo-patched> python3 --version
Python 3.6.3
abuild@pc:~/rpmbuild/BUILD/mongo-patched> 

scons version:

abuild@pc:~/rpmbuild/BUILD/mongo-patched> scons -v
SCons by Steven Knight et al.:
        script: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668, 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
        engine: v3.0.1.74b2c53bc42290e911b334a6b44f187da698a668, 2017/11/14 13:16:53, by bdbaddog on hpmicrodog
        engine path: ['/usr/lib/scons-3.0.1/SCons']
Copyright (c) 2001 - 2017 The SCons Foundation
abuild@pc:~/rpmbuild/BUILD/mongo-patched>

and finally running scons on my machine

abuild@pc:~/rpmbuild/BUILD/mongo-patched> scons -j 8 MONGO_VERSION=3.6.0  --disable-warnings-as-errors  --ssl
scons: Reading SConscript files ...
Mkdir("build/scons")
scons version: 3.0.1
python version: 3 6 3 final 0
Checking whether the C compiler works... yes
Checking whether the C++ compiler works... yes
...
...
...
ranlib build/blah/mongo/db/query/libquery_common.a
Generating library build/blah/mongo/db/libmongod_options.a
ranlib build/blah/mongo/db/libmongod_options.a
Linking build/blah/mongo/mongod
Install file: "build/blah/mongo/mongod" as "mongod"
scons: done building targets.
abuild@pc:~/rpmbuild/BUILD/mongo-patched> 

and of course running built binary

abuild@pc:~/rpmbuild/BUILD/mongo-patched> ./mongod --dbpath /tmp/ --bind_ip 127.0.0.1
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] MongoDB starting : pid=2937 port=27017 dbpath=/tmp/ 64-bit host=pc
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] db version v3.6.0
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] git version: 9038d0a67ee578aa68ef8482b1fc98750d1007a6
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.0g-fips  2 Nov 2017
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] modules: none
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] build environment:
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten]     distarch: x86_64
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2017-12-22T18:52:02.566+0000 I CONTROL  [initandlisten] options: { net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/tmp/" } }
2017-12-22T18:52:02.566+0000 I STORAGE  [initandlisten] Detected data files in /tmp/ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-12-22T18:52:02.566+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=15542M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2017-12-22T18:52:02.637+0000 I STORAGE  [initandlisten] WiredTiger message [1513968722:637511][2937:0x7f87663729c0], txn-recover: Main recovery loop: starting at 6/4736
2017-12-22T18:52:02.679+0000 I STORAGE  [initandlisten] WiredTiger message [1513968722:679111][2937:0x7f87663729c0], txn-recover: Recovering log 6 through 7
2017-12-22T18:52:02.706+0000 I STORAGE  [initandlisten] WiredTiger message [1513968722:706386][2937:0x7f87663729c0], txn-recover: Recovering log 7 through 7
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] 
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] 
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] 
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] 
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2017-12-22T18:52:02.730+0000 I CONTROL  [initandlisten] 
2017-12-22T18:52:02.736+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/tmp/diagnostic.data'
2017-12-22T18:52:02.737+0000 I NETWORK  [initandlisten] waiting for connections on port 27017

@acmorrow
Copy link
Contributor

@bmanojlovic - Thanks for the PR. This has been something I've been hoping to get done for a while. You might be interested also to have a look at https://jira.mongodb.org/browse/SERVER-32295, where another user has also tackled this.

I guess the first step would be to compare their and your solutions and come up with a unified proposal?

I'm going to ping the submitter of SERVER-32295 and point them to this PR so they can give their thoughts.

@acmorrow
Copy link
Contributor

Also, @bmanojlovic - have you signed the MongoDB contributor agreement?

https://www.mongodb.com/legal/contributor-agreement

@bmanojlovic
Copy link
Author

Yes i have signed it already before pushing PR

@bmanojlovic
Copy link
Author

Hm i did not see Marek patch , i will try to create branch with his patch applied to see if he fixed maybe something that i probably missed :)

@acmorrow
Copy link
Contributor

My hope is that both of you got 95% of the places, and together it makes 99% :)

@bmanojlovic
Copy link
Author

i have already made it build for my usecase (to build it for openSUSE :) )
https://build.opensuse.org/package/show/home:bmanojlovic:branches:server:database/mongodb

@bmanojlovic
Copy link
Author

i am trying to make comparison between our "version", here is my try at it
https://github.com/bmanojlovic/mongo/compare/python3...bmanojlovic:py3-marek-3.6.0?expand=1

@acmorrow
Copy link
Contributor

@bmanojlovic - Did you and Marek ever sync up on this work? I'm still interested in it, but I'd prefer one unified PR.

@bmanojlovic
Copy link
Author

bmanojlovic commented Jan 16, 2018

scratch that...

@bmanojlovic
Copy link
Author

I am combining them into one, will see what on the end it will look like, but i really can't promise 2 and 3 compatibility - will try but can't promise

@acmorrow
Copy link
Contributor

@bmanojlovic
Copy link
Author

acknowledged, will compare with new repository from @omron93

@jamespharvey20
Copy link

Ping? python2 retires in 4 months and 22 days, and several distributions have removed python2, or at least banished it to unofficially supported repositories.

@acmorrow
Copy link
Contributor

Python 3 support was added per https://jira.mongodb.org/browse/SERVER-32295, so I'm closing this review.

@acmorrow acmorrow closed this Aug 10, 2019
@jamespharvey20
Copy link

@acmorrow Thanks. That link shows it was only added to the unstable 4.1 branch (4.1.10.) So, everyone using the stable 4.0 branch hasn't had this. But, stable was just upgraded from 4.0 to 4.2 which includes python3 support, so this works well enough for me.

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.

3 participants