Open Bug 1958986 Opened 1 year ago Updated 1 year ago

Allow us to indicate to bootstrap that I solemnly swear it's ok to replace my Android SDK directory.

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: mgaudet, Unassigned)

References

Details

When bootstrapping android and there's already an SDK directory present there's this awkward build failure caused by this code which says

    # We don't want to blindly overwrite, since we use the
    # |sdkmanager| tool to install additional parts of the Android
    # toolchain.  If we overwrite, we lose whatever Android packages
    # the user may have already installed.

But I would say as a platform engineer, it's unlikely I'm going to install anything beyond what bootstrap does; so I'd love to be able to swear to bootstrap "I promise, I won't be mad if you eat my installed android packages". It's just irksome when trying to bisect something to constantly have to rm -rf the directory and run bootstrap again.

I suppose though you're always going to have to babysit this process because of potentially needing to accept the license.

(In reply to Matthew Gaudet (he/him) [:mgaudet] from comment #0)

When bootstrapping android and there's already an SDK directory present there's this awkward build failure caused by this code which says

    # We don't want to blindly overwrite, since we use the
    # |sdkmanager| tool to install additional parts of the Android
    # toolchain.  If we overwrite, we lose whatever Android packages
    # the user may have already installed.

But I would say as a platform engineer, it's unlikely I'm going to install anything beyond what bootstrap does; so I'd love to be able to swear to bootstrap "I promise, I won't be mad if you eat my installed android packages". It's just irksome when trying to bisect something to constantly have to rm -rf the directory and run bootstrap again.

Would the following be sufficient?

    # We don't want to blindly overwrite, since we use the
    # |sdkmanager| tool to install additional parts of the Android
    # toolchain.  If we overwrite, we lose whatever Android packages
    # the user may have already installed.
    allow_sdk_overwrite = os.environ.get("MACH_ALLOW_ANDROID_SDK_OVERWRITE") == "1"

    if sdkmanager_tool(sdk_path).is_file() and not allow_sdk_overwrite:
        print(ANDROID_SDK_EXISTS % sdk_path)
    else:

I suppose though you're always going to have to babysit this process because of potentially needing to accept the license.

Running with --no-interactive doesn't skip the input for the license?
eg: ./mach --no-interactive bootstrap --application-choice="GeckoView/Firefox for Android"

Flags: needinfo?(mgaudet)

I went down this path, but I didn't submit anything because I concluded that what we really want is something like a --force flag for the whole of bootstrap. Doing that would require more broad work (i.e., to force reinstalling toolchains like clang, etc).

I'd like to wait to see if Bug 1960055 solves the Android SDK problem before doing anything ad-hoc here.

(In reply to Nick Alexander :nalexander [he/him] from comment #2)

I went down this path, but I didn't submit anything because I concluded that what we really want is something like a --force flag for the whole of bootstrap. Doing that would require more broad work (i.e., to force reinstalling toolchains like clang, etc).

I'd like to wait to see if Bug 1960055 solves the Android SDK problem before doing anything ad-hoc here.

While not exactly the same, a --clean would be pretty easy to implement, just delete most of the contents of .mozbuild prior to bootstrapping.

We can definitely hold off a bit here.

Flags: needinfo?(mgaudet)

Very well.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.