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

compiler_param_file does not use custom flag prefix from "flag_groups" #16168

Open
Warchant opened this issue Aug 26, 2022 · 6 comments
Open
Labels
area-Windows Windows-specific issues and feature requests not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: windows team-Rules-CPP Issues for C++ rules type: bug

Comments

@Warchant
Copy link
Contributor

Description of the bug:

On Windows there is a need to enable "compiler_param_file" feature to solve 32k chars CreateProcessW limit.

If compiler does not support @ synax (g++ @file.txt) but requires custom flag, default feature implementation should be changed.

My version:

compiler_param_file_feature = feature(
        name = "compiler_param_file",
        enabled = True,
        flag_sets = [
            flag_set(
                actions = [
                    ACTION_NAMES.c_compile,
                    ACTION_NAMES.cpp_compile,
                ],
                flag_groups = [
                    flag_group(
                        flags = ["--cmd_file", "%{compiler_param_file}"],
                        expand_if_available = "compiler_param_file",
                    ),
                ],
            ),
        ],
    )

Feature is enabled, but I still see @ prefix instead of --cmd_file:

  external\ti\bin\cl6x.exe @bazel-out/wintic6000-fastbuild/bin/cpp/src/_objs/mycpplib_c/mycpplib.o.params

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

Windows

What is the output of bazel info release?

5.1.1

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?

No

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

No response

@sgowroji
Copy link
Member

Hello @Warchant, Could you please provide complete steps to reproduce the above request. Thanks!

@fmeum
Copy link
Collaborator

fmeum commented Aug 26, 2022

@sgowroji Looks like the use of @ rather than the feature expansion is hard-coded here: https://cs.opensource.google/bazel/bazel/+/b671079e6cc3864cdbf6018474c9e417bc062453:src/main/java/com/google/devtools/build/lib/rules/cpp/CompileCommandLine.java;l=96.
A reproducer would still be a useful base for an integration test added after this has been fixed.

@oquenchil oquenchil added P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: windows area-Windows Windows-specific issues and feature requests and removed untriaged labels Oct 26, 2022
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Dec 31, 2023
@Warchant
Copy link
Contributor Author

Warchant commented Jan 1, 2024

not stale

Issue still exists

@fmeum
Copy link
Collaborator

fmeum commented Jan 1, 2024

@bazelbuild/triage

@sgowroji sgowroji added not stale Issues or PRs that are inactive but not considered stale and removed stale Issues or PRs that are stale (no activity for 30 days) labels Jan 1, 2024
@hauserx
Copy link
Contributor

hauserx commented Jan 11, 2024

Similar issue was solved for linker_param_file in #18074 (see b5cfea5)

Maybe it could be solved by similar logic here as well? (cc @comius)

New linker_param_file logic:

Current compiler_param_file logic:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: windows team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

No branches or pull requests

5 participants