plain-carpet-73994
10/13/2021, 7:01 PMprotoc
via the standard pants protobuf_library
goal. If I run the build with --no-process-execution-local-cleanup
I can cd into the directory and if I try to run the command I get bash: ./bin/protoc: cannot execute binary file: Exec format error
. Indeed, if I just run ./bin/protoc
I get that error. However, I have protoc
installed so if I change the command to run just protoc
instead of the ./bin/protoc
in the sandbox it works. I think the issue is that pants seems have bundled their own protobuf compiler and it's an intel build, not an ARM build. Is that correct? Any way I can fix that?hundreds-father-404
10/13/2021, 7:04 PMplain-carpet-73994
10/13/2021, 7:28 PMplain-carpet-73994
10/13/2021, 7:29 PMhappy-kitchen-89482
10/13/2021, 7:34 PMhundreds-father-404
10/13/2021, 7:34 PMhundreds-father-404
10/13/2021, 7:35 PMplain-carpet-73994
10/13/2021, 7:35 PMplain-carpet-73994
10/13/2021, 7:36 PMwitty-crayon-22786
10/13/2021, 7:36 PMHmm @witty-crayon-22786 I had thought you added to the docs about hosting binaries from local filesystem pathmm… no: it’s only mentioned in the subsystem help.
plain-carpet-73994
10/13/2021, 7:36 PMhappy-kitchen-89482
10/13/2021, 7:36 PM[protoc]
known_versions.add=["3.11.4|linux_arm64 |<sha256 of relevant protoc binary>"]
happy-kitchen-89482
10/13/2021, 7:36 PMplain-carpet-73994
10/13/2021, 7:37 PMhundreds-father-404
10/13/2021, 7:39 PMPlatform
does not include Linux ARM 64 in it? I think we may need to cherry-pick to Pants 2.7 that you can attempt to use ARM Linux, only you will have to host the binaries yourself
2.6 won't work if you need to support both Intel and ARM. It would make you choose one. (Which you could override in a .pantsrc
config file fwit)happy-kitchen-89482
10/13/2021, 8:01 PMhappy-kitchen-89482
10/13/2021, 8:01 PMhappy-kitchen-89482
10/13/2021, 8:02 PMhappy-kitchen-89482
10/13/2021, 8:02 PMplain-carpet-73994
10/13/2021, 9:11 PMplain-carpet-73994
10/13/2021, 9:26 PMif arch == 'x86_64':
python_library()
happy-kitchen-89482
10/13/2021, 9:27 PMplain-carpet-73994
10/13/2021, 9:28 PMhappy-kitchen-89482
10/13/2021, 9:30 PMtags=["arm64_only"]
for example) and then include or exclude tags at runtime, e.g., ./pants --tag=arm64_only ...
or ./pants --tag=-arm64_onlu ...
)happy-kitchen-89482
10/13/2021, 9:30 PMhappy-kitchen-89482
10/13/2021, 9:31 PM./pants test_arm64 ...
and an alias could turn that into ./pants --tag=arm64_only test ...
happy-kitchen-89482
10/13/2021, 9:31 PMhappy-kitchen-89482
10/13/2021, 9:31 PMhappy-kitchen-89482
10/13/2021, 9:31 PMplain-carpet-73994
10/13/2021, 9:33 PMplatforms
work? e.g.
python_library(
platforms = [
'linux-x86_64-cp-37-m',
'macosx-11.0-x86_64-cp-37-m'
]
)
plain-carpet-73994
10/13/2021, 9:36 PMhappy-kitchen-89482
10/13/2021, 9:36 PMhappy-kitchen-89482
10/13/2021, 9:37 PMplain-carpet-73994
10/13/2021, 9:47 PMnoarm
and then ran pants --tag='-noarm'
but pants still tries to install everything in constraints.txt
even if no target to be built actually needs that dependency. So it fails installing a library I don't need. But I do need/want those targets on Intel and I want them pinned so I don't want to remove them from my constraints. What to do?hundreds-father-404
10/13/2021, 9:51 PMplain-carpet-73994
10/13/2021, 9:57 PMpip-compile
generates a much nicer lockfile that pip. Mostly I like the comments it puts under each dependency saying where it came from and the fact that it only locks what's in the file you pass it (e.g. <http://requirements.in|requirements.in>
) rather than locking everything in the venv.plain-carpet-73994
10/13/2021, 10:02 PMconstraints.txt
regardless of what target you're building. That can make things really slow if I want to build a target with few 3rd party deps. Would it be possible to have constraints.txt
just be ... constraints but only install the dependencies required for a target?witty-crayon-22786
10/13/2021, 10:18 PMwitty-crayon-22786
10/13/2021, 10:19 PMplain-carpet-73994
10/13/2021, 11:04 PM--no-python-setup-resolve-all-constraints
might make things work though at the cost of some speed. Sound right?witty-crayon-22786
10/13/2021, 11:05 PMplain-carpet-73994
10/13/2021, 11:06 PMif
statement that could use other constraints (e.g. OS, an env variable, etc.) seems pretty valuable. I do understand that you'd have to limit what could be there to make builds reproducible (e.g. env vars are harder but you do already allow that for tests).witty-crayon-22786
10/13/2021, 11:08 PMplain-carpet-73994
10/13/2021, 11:08 PMthat is also something that is addressed in 2.7, if I remember correctly… when platforms are in use, the optimization is disabled@witty-crayon-22786 I'm up for upgrading to 2.7 but if I followed the conversation above it sounds like that won't yet work on ARM+Linux at all (see https://pantsbuild.slack.com/archives/C046T6T9U/p1634153982080700?thread_ts=1634151679.077600&cid=C046T6T9U)
plain-carpet-73994
10/13/2021, 11:09 PMtrying to find the relevant ticket thereTicket was already shared above. Thanks.
witty-crayon-22786
10/13/2021, 11:09 PMwitty-crayon-22786
10/13/2021, 11:10 PMhundreds-father-404
10/13/2021, 11:14 PMplain-carpet-73994
10/14/2021, 2:21 AM--tag
with a ::
target it first builds the .pex files for all targets, even those excluded by the --tag
and then filters by tag so there isn't an easy way to say "run all tests except those with tag X and don't bother resolving dependencies for the tests you won't run".
For example, with -ldebug
I see:
02:16:11.58 [DEBUG] Completed: Hit local cache: Scheduling: Determine Python imports for realsense/lib/colorize_depth.py
and then the old error:
ERROR: Could not find a version that satisfies the requirement pyrealsense2==2.49.0+companion3
ERROR: No matching distribution found for pyrealsense2==2.49.0+companion3
But that target looks like this:
cpy_library(
tags=['noarm']
)
cpy_tests(
tags=['noarm']
)
Where the definitions of the cpy_
macros is:
def cpy_library(**kwargs):
python_library(**kwargs)
def cpy_tests(**kwargs):
if 'name' not in kwargs:
kwargs['name'] = 'tests'
python_tests(**kwargs)
and the command I ran is:
pants --tag='-firebase_emulator,-noarm' --no-python-setup-resolve-all-constraints -ldebug test ::
plain-carpet-73994
10/14/2021, 2:22 AMpyrealsense2
in anything under device
so pants ... test device/::
works fine.plain-carpet-73994
10/14/2021, 2:37 AMopencv-python
module on PyPi for ARM but you can apt get install python3-opencv
. however, I don't know how to make Pants use that version. I didn't see any mention of using system-installed libs here: https://www.pantsbuild.org/docs/python-third-party-dependencies. I could custom-build the wheel myself and host it somewhere...witty-crayon-22786
10/14/2021, 2:47 AMhappy-kitchen-89482
10/14/2021, 5:36 AMStill having issues. I think the issue that remains is that if you useThat seems odd.with a--tag
target it first builds the .pex files for all targets, even those excluded by the::
and then filters by tag so there isn't an easy way to say "run all tests except those with tag X and don't bother resolving dependencies for the tests you won't run".--tag
happy-kitchen-89482
10/14/2021, 5:41 AMpants --tag='-firebase_emulator,noarm' --no-python-setup-resolve-all-constraints -ldebug test ::
?happy-kitchen-89482
10/14/2021, 5:41 AM-
applies to all the tags in the comma-separated string, so -noarm
is seen as a tag, not as a negation of a taghappy-kitchen-89482
10/14/2021, 5:42 AM--tag=-firebase_emulator --tag=-noarm
curved-television-6568
10/14/2021, 7:15 AM-
to be on a per tag basis..curved-television-6568
10/14/2021, 7:15 AM--tags
flags, thencurved-television-6568
10/14/2021, 7:17 AM--exclude-tags
instead of -
prefix on tagnames? That would make it more clear.curved-television-6568
10/14/2021, 7:17 AM-
per tag name… 😉 )hundreds-father-404
10/14/2021, 7:18 AMcurved-television-6568
10/14/2021, 7:23 AMYou can prefix the filter withThat causes the confusion for me.to negate the filter, meaning that the target must not be true for the filter.-
curved-television-6568
10/14/2021, 7:24 AMcurved-television-6568
10/14/2021, 7:27 AM-
to negate the match, meaning that the member must not be matched”.
However, this doesn’t work well with “at least one member must be matched”, as that would suddenly include ALL other tags except the one you’re filtering out, so negated ones should be added with AND rather than OR in that case.curved-television-6568
10/14/2021, 7:28 AMcurved-television-6568
10/14/2021, 7:31 AM--explain
option, that could simply dump in a readable form what it would do, and make it very clear what filters it would use inclusively/exclusively on what targets and types etc..curved-television-6568
10/14/2021, 7:31 AMplain-carpet-73994
10/14/2021, 6:46 PM-
in the filter that confused me. Sorry for the false alarm.plain-carpet-73994
10/14/2021, 6:46 PM