build(make): ensure SHELL includes PATH in its environment#4809
build(make): ensure SHELL includes PATH in its environment#4809mcous merged 3 commits intoOpentrons:edgefrom
Conversation
make on macOS does not seem to honor updates to PATH within the Makefile for shell invokation. This
can be resolved be setting the PATH env variable as part of the SHELL command. This change is benign
for GNU make.
fix #4808
Codecov Report
@@ Coverage Diff @@
## edge #4809 +/- ##
==========================================
+ Coverage 57.91% 67.59% +9.67%
==========================================
Files 956 1053 +97
Lines 26235 35451 +9216
==========================================
+ Hits 15194 23963 +8769
- Misses 11041 11488 +447
Continue to review full report at Codecov.
|
|
Thanks for this! We're gonna smoke test this on Windows make (pretty sure SHELL is ignored in Windows IIRC) and then merge |
|
Update: my initial Windows smoke test (Win 10, PowerShell) resulted in failure: C:\Users\mc\opentrons [henrynash/fix-makefiles]> make install
"C:\ProgramData\chocolatey\lib\make\tools\bin\make.exe": Interrupt/Exception caught (code = 0xc0000005, addr = 0x633b646d) Going to run this to ground tomorrow and see if I can offer any actionable feedback |
|
@henrynash I don't have time to run this to ground further unfortunately, but some cursory doc reading + smoke testing has lead me to the Seeing as |
|
No problem - I’ll investigate further. As an aside, what was your Windows 10 dev setup up? We’re you using the windows Linux subsystem? |
|
@henrynash our Windows setup is PowerShell (I guess cmd.exe might work?) with the various GNU tools (make, curl, etc.) installed via chocolatey or scoop I think we've got some internal Windows users using WSL but for now it's not our recommended Windows setup |
|
@mcous Thanks. Have got a few ideas that seem to work in isolation, just trying to test them out across all platforms. For Windows 10 Powershell - what is the typical environment? I assume people do install bash? Using scoop (even if it is from someones random bucket)? What about the version of make that is installed? I am currently getting a 193 error on the standard makefiles (without any changes) with make 3.8.1 - but they seem to work fine with make 4.2.1. Just trying to work out if I have not set things up properly. |
|
@henrynash I'm soory, I didn't mean to send you down a Windows testing rabbit hole (we can test Windows on our end). I was mostly curious if In the absence of a full Windows dev setup guide (it's on the todo list), my personal Windows setup is:
(I've tested out the same general process on scoop and it seems to work but I don't have the setup steps in my memory) On my machine, it's |
|
@mcous No problem. Managed to do some basic Windows testing. Unfortunately
I think this prevents make on macOS from optimising away the PATH setting, and appears to not upset make on Windows. Will test out Linux later today. If it all hangs together, I'll post an updated PR. (As an aside, looks like the basic install of |
|
Very strange, but on my macOS machine, |
|
@mcous Hmm, odd. So I have updated the PR to use the "-c" flag in the SHELL command. For me this seems to work on macOS, Linux and Windows 10. But concerned that there seems to be an issue for you ?! |
|
Sorry for the confusion @henrynash; what I meant by...
...was that setting # this works for me on macOS with built-in `make`
PATH := # ...
SHELL := bash
# ...I'm also a little concerned about tacking
Setting |
|
@mcous Ah, I get it, sorry! I kind of share your concern over "-c"....it is kind of wrong (although works!). I confirm that
also works on my machine. Even more weirdly, if you add a trailing space to /bin/bash, i.e.:
...it also works!! (But I like this less since it isn't obvious reading the file the difference between that and how it used to be) I'll run some tests on Linux & windows on |
|
Using |
mcous
left a comment
There was a problem hiding this comment.
This is working on my macOS machine and my Windows machine. Could someone from @Opentrons/py give this a once over, too?
overview
make on macOS does not seem to honor updates to PATH within the Makefile for shell invocation. This can be resolved be setting the PATH env variable as part of the SHELL command. This change is benign for GNU make.
fix #4808
changelog
All Makefiles have been updated to modify the existing line that set the SHELL env variable to include the PATH.
review requests
I have tested this using standard make on macOS (10.15) and GNU make on Ubuntu linux. Some tests on other configurations would provide confidence that this works across the supported environments.