bitter-ability-32190
05/16/2022, 3:23 PMexperimental_shell_command
metadat to specify the type
of asset? I need it to output a resource
because I can't package a file
šbitter-ability-32190
05/16/2022, 3:24 PMgit
stuff (admittedly I wired it recently) and hit this, so TL;DR it still won't work šhundreds-father-404
05/16/2022, 3:25 PMfile
atm?bitter-ability-32190
05/16/2022, 3:26 PMbitter-ability-32190
05/16/2022, 3:27 PMclass GenerateFilesFromShellCommandRequest(GenerateSourcesRequest):
input = ShellCommandSourcesField
output = FileSourceField
curved-television-6568
05/16/2022, 3:30 PMbitter-ability-32190
05/16/2022, 3:31 PMenough-analyst-54434
05/16/2022, 3:31 PMfile
a very old bug? There is no reason you should not be able to package a file
- makes perfect sense.bitter-ability-32190
05/16/2022, 3:32 PMFilesystem APIs like `open()` are not able to load files within the binary itself; instead, they read from the current working directory.
enough-analyst-54434
05/16/2022, 3:32 PMenough-analyst-54434
05/16/2022, 3:32 PMenough-analyst-54434
05/16/2022, 3:33 PMhundreds-father-404
05/16/2022, 3:34 PMfile
and couldn't ever get it working
I'd be very happy to remove the restrictionenough-analyst-54434
05/16/2022, 3:35 PMenough-analyst-54434
05/16/2022, 3:35 PMenough-analyst-54434
05/16/2022, 3:36 PMbitter-ability-32190
05/16/2022, 3:37 PMbitter-ability-32190
05/16/2022, 3:37 PMenough-analyst-54434
05/16/2022, 3:38 PMenough-analyst-54434
05/16/2022, 3:38 PMbitter-ability-32190
05/16/2022, 3:39 PMenough-analyst-54434
05/16/2022, 3:39 PMenough-analyst-54434
05/16/2022, 3:40 PMenough-analyst-54434
05/16/2022, 3:40 PMbitter-ability-32190
05/16/2022, 3:41 PMpkgutil
and a resource via open
if I know the right values.
I think maybe then there is no useful distinction from Pants' perspectivebitter-ability-32190
05/16/2022, 3:42 PMasset inference
and PEX packaging, but that's arbitrary)enough-analyst-54434
05/16/2022, 3:44 PMbitter-ability-32190
05/16/2022, 3:53 PMopen
and succeeds because the test sandbox uses loose files, but then the code fails in deployment because your layout is the zipapp one.
Did I get that right?bitter-ability-32190
05/16/2022, 4:01 PMexperimental_shell_command
doesn't tell you what it does... it generates files)witty-crayon-22786
05/16/2022, 4:32 PMAnd the guardrail protects you from testing your code which usesand succeeds because the test sandbox uses loose files, but then the code fails in deployment because your layout is the zipapp one.open
Did I get that right?yep
witty-crayon-22786
05/16/2022, 4:34 PMfiles
to resources
would be helpful. part of what it would need to do is maybe controlling which namespace/package the file went into when it became a resource.bitter-ability-32190
05/16/2022, 4:42 PMthe guardrail is necessaryIs it though? For
test
the loose files exist either way. There's no discernible difference in the test
sandbox. So a user can use either, and they can also use open
and pkgutil
.
Then it comes time to package. It still doesn't really matter unless my code is being packaged by PEX and deployed as a zipapp.
Which also disregarding other PEX layouts, or even non-PEX deployments.
OTOH unifying into one asset
type eliminates a lot of confusion and code IMO.bitter-ability-32190
05/16/2022, 4:44 PMasset
target if:
⢠the asset is not under a source root
⢠you are packaging a PEX and are using a zipapp layoutbitter-ability-32190
05/16/2022, 4:46 PMfile
v resource
we choose the behavior for them (we're much more likely to get it right š) and then we know exactly when to warn because we dont have to trust the user used the correct target typebitter-ability-32190
05/16/2022, 4:47 PMwitty-crayon-22786
05/16/2022, 4:52 PMForresources have source roots applied: i.e., they live in packages, and have a prefix stripped⦠files do not, and will be at their absolute path in the repothe loose files exist either way. Thereās no discernible difference in thetest
sandbox. So a user can use either, and they can also usetest
andopen
.pkgutil
bitter-ability-32190
05/16/2022, 4:53 PM