-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fileinfo: fix not detecting 'unix' files to be OS specific (#1554)
The build file generation logic works like this today: ``` GenerateRules() package.go->*goTarget.addFiles package.go->getPlatformStringsAddFunction() fileinfo.go->isOSArchSpecific() ``` Depending on whether the file has special Go build directives, Gazelle would use a different logic to include/exclude the file into the 'srcs' attribute of the Go targets. In #1512, we added support for 'unix' build directive but did not tell Gazelle to treat files with 'unix' file as OS specific file. This caused Gazelle to mismatch the OS in a later stage and exclude the needed file instead. Fix that logic and provide some additional tests to reinforce the fileinfo logic. Also added a small knob to print stdout of Gazelle when it's run under go_repository with `debug_mode` attribute set to True. Most Gazelle's logs are printed to stdout and not stderr.
- Loading branch information
Showing
3 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters