Comments (3)
The plugin settings are either inherited from the host repo, or overridden by the subrepo. This is defined by the plugin e.g. DefaultOptFlags
is inherited:
https://github.com/please-build/cc-rules/blob/master/.plzconfig#L47
This means that we will use the flags as defined in the host repo. I think this is probably what you want most of the time, because these flags can be dependant on the toolchain you're using. Maybe we need another config option called AdditionalOptFlags
that is not inherited that allows B to provide any other flags that should be applied on top of the flags from the host repo? Would that help?
from please.
As a workaround for this issue, I've been doing something similar to this :
buildfile = text_file(
name="BUILD.plz",
visibility=["PUBLIC"],
strip=True,
content=f"""
CONFIG["OS"] = '{goos}'
CONFIG["ARCH"] = '{goarch}'
CONFIG["GO"] = {{
'PLEASE_GO_TOOL': '{please_go_tool_tl}',
'GO_TOOL': '{go_tool}',
'AR_TOOL': '{ar_tool}',
'CC_TOOL': '{cc_tool}',
'STRIP_TOOL': '{strip_tool}',
'C_FLAGS': [],
'LD_FLAGS': [],
'BUILDMODE': '{buildmode}',
'CGO_ENABLED': '{cgo_enabled}',
'COVERAGEREDESIGN': False,
'CPP_COVERAGE': False,
'DEFAULT_STATIC': {default_static},
'DELVE_TOOL': 'dlv',
'PKG_INFO': True,
'RACE': False,
'TEST_ROOT_COMPAT': False,
'VALIDATE_MODULE_VERSION': False,
'IMPORT_PATH': None,
'LEGACY_IMPORTS': None,
'SPLIT_DEBUG_INFO': None,
'REQUIRE_LICENCES': None,
'STDLIB': None,
}}
# build file
""",
)
repo = filegroup(
name="srepo",
srcs = [buildfile, tree]
)
subrepo(
name=subrepo_name,
dep=repo,
package_root=f"pkg/{CONFIG.OS}_{CONFIG.ARCH}/{module}",
)
This create a BUILD file for the subrepo that will override every config keys first and then do the actual work, you can even completely remove PluginDefinition from .plzconfig
I still get this bug #2943 though
from please.
Sorry for the late response.
The issue I'm facing is that I have transient plugins that need different settings for other plugins.
In my case, I have a c++20 project, which depends on 2 other c++ projects using please. Namely, a library I wrote & mysql-connector-cpp (I wrote a diff file to add please support for it).
The issue is that the latter sub-repo only compiles with c++17 but I cant seem to define a .please
file that overrides DefaultOptCppflags
/DefaultDbgCppflags
just for it.
Instead I had to define something like what izissise suggested and assign a variable to all compiler_flags
arguments of cc_library
within the sub-repo.
Further issues arise as mysql-connector-cpp also provides a modified version of the protobuf compiler, so even though any projects that depend on it should not care, they still have to define the please proto rules and their arguments in the root .plzconfig
file.
While something like AdditionalOptFlags
would help, a more plugin agnostic approach would be better. Ideally, the root repo would not have to define what tools/other plugins are needed for the sub-repos it uses. Especially for things like internal compilers that wouldnt be used outside of the sub-repo in the first place.
If it helps, I can also look into creating a public repo for the patch file I made for mysql-connector-cpp, though right now it only adds the minimum required please support to it (I have not tried to dynamically generate version strings etc. that their current cmake setup does).
from please.
Related Issues (20)
- Re-enable //test/proto_plugin:proto_rules_test
- Bug in codelab - wrong port
- Crash on tab completion
- Target not found from subrepo
- Support instantiation_stack when querying HOT 1
- Panic / segfault when using query command with --arch option that doesn't match the platform
- Intermediate build results (phase A and B) HOT 6
- Tools not found with --shell & remote execution
- .plzconfig key with empty value HOT 4
- review Go analysis.Pass.Module proposal HOT 1
- Third party dependencies fail to add with please_go HOT 4
- Adding please to a large repo - how to migrate to please and best practices for upkeep HOT 3
- SLSA and Provenance attestation data for builds HOT 3
- pkl + plz: multi-directory genrule outs HOT 2
- plz clean doesn't remove LinkGeneratedSources'ed links HOT 3
- plz query codelab still references go_get()
- plz init still suggests getting auxiliary rules from the Pleasings repo
- Support for tab escape charcter missing. HOT 1
- List concatenation bug HOT 1
- Race condition when depending on rules created in post_build. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from please.