Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-45774: Autoconfiscate SQLite detection (GH-29507)#29507

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tiran merged 18 commits intopython:mainfromerlend-aasland:ac-sqlite
Nov 19, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedNov 9, 2021
edited by bedevere-bot
Loading

@erlend-aaslanderlend-aasland added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 9, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@erlend-aasland for commit9bc5d7b 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 9, 2021
@erlend-aaslanderlend-aasland marked this pull request as ready for reviewNovember 9, 2021 23:36
@erlend-aasland
Copy link
ContributorAuthor

SQLite was not detected on buildbotAMD64 FreeBSD Shared PR.

@erlend-aaslanderlend-aasland marked this pull request as draftNovember 9, 2021 23:46
@tiran
Copy link
Member

SQLite was not detected on buildbotAMD64 FreeBSD Shared PR.

@koobs where is sqlite installed on your FreeBSD buildbot? Is it in /usr/local by any chance? Would the solutionhttps://bugs.python.org/issue45774#msg406076 work for FreeBSD?

erlend-aasland reacted with eyes emoji

@koobs
Copy link

koobs commentedNov 10, 2021
edited
Loading

SQLite was not detected on buildbotAMD64 FreeBSD Shared PR.

@koobs where is sqlite installed on your FreeBSD buildbot? Is it in /usr/local by any chance? Would the solutionhttps://bugs.python.org/issue45774#msg406076 work for FreeBSD?

sqlite3-3.35.5 is installed on both FreeBSD buildbot workers in LOCALBASE (/usr/local by default). This is the standard location for third party libraries installed via FreeBSD ports and official packages.

I haven't deeply reviewed the implementation in issue 45774, but I don't see a reference to--with(out)-sqlite3 to explicitly disable/enable, but otherwise and generally speaking, standard autoconf/configure checks for dependencies is fine.

I would also caution that wherever possible when doing dependency detection and configuration, we should include the ability to pass dependency specific include/library paths and *FLAGS, because Pythons build system is particularly inconsistent and flaky with respect to passing *FLAGS globally, which downstreams often have to utilise.

This can causes include ordering issues, as well as build/link time conflicts when a dependency is installed in more than one location, and both are picked up.

Other than at the configure level--with-foo-{inc,lib}=<path> (or similar), this also meansModules/Setup, if support for it is not there already (like SSL).

Further Sqlite3 Information

Installed libraries and header names:

# ls -la /usr/local/lib/libsqlite3.so*lrwxr-xr-x  1 root  wheel       19 Oct 30 01:09 /usr/local/lib/libsqlite3.so@ -> libsqlite3.so.0.8.6lrwxr-xr-x  1 root  wheel       19 Oct 30 01:09 /usr/local/lib/libsqlite3.so.0@ -> libsqlite3.so.0.8.6-rwxr-xr-x  1 root  wheel  1422160 Oct 30 01:09 /usr/local/lib/libsqlite3.so.0.8.6*# ls -la /usr/local/include/sql*-rw-r--r--  1 root  wheel     838 Oct  4 08:15 /usr/local/include/sql3types.h-rw-r--r--  1 root  wheel    1283 Oct  4 08:15 /usr/local/include/sqlca.h-rw-r--r--  1 root  wheel    1586 Oct  4 08:15 /usr/local/include/sqlda-compat.h-rw-r--r--  1 root  wheel     824 Oct  4 08:15 /usr/local/include/sqlda-native.h-rw-r--r--  1 root  wheel     321 Oct  4 08:15 /usr/local/include/sqlda.h-rw-r--r--  1 root  wheel  584223 Oct 30 01:09 /usr/local/include/sqlite3.h-rw-r--r--  1 root  wheel   35437 Oct 30 01:09 /usr/local/include/sqlite3ext.h

sqlite also installed a pkg-config file:

# pkgconf --list-all |grep sql# sqlite3                        SQLite - SQL database engine# pkgconf sqlite3 --cflags --libs# -I/usr/local/include -L/usr/local/lib -lsqlite3

@tiran
Copy link
Member

Thanks@koobs !

Yes, I agree.setup.py does some problematic things in regards of default include and linker path. We are working on a series of improvements for the build system. One goal is to move header and linker checks out ofsetup.py and improveModules/Setup.local.

We don't use pkg-config for sqlite3 yet. Is/usr/local/include on the default search path?

koobs and erlend-aasland reacted with heart emoji

@koobs
Copy link

koobs commentedNov 10, 2021
edited
Loading

We should assume it is (and not hardcode paths, unless there's no better alternative). Right now most if not all downstreams will be passing-isystem and/or custom build *FLAGS (along with CC et al if needed) at the global environment, and/or configure environment, and/or make environment and or Modules/Setup level to make the build work, given the current state of the Python build system. It's very tough to make things work without regressing something else. Adding another unique or special/different case would be another step backward IMO.

Sorry for the non-binary answer :)

@tiran
Copy link
Member

FYI, I summarized my plan inhttps://bugs.python.org/issue45573#msg406084

erlend-aasland and koobs reacted with thumbs up emoji

@erlend-aasland
Copy link
ContributorAuthor

FYI: Holding this untilGH-29164 has landed.

@erlend-aaslanderlend-aasland added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 15, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@erlend-aasland for commit 0c36ebac224953603971079cbe706a77da248d5f 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 15, 2021
@erlend-aaslanderlend-aasland added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 16, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@tiran for commitd7c4180 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 18, 2021
@tiran
Copy link
Member

Looks good! Great job! Let's do another buildbot run. I'll merge the PR tomorrow.

erlend-aasland reacted with hooray emoji

@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedNov 18, 2021
edited
Loading

FreeBSD still emits a warning:

checking sqlite3.h usability... yeschecking sqlite3.h presence... noconfigure: WARNING: sqlite3.h: accepted by the compiler, rejected by the preprocessor!configure: WARNING: sqlite3.h: proceeding with the compiler's resultchecking for sqlite3.h... yeschecking for sqlite3_open_v2 in -lsqlite3... yeschecking for sqlite3_load_extension in -lsqlite3... yes

It also failed the configure step, but that was bco.getaddrinfo:

Fatal: You must get working getaddrinfo() function.       or you can specify "--disable-ipv6".

UPDATE 1
How about patchingCPPFLAGSin addition to instead ofCFLAGS before running the AC checks?

UPDATE 2
I was previously unable to reproduce this on my FreeBSD,but that was because I had GCC installed. The FreeBSD buildbot does not have GCC installed. Afterpkg remove gcc, I was able to reproduce this issue, and I was also able to verify that theCPPFLAGS workaround works.

@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedNov 18, 2021
edited
Loading

The ARM64 macOS buildbot failed atAC_CHECK_LIB([sqlite3], [sqlite3_open_v2], ..., leavingsqlite3 disabled. From previous runs, I see that it has SQLite 3.32.3 installed; there should be no reason for it to fail.

(The x86-64 macOS buildbot is fine, though.)

UPDATE
Suspecting the following might fix it:

diff --git a/configure.ac b/configure.acindex 88b5a18ae9..1d87235a94 100644--- a/configure.ac+++ b/configure.ac@@ -3176,8 +3176,8 @@ AS_VAR_APPEND([LIBSQLITE3_CFLAGS], [' -I$(srcdir)/Modules/_sqlite'])  AS_VAR_COPY([save_CFLAGS], [CFLAGS]) AS_VAR_COPY([save_LDFLAGS], [LDFLAGS])-AS_VAR_COPY([CFLAGS], [LIBSQLITE3_CFLAGS])-AS_VAR_COPY([LDFLAGS], [LIBSQLITE3_LIBS])+CFLAGS="$LIBSQLITE3_CFLAGS $CFLAGS"+LDFLAGS="$LIBSQLITE3_LIBS $LDFLAGS"  AC_CHECK_HEADER([sqlite3.h], [   AC_CHECK_LIB([sqlite3], [sqlite3_open_v2], [

@tiran
Copy link
Member

You figured it out already!

FreeBSD has 3rd party headers in /usr/local/include. The pre-processor does not use CFLAGS. You need CPPFLAGS here. I concur that it's safe to use CPPFLAGS instead of CFLAGS for sqlite. Most pgkconf files set -I, -D, -L, and -l. Other rare cases may need both CFLAGS and CPPFLAGS, though.

erlend-aasland reacted with thumbs up emoji

@erlend-aasland
Copy link
ContributorAuthor

If41a78b5 looks ok for you (as a fix for both the FreeBSD and macOS arm issues), we'll run it through the buildbots again.

tiran reacted with thumbs up emoji

@tirantiran added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 19, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@tiran for commit41a78b5 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 19, 2021
@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedNov 19, 2021
edited
Loading

SQLite is now detected without warnings on FreeBSD. It does however still fail bco.getaddrinfo.It also fails like that onmain.

Fatal: You must get working getaddrinfo() function.       or you can specify "--disable-ipv6".

UPDATE: This fails becauseLIBS is touched byAC_CHECK_LIB. After the SQLite check,LIBS contains-lsqlite3, so when we run thegetaddrinfo check a little bit later, it fails because it cannot findlibsqlite3. Fixed by0173b66.

@erlend-aasland
Copy link
ContributorAuthor

ARM64 macOS is also fine now. Nice.

@erlend-aaslanderlend-aasland added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 19, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@erlend-aasland for commit0173b66 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 19, 2021
Copy link
Member

@tirantiran left a comment

Choose a reason for hiding this comment

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

Tests are passing!

erlend-aasland reacted with hooray emoji
@erlend-aasland
Copy link
ContributorAuthor

Tests are passing!

Finally 😆

@tirantiran changed the titlebpo-45774: Autoconfiscate SQLite detectionbpo-45774: Autoconfiscate SQLite detection (GH-29507)Nov 19, 2021
@tirantiran merged commit29e5874 intopython:mainNov 19, 2021
@erlend-aaslanderlend-aasland deleted the ac-sqlite branchNovember 19, 2021 14:11
@koobs
Copy link

Great job!

erlend-aasland reacted with heart emoji

remykarem pushed a commit to remykarem/cpython that referenced this pull requestDec 7, 2021
Co-authored-by: Christian Heimes <christian@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tirantirantiran approved these changes

@ronaldoussorenronaldoussorenAwaiting requested review from ronaldoussoren

@ned-deilyned-deilyAwaiting requested review from ned-deily

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@erlend-aasland@bedevere-bot@tiran@koobs@ned-deily@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp