Skip to content
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

Store and apply overrides per-compiler #6497

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

OfekShilon
Copy link
Member

Fixes #5755 and maybe others.

@OfekShilon
Copy link
Member Author

OfekShilon commented May 18, 2024

There are 2 languages with default overrides: rust and tablegen. One of the effects of this PR is that the overrides button initially has green highlight for these languages.
I can change it back, but I tend to think it makes more UX sense this way.

@@ -345,6 +345,7 @@ export class CompilerFinder {
preamble: props<string>('licensePreamble'),
},
possibleOverrides: [],
activeOverrides: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too confusing of a name, once this is transmitted to the frontend this object should not ever change. But then the Default overrides are also already in possibleOverrides, so I'm not sure what's the point of this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand this.
IIUC this (compiler-finder stuff) runs only on instance startup. Why shouldn't activeOverrides change afterwards?
And what better name would you suggest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's supposed to represent the static configuration on the backend for everyone, not an individualized state

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Will take another stab at this, probably next weekend

@@ -316,6 +316,10 @@ export class Compiler extends MonacoPane<monaco.editor.IStandaloneCodeEditor, Co

this.revealJumpStack = [];

if (this.compiler) {
this.compiler.activeOverrides = state.overrides;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to store this somewhere else like the global https://github.com/compiler-explorer/compiler-explorer/blob/main/static/global.ts#L30 , or in local storage if you want it to persist beyond refreshes

@partouf partouf marked this pull request as draft May 29, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Unsupported compiler overrides are kept when switching compilers, leading to confusing UI issues
2 participants