-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+tree-sitter (380/548) #326
Comments
I am trying to work on this one |
@jhheider @mfts if you could help I ran the following operations and am seeing this error:
Before build I edited package.yml as: # this is the source tarball. Swap the version out for {{version}} or we won’t
# be able to upgrade the package when it updates!
distributable:
url: https://github.com/tree-sitter/tree-sitter/archive/v{{version}}.tar.gz
# this obscure option dictates how many components are removed from the
# extracted tarball. It only works with tarballs. You almost always want
# `1`. If after extraction the src-directory is funky try `0` or `2`.
strip-components: 1
# if there’s a github then we can parse the versions
versions:
# if the repo has a github then we can parse versions
# this should be one of these (remove the rest or the YAML won’t parse)
github: tree-sitter/tree-sitter # reads github tags but only tags of releases (this is usually what you want)
dependencies:
# to figure out dependencies you can read the project’s README
# however it is often easier to read the [brew formula](https://formulae.brew.sh/formula/)
#
# see tea.xyz/+/ for the packages tea provides
# if you need a package that isn’t there, you may need to build it!
# we can help you: https://discord.tea.xyz
#
# see semver.org for version specifications
node: '*'
emscripten: '*'
build:
dependencies:
node: '*'
emscripten: '*'
rust: '*'
# ^^ often packages need dependencies to build, it is very common for
# packages to need a C compiler and make, the above provide those
working-directory: build
script: |
cargo build -r
# it’s extremely common for packages to require the above
# script also supports a list of commands, which is useful for complex builds
# or if you want to run a command in a different directory
provides:
- {{prefix}}/target/release/tree-sitter
# ^^ specify the binaries or tea magic won’t work The error I am getting is:
|
But other things that will need to be fixed:
All that said, I'm concerned that there's a newline in your package name somewhere (either the branch name, the project path, or being mentioned somewhere else. If I run the last two of your commands, I get the following (darwin+aarch64): $ pkg init github.com/tree-sitter/tree-sitter; pkg build
branch 'new/github.com/tree-sitter/tree-sitter' set up to track 'origin/main'.
Switched to a new branch 'new/github.com/tree-sitter/tree-sitter'
created ./projects/github.com/tree-sitter/tree-sitter/package.yml
Now type pkg edit to open the yaml in your $EDITOR
the package will need renaming before we can merge it.
we typically name packages after their homepage.
if you aren’t sure about the name you can submit and we’ll assist.
error: Uncaught Error: pantry entry invalid. please report this bug!
https://github.com/teaxyz/pantry/issues/new
----------------------------------------------------->> attachment begin
github.com/tree-sitter/tree-sitter: duplicated mapping key in "/Users/jacob/tea/pantry/projects/github.com/tree-sitter/tree-sitter/package.yml" at line 23, column 3:
url: git+https://github.com/user ...
^
<<------------------------------------------------------- attachment end
.catch(cause => { throw new TeaError('parser: pantry: package.yml', {cause, project, filename}) })) which is expected, since that's an unedited package.yml. Actually, $ pwd | hexdump
0000000 552f 6573 7372 6a2f 6361 626f 742f 6165
0000010 702f 6e61 7274 0a79
0000018 it looks like |
I updated my
Since most of brewkit is shell scripts, you can get more info out with |
Seems like the package name only has issues where can I correct that? |
So I tried exporting ➜ bash -x "$(tea --prefix)"/tea.xyz/brewkit/v0/bin/pkg-build
+ set -e
+ pwd
+ grep -q ' '
+ test -n '' -a -n '' -o -n ''
+++ dirname /home/king-11/.tea/tea.xyz/brewkit/v0/bin/pkg-build
++ cd /home/king-11/.tea/tea.xyz/brewkit/v0/bin/..
++ pwd
+ d=/home/king-11/.tea/tea.xyz/brewkit/v0
+ PATH='/home/king-11/.tea/tea.xyz/brewkit/v0/libexec:/home/king-11/.local/share/zinit/polaris/bin:/home/king-11/.local/bin:/home/king-11/.local/share/pnpm:/run/user/1000/fnm_multishells/16926_1691475666114/bin:/home/king-11/.local/share/fnm:/home/king-11/.pyenv/shims:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/lib64/ccache:/home/king-11/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/mnt/c/Program Files/usbipd-win/:/Docker/host/bin:/mnt/c/Users/lakshyasingh/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/lakshyasingh/AppData/Local/Programs/Microsoft VS Code/bin:/var/lib/snapd/snap/bin'
+ test -z ''
+ test -z /home/king-11/pantry
++ echo /home/king-11/pantry
++ tr : '\n'
+ for x in $(echo "$TEA_PANTRY_PATH" | tr ':' '\n')
+ test -d /home/king-11/pantry/.git
++ GIT_WORK_TREE=/home/king-11/pantry
++ peek.sh
+ PKGS='\ncrates.io/tree-sitter '
+ test -n ''
+ available.ts
+ test -z ''
++ tea gh auth token
+ GITHUB_TOKEN=<GH_TOKEN>
+ test -z <GH_TOKEN>
+ export GITHUB_TOKEN
++ sort.ts '\ncrates.io/tree-sitter' --delimiter ' '
error: Uncaught Error: Not in pantry: \ncrates.io/tree-sitter
https://github.com/teaxyz/pantry#contributing
throw new TeaError('not-found: pantry: package.yml', {project}, )
^
at https://deno.land/x/[email protected]/src/hooks/usePantry.ts:49:13
at project (https://deno.land/x/[email protected]/src/hooks/usePantry.ts:50:5)
at Object.getDeps (file:///home/king-11/.tea/tea.xyz/brewkit/v0/lib/usePantry.ts:30:21)
at file:///home/king-11/.tea/tea.xyz/brewkit/v0/libexec/sort.ts:24:29
at ascend (https://deno.land/x/[email protected]/src/plumbing/hydrate.ts:62:31)
at go (https://deno.land/x/[email protected]/src/plumbing/hydrate.ts:93:11)
at hydrate (https://deno.land/x/[email protected]/src/plumbing/hydrate.ts:102:13)
at file:///home/king-11/.tea/tea.xyz/brewkit/v0/libexec/sort.ts:23:19
+ PKGS= |
Ok, we'll we can definitely see the error showing up out of PKGS="$(GIT_WORK_TREE="$x" peek.sh) $PKGS" The relevant code in OUTPUT=""
for CHANGED_FILE in $CHANGED_FILES; do
PROJECT=$(echo "$CHANGED_FILE" | sed -n 's#projects/\(.*\)/package\.yml$#\1#p')
if test -z "$PROJECT"
then
true # noop
elif test "$1" = "--print-paths"; then
OUTPUT="$OUTPUT\n$CHANGED_FILE"
else
OUTPUT="$OUTPUT\n$PROJECT"
fi
done
# shellcheck disable=SC2046
echo $(echo $OUTPUT | sort | uniq) So, your echo $(echo "\ncrates.io/tree-sitter " | sort | uniq) and returnting elif test "$1" = "--print-paths"; then
OUTPUT="$OUTPUT $CHANGED_FILE"
else
OUTPUT="$OUTPUT $PROJECT"
fi
done
# shellcheck disable=SC2046
echo $(echo $OUTPUT | tr ' ' '\n' | sort | uniq | tr '\n' ' ') |
that does it |
Great. I think it might behoove us to just change all of |
Right when I execute
Should it be taking this long?
|
Didn't really get what you meant by |
Sorry, |
Ok, try |
the build takes unusually long but seems to be working now. i will start getting the package.yml ready to send a PR. |
Formulae: https://formulae.brew.sh/formula/tree-sitter
The text was updated successfully, but these errors were encountered: