Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:01
    Tatskaari commented #1406
  • 10:34
    suhr edited #1407
  • 10:24
    suhr opened #1407
  • 08:33
    msiebuhr opened #1406
  • Nov 29 17:28
    jamesjarvis closed #1395
  • Nov 29 17:28
    jamesjarvis commented #1395
  • Nov 28 17:35
    sfirmery opened #1405
  • Nov 27 16:55

    peterebden on master

    Download files properly for plz… (compare)

  • Nov 27 16:55
    peterebden closed #1403
  • Nov 27 16:28

    Tatskaari on master

    Fix outputs check to use .Outpu… (compare)

  • Nov 27 16:27
    Tatskaari closed #1404
  • Nov 27 16:27
    Tatskaari closed #1399
  • Nov 27 15:35
    Tatskaari edited #1404
  • Nov 27 15:35
    Tatskaari review_requested #1404
  • Nov 27 15:35
    Tatskaari opened #1404
  • Nov 27 15:35
    Tatskaari review_requested #1404
  • Nov 27 15:04
    Tatskaari labeled #1399
  • Nov 27 10:20
    peterebden opened #1403
  • Nov 26 15:54

    the-hogfather on v15.9.2-beta.1

    (compare)

  • Nov 26 15:44

    peterebden on master

    Provide a more limited environm… (compare)

Jonathan Poole
@Tatskaari
Haha I already landed. I think a lot of it is subjective but honestly looks and reads a bit better so I'm happy to change it.
The rest was just wrong haha
Sigurd Spieckermann
@sisp
Yeah, I went through the codelabs, especially the one about creating custom build rule definitions. I liked the guidance of the codelabs because it walks me through the process step by step. The documentation is good to look something up, but the codelabs are great for learning how to do something step by step.
Jonathan Poole
@Tatskaari
Definitely! The docs are vertical slices of information. The code-labs gives you a horizontal slice for the given task. One of our devs here at TM read some of the docs but only found out about --shell because of the codelab haha
Sigurd Spieckermann
@sisp
:-D
So while going through the codelabs, I found a couple of minor issues at felt like contributing back, even if those are just small documentation improvements. :-)
Jonathan Poole
@Tatskaari
Much appreciated! I'm quite good at producing typos and grammar bads.
Sigurd Spieckermann
@sisp
Haha, no worries ;-)
Jonathan Poole
@Tatskaari
So if I made it so the secret variables are set at runtime for plz run --env would that help you?
Sigurd Spieckermann
@sisp

Hmmm, I'm trying to wrap my head around the problem and this change. I have an alias

[alias "deploy-vercel"]
cmd = run --env //vercel:deploy

and this rule requires the Firebase admin credentials (a JSON file) because some APIs deployed to Vercel require access to Google Firebase. //vercel:deploy is a sh_cmd rule. Curently, I set a custom [buildconfig] variable secrets-dir which contains the absolute path of the directory that contains different secret files. This value is used via CONFIG.SECRETS_DIR in the sh_cmd rule to. How would your suggested change improve this situation?

Would the secret files be transferred and made available temporarily to a remote worker?
Jonathan Poole
@Tatskaari
In order for a secret to be made available to the worker, it would have to make part of the build input which means it would have to be in the cache (i.e. the CAS) which is not a good idea...
Jonathan Poole
@Tatskaari
So if you used the secrets variable you'd be able to refer to the user's home directory with ~
I guess the path would be something like ~/.vercel/context.json or the like?
If i make this change, you'd be able to plz run --env //vercel:deploy and then $SECRET_VERCEL_CONTEXT or whatever could be set via the secrets parameter on sh_cmd.
However I imagine you could just set the secret location in the sh_cmd i.e. cmd = "vercel deploy --context ~/.vercel/context.json"
Jonathan Poole
@Tatskaari
Bah it looks like the $SECRESTS variable gets expanded at build time anyway
Is there any reason you don't just want to put the path in the cmd?
Sigurd Spieckermann
@sisp
No, there's no particular reason. I was just wondering whether the secrets parameter is more suited than simply passing the path in the cmd (using CONFIG.SECRETS_DIR).
I'm not using a remote worker right now but thought that the secrets parameter might make the secret available on the worker, but as you said it doesn't.
Jonathan Poole
@Tatskaari
The secrets parameter will hash the file you're passing and make sure your target is re-built as needed. If you're using it at runtime then that's not really what you want.
Sigurd Spieckermann
@sisp
okay
Hm, wait, why would the rule be rebuilt if the a secret file changed?
Florin STAN
@namtzigla
@Tatskaari I have a small fix in #1394
Сухарик
@suhr
If I want to debug thought-machine/please#1399, where should I start?
Jonathan Poole
@Tatskaari
That's a strange one
Stupid question but does the file exist if you just build "//src/bin/initdb"?
Сухарик
@suhr
Yes! And I can even run it.
Build finished; total time 13.02s, incrementality 100.0%. Outputs:
//src/bin/initdb:initdb:
  plz-out/gen/src/bin/initdb/initdb
I would suspect some kind of concurrency bug, but it's actually reproducible every time I try to build //src/bin:binaries.
Jonathan Poole
@Tatskaari
Hmm I might have an idea as to what's going on. If you move the binaries build rule into //src/bin/binaries:binaries does that work?
Сухарик
@suhr
Note, that plz-out/gen/src/bin/initdb/initdb disappears when I try to build //src/bin:binaries.
Jonathan Poole
@Tatskaari
Yeah I think the filegroup is outputting a file where the directory is
Obviously that should be an error.
Сухарик
@suhr
Oh, now I see. A directory and an executable with the same name and in the same place!
Jonathan Poole
@Tatskaari
Yup! I think I might've introduced this bug recently.
Let me know if moving the filegroup to //src/bin/binaries:binaries fixes it
Сухарик
@suhr
All right, so at least I know how to fix it. Though this is a yet another example where a non-moving filegroup would be so handy.
Jonathan Poole
@Tatskaari
Yeah, I think Mark has some similar issues that might be helped with that. I'm planning to put some thought into that but I haven't gotten around to it yet :(
It seems similar to this: thought-machine/please#1313
Bryce Fisher-Fleig
@brycefisher
I'm trying to evaluate if Please is a good fit for my python monorepo. One thing I couldn't figure out from reading the docs, can I have a python library used in multiple Python binaries? Can I have a many-to-many relationship between libraries and binaries?
Also, how easy is it to use Please to package Azure Function Apps and AWS Lambdas?
Jonathan Poole
@Tatskaari
@brycefisher Hey! Thanks for checking out Please. Yeah so a "python_library()" in please terms is really just a way to group some .py files together. You can then depend on these from other bits of code. I'd recommend trying out the python codelab: https://please.build/codelabs/python_intro/#0
As for packing Azure Function Apps and AWS Lambdas, I'm not intimately familiar with what that would involve however I think it should be possible. You'll need to write some build rules to perform those actions though. You can get a feel for what's possible with build rules here: https://please.build/codelabs/genrule/#0
There's also some more guidance here: https://please.build/build_rules.html
And the built in rules are all defined here: https://github.com/thought-machine/please/tree/master/rules
Bryce Fisher-Fleig
@brycefisher
Thanks so much!!
Steve Dignam
@sbdchd
I was wondering if there are any example repos, or tips on how to integrate please with vscode.
Currently in my project, code formatters (black), linters, and type checkers (mypy) are downloaded as dev dependencies and stored in the .venv along with other third party libraries. This means that vscode can look in the .venv folder for the executables as well as for autocompleting python code.
Jonathan Poole
@Tatskaari
Hey @sbdchd, there's a vscode plugin here that implements with the please language server: https://github.com/thought-machine/please-vscode
It's not very mature but should start to see some love soonish. IDE support is something we're dearly lacking, but we're planning on investing in it in the not to distant future :)
I'm not sure Please does anything to generate a .venv for you. We do something very similar to generate a Go path including generated sources in plz-out/go...
I can't think of a good reason we can't do the same for python.