Current blockers:
- Need to wait for multipass 1.1 for this bugfix: canonical/multipass#1170
- Need to wait for multipass snapcraft builder images to be built for Windows (currently not bootable, according to Saviq)
- Need to merge this PR to fix issues with sanity checking: canonical/snapcraft#2919
- Need to merge this PR to fix issues with push not working: canonical/snapcraft#2922
snapcraft clean
does not yet work.
Requirements:
- Python 3.7.6
- multipass
- Windows Hyper-V
- git for Windows
- Visual C++ 2015 Build Tools
- squashfs for Windows (for
snapcraft push
)
Instructions to get around the first four blockers:
- Install the above. For squashfs, extract to C:\bin
- edit your PATH variable to include the following:
%USERPROFILE%\AppData\Local\Programs\Python\Python37
%USERPROFILE%\AppData\Local\Programs\Python\Python37\Scripts
C:\bin
Make sure that they are at the top of the list or it will not work with the command line (it will just prompt you to install the windows store version, which we don't want.)
- Clone my fork of the snapcraft repository: https://github.com/NickZ/snapcraft
- Checkout the
windows-testing
branch (gets around blocker 1, 3, and 4) - run the following in the command line at the repo:
pip install -r requirements.txt
pip install -e .
- Launch a multipass instance with the following command: (to get around blocker 2)
multipass launch -d10G -m2G -c4 -nsnapcraft-subtitle-edit 18.04
-
multipass shell snapcraft-subtitle-edit
-
sudo su
and create the following files with nano: (creates files that are present on snapcraft builder)
/root/.bashrc:
export SNAPCRAFT_BUILD_ENVIRONMENT=managed-host
export PS1="\h \$(/bin/_snapcraft_prompt)# "
export PATH=/snap/bin:$PATH
/bin/_snapcraft_prompt:
#!/bin/bash
if [[ "$PWD" =~ ^$HOME.* ]]; then
path="${PWD/#$HOME/\ ..}"
if [[ "$path" == " .." ]]; then
ps1=""
else
ps1="$path"
fi
else
ps1="$PWD"
fi
echo -n $ps1
Then run chmod a+x /bin/_snapcraft_prompt
Then exit out
- Clone my
subtitle-edit-snap
repository to test: https://github.com/NickZ/subtitle-edit-snap.git
10: Run snapcraft in the directory