New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: symbolic link creation for meltano.exe when on windows #6468
fix: symbolic link creation for meltano.exe when on windows #6468
Conversation
👷 Deploy request for meltano pending review.Visit the deploys page to approve it
|
…6467-bin-symbolic-link-windows
Codecov Report
@@ Coverage Diff @@
## main #6468 +/- ##
==========================================
- Coverage 88.71% 88.68% -0.04%
==========================================
Files 283 283
Lines 20457 20465 +8
Branches 2017 2020 +3
==========================================
Hits 18149 18149
- Misses 1973 1979 +6
- Partials 335 337 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…6467-bin-symbolic-link-windows
Still need to dive into this a bit more, we should enable the upgrade test on Windows as well. https://github.com/meltano/meltano/blob/main/tests/meltano/cli/test_upgrade.py#L12 is probably the right test to be "reenabled for windows here!) |
Vish, Would you like me to comment the if statement out save, commit, and publish to see what happens ? |
Well I'm trying to understand what we're fixing here. A test helps clear up what code path(s) we're taking here that caused this issue. Maybe it's not easy to do because of the UI? |
This is an edge case that I have run into. If you run You are correct this is separate from the UI issue you filed. That is why I created a new bug issue. Though it could in some cases be a root cause of a UI upgrade failure. |
I guess I don't even know what purpose this |
…6467-bin-symbolic-link-windows
If you want to see what the symbolic link
I think you can do this other ways but I found this one at it has worked well for me. |
…6467-bin-symbolic-link-windows
@BuzzCutNorman nice work this works great on Windows (as long as you run as an administrator, but I think tackling that in #6160 makes sense as we'd probably want to offer junctions and symlinks re https://stackoverflow.com/questions/9042542/what-is-the-difference-between-ntfs-junction-points-and-symbolic-links ) |
@edgarrmondragon looks good to me! Unless we can get rid of |
@visch that is wonderful to hear this PR is working great for you as well. I know it stinks Windows requires administrator rights to create symlinks. I looked into the ntfs junctions. Junction can only point to directories. (hard links are the same style but point to files). Since the code is expecting the destination to be a file a junction would cause an error. The hard links which I think you create with os.link() point to files and might work. |
…6467-bin-symbolic-link-windows
@visch just tried to use a hard link (os.link()) and it works if you are an administrator 😄 but it doesn't if you are just a user. 😿 |
I might have been wrong. 😸 In the poetry virtual environment for the user account there is no |
@visch Yay!!! it did create a link to the |
@visch all the tests pass now. This version uses the |
…6467-bin-symbolic-link-windows
…6467-bin-symbolic-link-windows
…6467-bin-symbolic-link-windows
…6467-bin-symbolic-link-windows
…6467-bin-symbolic-link-windows
…6467-bin-symbolic-link-windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save for a few style changes and typo corrections, this looks good to go. Thanks @BuzzCutNorman!
@WillDaSilva Thank You, for clean up my code. Looks much better now. I was testing it out and noticed that when I use |
@BuzzCutNorman That's strange - I don't know why that would be. I'll see if I can reproduce this later today. |
@BuzzCutNorman I have reproduced the problem you mentioned, where After some digging, it seems like the issue is that the the log config is only applied after the project has been activated, and so when This is probably an issue for other |
…6467-bin-symbolic-link-windows
@WillDaSilva Thank you for taking the time to solve that mystery. I changed the messages to use |
This fixes the bug #6467 where on Windows
meltano upgrade
stops becauseMeltanoInvoker.invoke()
is callingsubprocess.run()
which requires a executable target. Since the symbolic link.meltano\run\bin
is targetingmeltano
notmeltano.exe
a failure occurs. I updated theProject.activate()
function to targetmeltano.exe
when Windows is detected.This does not fix any previously created symbolic links that might exist in projects.
Close #6467