-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fs configure_file_list function #12272
base: master
Are you sure you want to change the base?
Conversation
1adb2aa
to
f56023d
Compare
f56023d
to
16ab6e6
Compare
a85a23d
to
6680e10
Compare
6680e10
to
0884692
Compare
Another use case is described in discussion #13235 |
To wit on the above use case, our project's compiled archive binaries must match a specific SHA-sum, which means that the archives must be packed in a certain order. Historically, we would manage a separate file, but this feels brittle and does not play well with change; ideally, we would build that file from the existing list of files statically defined in the |
Linking discussion #13235, an alternative approach would be to make |
The problem I see is that not all custom commands can use rsp files, and not all commands use the same rsp file syntax. I don't see how this could easily be implemented in a generic way. |
I do agree with @bruchar1 that it doesn't seem to make sense to automatically use rsp files, since not all executables support them nor use the same syntax. Perhaps if an |
Of course it would not be automatic, but instead have a kwarg like |
We already have a depfile kwarg, which is something else that compilers have builtin handling for but must be manually implemented for each custom target. A possible analogous feature we could use here, would be: custom_target(
...,
command: ['myprog', '-i', '@INPUT@', '-o', '@OUTPUT@', '--foo', '--bar=baz', additional_args],
rspfile_args: ['--args-from', '@RSPFILE@'],
rsp_style: 'gcc',
) Which would, I suppose, produce a commandline of |
Offering support for a leading-args parameter I think makes more sense than expecting an underlying program to always interpret a response file via the same methodology. At least for my team's use case, the difference won't matter (since we build the tools where we would use a response file anyways), but it makes more sense to me to hedge against users with third-party tools that may have varying input schemae. |
@bruchar1 I'm not a lead maintainer so if you're not sure about the changes I suggested, feel free to ask someone else if they are appropriate. I had some trouble interpreting the documentation and may have suggested something that isn't intended. |
This function produces, at build time, a file containing the list of files given as argument. It is used when a command uses, as argument, a file containing the list of files to process. One usecase is to provide to `xgettext` the list of files to process, from the list of source files, when this list is too long to be provided to the command line as individual files.
0884692
to
d19c2f1
Compare
@andy5995 Thank you for the review. As English is for me a second language, I may not always have the best wording for explaining the things... I rebased and updated version numbers accordingly. |
I finally got around to going through this thoroughly. There is at least one major usability thing to consider. There are two different commonly used ways of reading command line arguments (or the like) from files. The first one is this:
But then there is also this, which is not standard but supported by many programs by convention:
The Meson has native support for the latter and and it would be nice if that could be reused. But it requires the command to be run to understand the The other thing is that this adds a |
If I was able to pass the file names as argument to The other thing is that even if the list of file names is known at config time, I need to detect at compile time whether any of the input files were modified. Otherwise, the |
The reason this is a problem is because at least with the current implementation, a file_list doesn't communicate the input files as additional dependencies for the later custom_target. |
This is a new attempt to achieve the same goal as what I tried in #11822 , but in a simpler way.
This function produces, at build time, a file containing the list of files given as argument. It is used when a command uses, as argument, a file containing the list of files to process. One usecase is to provide to
xgettext
the list of files to process, from the list of source files, when this list is too long to be provided to the command line as individual files.