-
Notifications
You must be signed in to change notification settings - Fork 13
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
XDG: Broken cabal installation in macos 20240105 GHA runners #62
Comments
I told you it's not a good idea to enable/disable XDG based on directory existence :) |
There is one more alternative, due to
(e.g., see haskell/actions#210). So, a user of this action could set this variable and be safe. I vote for all of above. I don't see a reason the choice should be made by the [edit: images or the] runner and when it is, let's revert it early. |
So maybe simply the action should set |
I think @jasagredo proposed that and it sounds fine. Then, if people want to switch their Haskell CI to XDG, creating the XDG directory won't work, they'd need to set the |
Doesn't seem like a good idea to set this variable. It'll cause more confusion. |
What kind of confusion? By people that already switched their CI to XDG and it would switch their setup back? Are there any such brave souls? Or in the future, if the cabal manual does not mention the variable prominently enough (does it?)? |
This changes the behavior of the action. What is the interplay with users setting the env var somewhere in the action? Does the action pick it up or overwrite it? Will it now detect the What is the interplay with users not setting the env var in the action? How do users switch to XDG or away from XDG? Avoid pre-setting more user-exposed env vars. Have sane defaults. Don't make decisions based on directory existence. |
One problem we are facing with the XDG migration is that users might have hardwired the path The goal is thus to force cabal away from XDG. I don't see a way to achieving this goal (in our multi-cabal context) without setting CABAL_DIR or removing the XDG cabal directories, but I am happy to learn otherwise. Of course, forcing cabal to use the old directory structure means that we hardcode it here in the action, which is an ugly thing to do. @hasufell if you have an idea how to do it otherwise, I'd happy to learn, but please be concrete, as I am failing to understand how you envision this to work atm. |
I don't think it's this actions responsibility to keep up with every breakage that cabal or ghc cause. That said, I think the current approach here isn't proper either: Lines 73 to 78 in b1dc5f1
I would:
|
I'm absolutely fine to handle step 5 and announce anywhere and everywhere I've made a mistake. However, we still need volunteers to handle the other tasks, which includes a design discussion for For now, I'm guessing, haskell-actions still requires a way to work with the current XDG implementation and prevent both the caching problem Andreas mentions and the CI breakage we just experienced. Making sure (adding checks? adding Whatever the decision, I don't recommend migrating haskell-actions to XDG in the near future. The original plan was that the details of XDG are subject to change and that we count on feedback from brave users [edit: or new users that don't care, since XDG is the default for new setups] enabling it for their particular projects, not from tools or systems that'd move many users to XDG at once and at unawares. As expected, unforeseen problems emerge and that may not be the end of them. |
One way to simplify this is to remove the automatic backwards compatibility code in cabal and always use XDG unless CABAL_DIR is set. |
This is going to cause even more problems. Please don't. |
I suggest setting |
Please open an issue at https://github.com/actions/runner-images/issues and investigate why XDG is enabled automatically. It's possible that it has to do with brew doing shenanigans. The actual macOS ghcup provisioning does not enable XDG: https://github.com/actions/runner-images/blob/main/images/macos/scripts/build/install-haskell.sh Maybe related: actions/runner-images#8778 |
If something runs |
That's likely the installation of
edit: well, scratch that, of course ghcup also runs |
That's true, but Homebrew resets Edit: oh yeah, that ghcup command is definitely the cause. |
What is the proper way of disabling XDG during |
Same as any other |
Those are both poor options, imo. I've decided to attempt this: haskell/ghcup-hs#977 If that works correctly, then the github runners will fix themselves in the next deployment. It might make sense to add a test-case though to check that XDG is indeed disabled: https://github.com/actions/runner-images/blob/main/images/macos/scripts/tests/Haskell.Tests.ps1 |
So it was probably the |
That seems like it has the exact same behaviour as setting |
The difference is that I don't set |
haskell/ghcup-hs#977 has been merged and deployed, which means the next time the github runners are deployed, they should pick up the change (which is every 2 weeks or so). |
I have now also been bitten by this: https://github.com/haskell/alex/actions/runs/7680499933/job/20932609305?pr=257
|
I'm closing this issue as not relevant anymore as MacOS no longer is shipped with Haskell (see actions/runner-images#9242 (comment)). |
These macos runners come with existing XDG directories for cabal. Since the start of the runner, the following files are present:
.config/cabal/config
.cache/cabal/packages/...
In this haskell-actions/setup there is a deliberate choice (decided in haskell/actions#210) to create
~/.cabal/bin
(here) in order to disable XDG, however, cabal will still think it is using XDG because of the existence of~/.config/cabal
. See this logic.I do not know which one should be the path forward:
~/.cabal
and~/.config/cabal/config
exist but not~/.cabal/config
(as is happening here).The 20240105 image is still very new, only 9.79% of rollout progress as I'm writing this, but this still has resulted in CI pipelines failing for example in Cabal itself. 1 2 and more if you look at the
Validate
workflow.The text was updated successfully, but these errors were encountered: