Skip to content

Commit

Permalink
Enabled ./gradlew build on MacOS M1 w/o bwc tests. (#7303)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock authored Apr 26, 2023
1 parent 7b8796a commit 77f6d13
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
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 @@ -88,6 +88,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

0 comments on commit 77f6d13

Please sign in to comment.