https://pantsbuild.org/ logo
#development
Title
# development
a

aloof-angle-91616

04/30/2020, 7:53 AM
we do actually provide an
ar
via binutils, which we have in the pantsbuild s3 as a binary tool
so we could actually make this PR much better by using that version of
ar
. i'll make a TODO
h

hundreds-breakfast-49010

04/30/2020, 7:55 AM
wouldn't that make the ability to build pants dependent on the state of the pantsbuild s3 bucket?
a

aloof-angle-91616

04/30/2020, 7:55 AM
already true because we download protoc and go
see
cargo.sh
in the PR
great great catch though
h

hundreds-breakfast-49010

04/30/2020, 7:55 AM
I've been meaning to look into
cargo.sh
a

aloof-angle-91616

04/30/2020, 7:56 AM
it's...a lot
h

hundreds-breakfast-49010

04/30/2020, 7:56 AM
I want to start adding rust support to pants in the near future
a

aloof-angle-91616

04/30/2020, 7:56 AM
i have an implementation in v2 if you want to see a crappy attempt
h

hundreds-breakfast-49010

04/30/2020, 7:56 AM
actually yeah link me to what you have
h

hundreds-breakfast-49010

04/30/2020, 7:56 AM
I don't expect to start on it for a few more days
a

aloof-angle-91616

04/30/2020, 7:57 AM
it relies on some changes to upstream pants which are basically just adding the rust TargetAdaptor subclass
h

hundreds-breakfast-49010

04/30/2020, 7:57 AM
but it would obviously be nice if pants could build its rust components itself
a

aloof-angle-91616

04/30/2020, 7:57 AM
there's thrift support in there too
yes absolutely
h

hundreds-breakfast-49010

04/30/2020, 7:57 AM
so I wanted to see what the custom cargo.sh was actually doing, seeing if we could move that complexity somewhere else
a

aloof-angle-91616

04/30/2020, 7:58 AM
basically, we have things that we could put into
<http://build.rs|build.rs>
scripts, but haven't yet for whatever reason
h

hundreds-breakfast-49010

04/30/2020, 7:58 AM
there's no point in doing that moving before pants can build rust
a

aloof-angle-91616

04/30/2020, 7:58 AM
i think we would want to look into extracting our shell scripts e.g.
cargo.sh
and
bootstrap_rust.sh
and
bootstrap_cffi.sh
or whatever into common rust crates that provide
build-dependencies
i actually disagree with that ordering
h

hundreds-breakfast-49010

04/30/2020, 7:58 AM
well, I guess there's a point in having more standardized behavior
a

aloof-angle-91616

04/30/2020, 7:59 AM
oh
i 50% agree with this:
there's no point in doing that moving before pants can build rust
it can be done in parallel
but otherwise yes
h

hundreds-breakfast-49010

04/30/2020, 7:59 AM
I mean, even if we still have to invoke a specific version of
cargo
explicitly to build pants (because pants can't do it itself), there's still value in not having shell scripts around
a

aloof-angle-91616

04/30/2020, 7:59 AM
yes
h

hundreds-breakfast-49010

04/30/2020, 8:00 AM
<http://build.rs|build.rs>
is the canonical place for rust setup stuff to live
a

aloof-angle-91616

04/30/2020, 8:00 AM
the implementation i have does exactly that
yes
h

hundreds-breakfast-49010

04/30/2020, 8:00 AM
cool thanks for linking I'll definitely take a look at that over the next several days
a

aloof-angle-91616

04/30/2020, 8:00 AM
and it means others can use those tools too if we publish crates that can be used in
<http://build.rs|build.rs>
scripts
feel free to totally design this however you want, but definitely also feel free to use me as a resource if i can unblock you when you start work on this
and/or if you want to ideate
h

hundreds-breakfast-49010

04/30/2020, 8:01 AM
your work is a few months old, so it's older than @hundreds-father-404ā€™s new target API
a

aloof-angle-91616

04/30/2020, 8:01 AM
that's correct
h

hundreds-breakfast-49010

04/30/2020, 8:01 AM
so it probably makes sense to start from scratch, but it's useful to have that source file around as a resource
a

aloof-angle-91616

04/30/2020, 8:01 AM
i mentioned in another thread that it would be easier to review now because of the progress on the target api, once it has been updated to use the target api
oh absolutely start from scratch
sorry yes absolutely
h

hundreds-breakfast-49010

04/30/2020, 8:02 AM
I see you went with the
./pants cargo
idea, I was thinking about whether or not that made sense myself
a

aloof-angle-91616

04/30/2020, 8:02 AM
you can have cargo projects depend on each other in pants and outside of pants with zero changes it's incredibly tight
h

hundreds-breakfast-49010

04/30/2020, 8:02 AM
oh heh that actually predates renaming
@console_rule
to
@goal_rule
ā— 1
a

aloof-angle-91616

04/30/2020, 8:03 AM
yes
the current ruleset composes cargo projects in the process execution venv in the same directories as they are in the buildroot
so you can have individually cacheable builds that work the same way in and out of pants v2
which, btw, i think is something that we want. it means people can sprinkle pants on top of their rust project if they want to add python, for example
šŸ‘ 1
i think that's the biggest thing to gain from those rust rules, along with weird cargo execution command lines
no need to study them
h

hundreds-breakfast-49010

04/30/2020, 8:05 AM
solid. I'm gonna go to bed now, but happy to talk more about rust stuff in the next few days
a

aloof-angle-91616

04/30/2020, 8:06 AM
absolutely! thanks so much