-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New attempt at wraplock #13854
base: master
Are you sure you want to change the base?
New attempt at wraplock #13854
Conversation
6b44b76
to
7978e35
Compare
@eli-schwartz Am I correct in my assumption that are those CodeQL results are false positives? Especially since the previous |
fb337b9
to
0dbee14
Compare
Oh, I see what it's complaining about. Because the |
DirectoryLock provides a generic locking implementation the replaces the previously used BuildDirLock.
To avoid raceconditions, where one instance of meson currently downloads a subproject defined in a wrapfile, while another either a. starts the download itself too b. attemts to evaluate the partially downloaded subproject wraplock introduces a lockfile, which should prevent simultaneous access of subprojects by wrap between different instances of meson.
0dbee14
to
1ff4a2f
Compare
@@ -10,23 +10,38 @@ | |||
import typing as T | |||
|
|||
from .core import MesonException | |||
from .platform import BuildDirLock as BuildDirLockBase | |||
from .platform import DirectoryLockBase, DirectoryLockAction |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.utils.platform
mesonbuild.utils.posix
definition
import
@@ -10,23 +10,38 @@ | |||
import typing as T | |||
|
|||
from .core import MesonException | |||
from .platform import BuildDirLock as BuildDirLockBase | |||
from .platform import DirectoryLockBase, DirectoryLockAction |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.utils.platform
mesonbuild.utils.posix
definition
import
@@ -10,20 +10,35 @@ | |||
import typing as T | |||
|
|||
from .core import MesonException | |||
from .platform import BuildDirLock as BuildDirLockBase | |||
from .platform import DirectoryLockBase, DirectoryLockAction |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.utils.platform
mesonbuild.utils.win32
definition
import
@@ -10,20 +10,35 @@ | |||
import typing as T | |||
|
|||
from .core import MesonException | |||
from .platform import BuildDirLock as BuildDirLockBase | |||
from .platform import DirectoryLockBase, DirectoryLockAction |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
mesonbuild.utils.platform
mesonbuild.utils.win32
definition
import
@dcbaker it seems like the issue is that platform.py imports mlog, which sometimes imports mesonlib. Not sure what could be done about that |
It really only needs things from |
The point of these delayed function-local imports was precisely to ensure that these cycles do not, will not, and cannot exist. Poking at utils.universal directly seems weird. :p Why is CodeQL complaining about this? |
And indeed, that commit didn't fix it. It must be complaining about something else. |
1ddb69e
to
1ff4a2f
Compare
dropped. Does CodeQL only complain about "newly" introduced issues? Im still confused as to why BuildDirLock did not have that issue given that the imports entirely match |
You will sometimes find when refactoring code that it detects something it doesn't like and thinks it is brand new issues, possibly combined with fixing an old issue ("the issues must be different! The name changed!"). |
Yeah, I just want to check that this could be merged and it wont complain about it for every single new PR like what'd happen if a normal test case fails |
supersedes #13784