Hi there, we are facing an issue on the tailor com...
# general
c
Hi there, we are facing an issue on the tailor command, it is not generating BUILD file correctly, after multiple hours we found that was related to a
files
dependencies, I use a generic kind of import all for my Docker Image
Copy code
files(
    name="files",
    sources=[
        "project/**/*",
        "**/*.py",
        "poetry.lock",
        "pyproject.toml",
        "README.md",
        "!tests/",
    ],
)

docker_image(
    name="docker",
    dependencies=[
        ":files",
[...]
without this, I am missing several files of all kinds during the Packaging of my Docker image, but when I remove this dependency, the
tailor ::
command works again correctly. Is there a way to disable for certain targets dependencies ? I have tested almost all options on the tailor stuff and options in my
pants.toml
I guess this is not ideal to do an import all with files but need a generic solution to build my docker image over ~20 micro services in a mono repo + multiples libraries. Any ideas?
e
Did the options you tested include this?: https://www.pantsbuild.org/docs/reference-tailor#ignore_paths
Basically, can you enumerate what options you did try?
c
I have tested so far • Adding in pants.toml under [tailor]
ignore_paths = ["src/services/project/BUILD"]
• Adding in pants.toml under [tailor]
ignore_adding_targets = ["src/services/project:docker", "src/services/project:files"]
(tried all combinations • Tried to tag my
files
and run
tailor --tag="sommething" tailor ::
• Tried to add a negative dep in the
python_source
top level of my project
e
And, for the 1st two bullet points you're saying tailor modified
src/services/project/BUILD
anyway?
c
tailor is not generating BUILD file deeper in the project, for example one of my dev did 5 python package under
src/services/project/package/api
with
__init__.py
and tailor won't detect it and add new BUILD files in each package
but if I remove the
files
dep completely of the top level BUILD of
src/services/project
it works normally
e
That sounds buggy to me, but I have not been involved in tailor use or development.
c
currently our dev are adding the BUILD file manually since they only contains the
python_sources()
but if they forget to add it, the unit test are failing since tailor add correctly the BUILD files for the unit tests only (I guess because I have
!tests/
in my
files
dependencies)
Should I open a ticket on github ? I can try to reproduce the bug from a tiny fresh project and see if the behavior is the same
and I have tested with 2.14 but I am currently using 2.15.0rc4
e
Opening an issue would be a good next step, yes. If you can provide a tiny fresh repro project that is ideal. Thank you.
c
so could reproduce with this https://github.com/CerberusQc/pants-issue I will open a ticket