Skip to content
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

Add use_param_file c++ feature as a replacement for controlling param files #20890

Open
hauserx opened this issue Jan 13, 2024 · 0 comments
Open
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: feature request

Comments

@hauserx
Copy link
Contributor

hauserx commented Jan 13, 2024

Description of the feature request:

If the use_param_file feature will be enabled for a given action then bazel will pass parameters through a param file. Param file name will be available through param_file build variable which toolchain config will need to handle in flag_set.

This way one will be able to selectively use param files for applicable actions, and pass param file in toolchain specific way.

Currently available support requires one to specify supports_param_files toolchain parameter, remember to enable archive_param_file feature and enable compiler_param_file feature to support param files in most actions. Also, linker param files are handled differently (through linker_param_file build variable), than compile param file for which handling is hardcoded to always use @ name.

Which category does this issue belong to?

C++/Objective-C Rules

What underlying problem are you trying to solve with this feature?

Param files are used to overcome limits of commandline argument length. It's especially important for windows which has much tighter requirements. Providing simpler solution than current will be more flexible by allowing per action selection whether param file is enabled, more consistent by using feature for all actions, and hopefully less error prone due to that.

It will replace current knobs:

  • setting cc_toolchain.supports_param_files - enables param files for linking actions. If enabled, param file is available through linker_param_file build variable.
  • feature archive_param_file (added in bff9730) - enables param files for static linking actions, applicable only if supports_param_files is also set
  • feature compiler_param_file (added in df3d8cb) - enables param files for compile actions. If enabled then bazel unconditionally adds @<param-file> flag to command line (code)

Which operating system are you running Bazel on?

linux, bazel

What is the output of bazel info release?

6.4

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

Generic bug with some comments where users discovered which features to use:

#17068 - Bazel 6.0.0 upgrade not possible due to "command is longer than CreateProcessW's limit (32767 characters)

Bugs related to passing param file as argument:

#16168 - compiler_param_file does not use custom flag prefix from "flag_groups"
(fixed) #18074 - linker_param_file only added to command line if it starts with "@"

Any other information, logs, or outputs that you want to share?

No response

@sgowroji sgowroji added the team-Rules-CPP Issues for C++ rules label Jan 16, 2024
@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: feature request
Projects
None yet
Development

No branches or pull requests

5 participants