• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Tutorial] How to build the Pokémon GBA decomps using WSL (Win10)

Lunos

Random Uruguayan User
  • 3,136
    Posts
    16
    Years

    27 of January from 2023. I'm rewriting this tutorial. I should have done it much sooner, but y'all know me; I'm lazy.
    What are the goals? To explain in simple steps how to set up an environment to build Pret's Pokémon Decompilation Projects on WSL.
    What is being added? Explanations on how to set up a WSL2 environment and considerations to keep in mind and such.
    What's driving me to do this after so long? Devkitpro, in a way. I won't say more.
    Let's get to it.

    Before we start, I'll need you to make a choice; WSL1 or WSL2.

    List of Pros and Cons:
    Spoiler:


    After you made up your choice, follow the correspondent section of the tutorial.
    Personally, I do my decomp work on the filesystem of my Ubuntu installation using WSL2.

    WSL1:
    Spoiler:


    WSL2:
    Spoiler:


    (Not Really) Frequently Asked Questions (FAQ):
    Spoiler:


    In case of need, I'm keeping an archived copy of this post as a GitHub Gist. Click here to check it.
    I'm going to update it whenever I make changes to this post.

    And that's pretty much it.
     
    Last edited:
    Well maybe my problem is a good first response. So, I got this response when I tried to enable the optional features.

    "Enable-WindowsOptionalFeature : A parameter cannot be found that matches parameter name 'Online-'.
    At line:1 char:31
    + Enable-WindowsOptionalFeature -Online- -Featurename Microsoft-Windows ...
    + ~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Enable-WindowsOptionalFeature], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand"
     
    Well maybe my problem is a good first response. So, I got this response when I tried to enable the optional features.

    "Enable-WindowsOptionalFeature : A parameter cannot be found that matches parameter name 'Online-'.
    At line:1 char:31
    + Enable-WindowsOptionalFeature -Online- -Featurename Microsoft-Windows ...
    + ~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Enable-WindowsOptionalFeature], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand"

    Seems you've typed it wrong? You have -Online- but it should be -Online? Maybe?
     
    Looks unusual to me? Going ahead and restarting my computer.
    PS C:\WINDOWS\system32> Enable-WindowsOptionalFeature -Online -Featurename Microsoft-Windows-Subsystem-Linux


    Path :
    Online : True
    RestartNeeded : False

    Then after WSL was downloaded , I had made a username already the first try I guess, and this is what happened

    "user@LAPTOP-6LIT01A9:~$ cd Downloads
    -bash: cd: Downloads: No such file or directory
    user@LAPTOP-6LIT01A9:~$ cd Downloads sudo dpkg -i devkidpro-pacman.deb
    -bash: cd: too many arguments
    user@LAPTOP-6LIT01A9:~$"
     
    Last edited by a moderator:
    New to this but is this normal? Going ahead and restarting my computer.
    PS C:\WINDOWS\system32> Enable-WindowsOptionalFeature -Online -Featurename Microsoft-Windows-Subsystem-Linux


    Path :
    Online : True
    RestartNeeded : False

    It is, yes. When RestartNeeded gives you a "False", that means WSL is already enabled in your system.
     

    3) Let's put WSL away for now and go to our web browser, where we'll download the latest .deb package of devkitPro right here.
    Keep this .deb package in a folder like C:\Users\USER\Downloads, you'll see why in a moment.


    I need to download the devkitpro pacman installer.pkg and the devkitpro pacman.deb file. I put them in the download folder. I need the ubuntu app/software to download them
     
    I need to download the devkitpro pacman installer.pkg and the devkitpro pacman.deb file. I put them in the download folder. I need the ubuntu app/software to download them
    No. You don't need the .pkg package.
    As for Ubuntu, that is what you're installing in this tutorial. Ubuntu which is a distribution of Linux that can be used on Windows via WSL.
     
    Last edited:
    2) Go to the Microsoft Store and search "Ubuntu 18.04 LTS". Go to its page in the store and click the blue "Get" button.

    Alternatively, if for X or Y reason you don't have access to the Microsoft Store, you can install it by downloading and running its .appx package.
    Note: The first of the 3 entries specifically, the one called "Ubuntu 18.04 LTS (Bionic)".

    Is there a reason for getting Ubuntu 18.04 specifically, instead of the option without a version listed? I've blindly recommended that one to a few people setting up WSL...
     
    Is there a reason for getting Ubuntu 18.04 specifically, instead of the option without a version listed?
    Not really sure. I'm not a Linux user and I don't know about the quirks of each distro, what makes them different and such.
    In this tutorial I suggested Ubuntu 18.04 specifically because it's the distro for WSL that I used and that I know will work if you follow correctly all the steps written here.
     
    Hey Lunos,even though I'm sure I followed the tutorial properly, I'm getting a problem when I run the ./build.sh command. The issue I got is attached below. Do you know how to help me? However I'm using a WSL with Ubuntu 16.04 installed on it.
     

    Attachments

    • [PokeCommunity.com] [Tutorial] How to build the Pokémon GBA decomps using WSL (Win10)
      Immagine.png
      24.1 KB · Views: 79
    Hey Lunos,even though I'm sure I followed the tutorial properly, I'm getting a problem when I run the ./build.sh command. The issue I got is attached below. Do you know how to help me? However I'm using a WSL with Ubuntu 16.04 installed on it.
    See that line on WSL's window?
    No rule to make target '/opt/devkitPro/devkitARM/base_tools'. Stop.

    That means WSL is not recognizing your installation of devkitPro/ARM.
    Are you sure you followed Step 7.5 properly?

    All in all, as I said up there, I wrote this tutorial in the way I did, because that's how I did the process on my end and it worked for me.
    I'm not sure, but I suppose it may be possible that the 2 different versions of Ubuntu you can use in WSL may have their own differences.
     
    I repetead the step 7.5, and even though I didn't get those blank lines, I added those 4 additional commands. Now everything seems fine. Thank you Lunos
     
    Hey, when I get to the step of actually cloning agbcc and pokeemerald, I get an error:
    Code:
    Cloning into 'agbcc'...
    error: chmod on /mnt/c/users/askme/documents/decomps/agbcc/.git/config.lock failed: Operation not permitted
    fatal: could not set 'core.filemode' to 'false'

    Any idea where I might have done something wrong? I tried having WSL open in admin mode, as well.

    EDIT: I'm a dummy. For anyone who has this same issue, don't clone into any windows directory, just clone in the root.
     
    Last edited:
    Hey, when I get to the step of actually cloning agbcc and pokeemerald, I get an error:
    Code:
    Cloning into 'agbcc'...
    error: chmod on /mnt/c/users/askme/documents/decomps/agbcc/.git/config.lock failed: Operation not permitted
    fatal: could not set 'core.filemode' to 'false'

    Any idea where I might have done something wrong? I tried having WSL open in admin mode, as well.

    EDIT: I'm a dummy. For anyone who has this same issue, don't clone into any windows directory, just clone in the root.

    This is to do with incompatibilities for permissions with the NTFS system used by Windows. Strangely, I never had this issue on one Windows machine, but did on another. I suspect different versions/builds are at play there, but in the latter case prepending the sudo command often did the trick. A more permanent and proper solution is to remount the drive using:
    Code:
    sudo umount /mnt/c
    sudo mount -t drvfs C: /mnt/c -o metadata
    as discussed in the documentation for WSL build 17063 (https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-17063).

    Personally I like to host these projects in my Windows documents rather than the WSL root as they're much easier to navigate and edit that way, although I'd advise the git commands should always still be done from within the WSL bash not CMD/Powershell and editing done from Remote - WSL not vanilla VS Code to reduce the risk of errors seeping in.
     
    This is to do with incompatibilities for permissions with the NTFS system used by Windows. Strangely, I never had this issue on one Windows machine, but did on another. I suspect different versions/builds are at play there, but in the latter case prepending the sudo command often did the trick. A more permanent and proper solution is to remount the drive using:
    Code:
    sudo umount /mnt/c
    sudo mount -t drvfs C: /mnt/c -o metadata
    as discussed in the documentation for WSL build 17063 (https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-17063).

    Personally I like to host these projects in my Windows documents rather than the WSL root as they're much easier to navigate and edit that way, although I'd advise the git commands should always still be done from within the WSL bash not CMD/Powershell and editing done from Remote - WSL not vanilla VS Code to reduce the risk of errors seeping in.

    Aha! That is much more convenient! Thanks for the help!
     
    Not sure if i did step 4 correctly but when i type in cd Downloads it says no such file or directory
    and when i typed the full line in a single code it says theres too many arguments
     
    Back
    Top