Python tooling improvements #34

Closed
opened 2023-08-09 17:17:19 +00:00 by bvisness · 6 comments
Owner
  • Automate adding the installed Orca to the PATH (either by shell profile or setx)
  • Walk up the directory tree looking for .orcaroot and load tooling from there
  • Detect if running a source-checkout version of Orca from outside an Orca source dir and either make it work (load from scripts) or yell at the user that they have done a weird and should remove the source checkout from their PATH
- [x] Automate adding the installed Orca to the PATH (either by shell profile or [`setx`](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setx)) - [x] Walk up the directory tree looking for `.orcaroot` and load tooling from there - [x] Detect if running a source-checkout version of Orca from outside an Orca source dir and either make it work (load from `scripts`) or yell at the user that they have done a weird and should remove the source checkout from their PATH
bvisness added this to the Jam MVP milestone 2023-08-09 17:17:19 +00:00
bvisness self-assigned this 2023-08-09 17:17:19 +00:00
Collaborator

Is non-Windows by choice here or because of technical difficulties? Shelling to setx and asking the user to reopen the terminal would be a smoother experience than 13 clicks it takes now.

Is non-Windows by choice here or because of technical difficulties? Shelling to [setx](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setx) and asking the user to reopen the terminal would be a smoother experience than 13 clicks it takes now.
Author
Owner

Oh, I didn't realize you could do that. I'll automate it for all platforms then.

Oh, I didn't realize you could do that. I'll automate it for all platforms then.
Author
Owner

Ok, Windows part done. Doing this for other platforms is actually pretty annoying but hopefully less destructive. The big issue is that I'm not sure where to actually write all the export PATH="$PATH:foobar" lines to.

In Bash it seems that I need to detect one of .bash_profile, .bash_login, or .profile in order to make sure I'm editing the file that actually gets sourced by the user's shell. For zshell it thankfully seems I can just edit .zshenv.

I don't think we need to support any other shells...? The only ones that really matter are the default shells on current platforms. Anyone using a non-default shell knows how to add stuff to their PATH (and also we will never be able to understand their configs).

Ok, Windows part done. Doing this for other platforms is actually pretty annoying but hopefully less destructive. The big issue is that I'm not sure where to actually write all the `export PATH="$PATH:foobar"` lines to. In Bash it seems that I need to detect one of `.bash_profile`, `.bash_login`, or `.profile` in order to make sure I'm editing the file that actually gets sourced by the user's shell. For zshell it thankfully seems I can just edit `.zshenv`. I don't think we need to support any other shells...? The only ones that really matter are the default shells on current platforms. Anyone using a non-default shell knows how to add stuff to their PATH (and also we will never be able to understand their configs).
Collaborator

Could/Should we add this to simplify building apps?

  • add a orca build-flags [clang|msvc] that outputs the correct set of flags to build an orca compatible wasm module? (maybe also with -c and '-l' options for people who want to compile and link separately)
Could/Should we add this to simplify building apps? - [ ] add a `orca build-flags [clang|msvc]` that outputs the correct set of flags to build an orca compatible wasm module? (maybe also with `-c` and '-l' options for people who want to compile and link separately)
Author
Owner

I'm not sure about that, mainly because I expect we'll want to write more documentation and give more context around those flags. To me it seems like a job for traditional documentation.

I'm not sure about that, mainly because I expect we'll want to write more documentation and give more context around those flags. To me it seems like a job for traditional documentation.
Collaborator

Sure we'll want to document that, so for instance I wouldn't want a magical orca-clang or orca-msvc command. On the other hand it seems convenient to have something that prints the correct include paths and flags, so you don't have to remember them/do it by hand for each platform. Not super important or high priority though!

Sure we'll want to document that, so for instance I wouldn't want a magical `orca-clang` or `orca-msvc` command. On the other hand it seems convenient to have something that prints the correct include paths and flags, so you don't have to remember them/do it by hand for each platform. Not super important or high priority though!
Sign in to join this conversation.
No Label
macOS
windows
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hmn/orca#34
No description provided.