-
Notifications
You must be signed in to change notification settings - Fork 981
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
[question] Conan 2 rejects upload due to manifest mismatch due to __pycache__ #14838
Comments
Hi @marlamb Thanks for your question. Neither Conan 1.X or Conan 2.0 should create If things are changing in the manifest, maybe it could be some wide It is true that Conan 2.0 is no longer filtering pyc and pycache files, that is, the CONAN_KEEP_PYTHON_FILES=1 env-var behavior has been made the default. This was done because there were a bunch of users wanting to create .pyc files, and being blocked because of Conan not packaging them. It made little sense for Conan to be smart about these files if it was no longer creating them (the initial behavior made sense when Conan was not disabling its own .pyc/pycache generation for its own python files). You might use the exclude patterns or the Please let me know if this helps. |
Hi @memsharded , thanks for the fast reply. The environment variable sounded promising, but unfortunately it did not work out as hoped 😞 . What I did is simply
Or is it meant to be used differently? If I got your comment correctly it would have been expected that setting the env variable should enable filtering in the package step. But for me it looks like the filtering (at least for Conan 1.x) is also active during the upload. However, I am not sure if we are talking about the exact same behavior. What I can see is the following:
What actually works is to set
but I would consider this as a non-optimal solution as IMO it is preferred to use the byte code to improve Pythons execution speed, so users should not rely on deactivating it within their terminals. Putting it into the Summarizing: Some ways exist to solve my problem 😃 . But the default settings combined with recipes from the I am looking forward to read your thoughts about it 👍 . |
The Thanks for the details, I have managed to reproduce. It indeed makes sense:
I think this is something to try to fix in the Meson recipe in conan-center-index, but I am going to label this as "look-into" for discussion with the team, and check possible approaches. It might not be easy, in the meantime, I'd suggest:
|
That definitely explains the behavior I saw, I was already wondering why the Conan 2 documentation does not mention the variable 😆 . Also the rest makes sense to me, but I must admit I am not really happy about it. For me having a What I still don't understand is: for Conan 1 the upload just works fine and the |
Yes, we agree here, the flow must be supported. The problem seems very specific to the nature of Python apps creating extra files in a place that is supposed to be immutable, because it has a manifest that declares the files in the package, and after executing it and creating pycache files, the contents of the package has been changed. We think this needs to be fixed, so the The only thing is that this is not tied exclusively to the |
We have had a look, it seems that something like |
I am submitting this to ConanCenter conan-io/conan-center-index#21764, as a potential workaround for the Meson package recipe. Also, for the other potentials solutions, the tickets to track are:
|
We'll tackle the general issue pointed out by this report as part of the #15277 work - please keep an eye on that issue :) |
What is your question?
Hi! I am currently migrating towards Conan 2.x and saw an unexpected behavior while trying to build and upload the package
meson
from theconan-center-index
with only one adaptation from my side, using a different version ofninja
.I am using the Conan version 2.0.12 in a Python environment of version 3.10.13.
From the previous behavior of Conan 1.x and after reading the issues #7789 #4961 and #5404 I was under the impression that Conan deliberately ignores cache files (which makes sense in my opinion).
However, for Conan 2 it complains during the upload about a manifest mismatch and lists then all files residing in a
__pycache__
, which are created during the execution of thetest_package
.I am using the following commands
My question is: Is this behavior for Conan 2.x expected, e.g. by a different default workflow (e.g. not executing the
test_package
before an upload - which would feel wrong to me)? Or is this some kind of degradation compared to the behavior of Conan 1.x?Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: