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

Enable ./gradlew build on MacOS (M1) by loudly disabling bwc tests. #7303

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ updates:
labels:
- "dependabot"
- "dependencies"
- directory: /distribution/archives/darwin-arm64-tar/
open-pull-requests-limit: 1
package-ecosystem: gradle
schedule:
interval: weekly
labels:
- "dependabot"
- "dependencies"
- directory: /distribution/archives/integ-test-zip/
open-pull-requests-limit: 1
package-ecosystem: gradle
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `jackson` from 2.14.2 to 2.15.0 ([#7286](https://github.com/opensearch-project/OpenSearch/pull/7286)

### Changed
- Enable `./gradlew build` on MacOS by disabling bcw tests ([#7303](https://github.com/opensearch-project/OpenSearch/pull/7303))

### Deprecated

Expand Down
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,16 @@ tasks.register("verifyVersions") {
*/

boolean bwc_tests_enabled = true

/* place an issue link here when committing bwc changes */
final String bwc_tests_disabled_issue = ""
String bwc_tests_disabled_issue = ""

/* there's no existing MacOS release, therefore disable bcw tests */
if (Os.isFamily(Os.FAMILY_MAC)) {
bwc_tests_enabled = false
bwc_tests_disabled_issue = "https://github.com/opensearch-project/OpenSearch/issues/4173"
}

if (bwc_tests_enabled == false) {
if (bwc_tests_disabled_issue.isEmpty()) {
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ if (project != rootProject) {
dependencies {
reaper project('reaper')
distribution project(':distribution:archives:darwin-tar')
distribution project(':distribution:archives:darwin-arm64-tar')
distribution project(':distribution:archives:linux-arm64-tar')
distribution project(':distribution:archives:linux-tar')
distribution project(':distribution:archives:windows-zip')
Expand Down
3 changes: 2 additions & 1 deletion distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
modulesFiles = { platform ->
copySpec {
eachFile {
if (it.relativePath.segments[-2] == 'bin' || (platform == 'darwin-x64' && it.relativePath.segments[-2] == 'MacOS')) {
if (it.relativePath.segments[-2] == 'bin' || ((platform == 'darwin-x64' || platform == 'darwin-arm64') && it.relativePath.segments[-2] == 'MacOS')) {
// bin files, wherever they are within modules (eg platform specific) should be executable
// and MacOS is an alternative to bin on macOS
it.mode = 0755
Expand Down Expand Up @@ -622,6 +622,7 @@ subprojects {
}

['archives:darwin-tar',
'archives:darwin-arm64-tar',
'archives:integ-test-zip',
'archives:linux-arm64-tar',
'archives:linux-tar',
Expand Down
1 change: 1 addition & 0 deletions distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ configurations {
}

dependencies {
arm64DockerSource project(path: ":distribution:archives:darwin-arm64-tar", configuration:"default")
arm64DockerSource project(path: ":distribution:archives:linux-arm64-tar", configuration:"default")
s390xDockerSource project(path: ":distribution:archives:linux-s390x-tar", configuration:"default")
ppc64leDockerSource project(path: ":distribution:archives:linux-ppc64le-tar", configuration:"default")
Expand Down