Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,21 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
if (["arm64-v8a", "x86_64"].contains(target.android)) {
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
} else {
rustFlags = '$rustFlags-L\x1f$workaroundDir';
}
Comment on lines +192 to +206

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic can be simplified by unconditionally appending the workaround directory flag first, and then conditionally appending the 16KB page size flags if the target is arm64-v8a or x86_64. This avoids duplicating the -L\x1f$workaroundDir string and simplifies the control flow. Additionally, using single quotes for string literals is preferred in Dart.

    rustFlags = '$rustFlags-L\\x1f$workaroundDir';
    if (['arm64-v8a', 'x86_64'].contains(target.android)) {
      const pageSizeArgs = [
        '-C',
        'link-arg=-Wl,--hash-style=both',
        '-C',
        'link-arg=-Wl,-z,max-page-size=16384',
      ];
      rustFlags = '$rustFlags\\x1f${pageSizeArgs.join("\\x1f")}';
    }
References
  1. PREFER using single quotes for string literals. (link)

return rustFlags;
}
}
Loading