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

Delete most of the Scalar product code #511

Merged
merged 8 commits into from
Jun 17, 2021

Conversation

derrickstolee
Copy link
Contributor

@derrickstolee derrickstolee commented Jun 15, 2021

Draft only because I'm not sure if this will pass tests. The biggest unknown is whether or not the microsoft/git installer will still be downloaded during functional tests, which is the only reason the Scalar, Scalar.Common, and Scalar.MSBuild projects still exist.

Based on #505 because we need to point to main to trigger the workflows.

@derrickstolee derrickstolee changed the base branch from test-scalar-in-c to main June 15, 2021 19:38
@mjcheetham
Copy link
Member

@derrickstolee you should be able to delete the signing and MSBuild projects too.. they're only used for signing and generating code for the non-existent product respectively 😁

@derrickstolee derrickstolee marked this pull request as ready for review June 16, 2021 12:15
@derrickstolee
Copy link
Contributor Author

@derrickstolee you should be able to delete the signing and MSBuild projects too.. they're only used for signing and generating code for the non-existent product respectively 😁

@mjcheetham: I'm worried that without it I won't get anything that downloads the microsoft/git package, but I'll give it a try.

@derrickstolee
Copy link
Contributor Author

@derrickstolee you should be able to delete the signing and MSBuild projects too.. they're only used for signing and generating code for the non-existent product respectively 😁

@mjcheetham: I'm worried that without it I won't get anything that downloads the microsoft/git package, but I'll give it a try.

The obvious thing of deleting the project failed, so I'm going to leave that one to another PR (if at all) because it's not as simple as the other projects.

Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Copy link
Contributor

@jeffhostetler jeffhostetler left a comment

Choose a reason for hiding this comment

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

I'm rubber stamping this. I looked thru things and it all looks good. I'm not sure what's happening with the builds failing on 1 machine and/or the signing thing.

@derrickstolee
Copy link
Contributor Author

I'm rubber stamping this. I looked thru things and it all looks good. I'm not sure what's happening with the builds failing on 1 machine and/or the signing thing.

In my opinion, our functional tests are a little more flaky in the C port, so we will want to resolve some of those issues in the coming weeks.

@dscho
Copy link
Member

dscho commented Jun 17, 2021

our functional tests are a little more flaky in the C port

I fear you are right. My take on it is that it was my mistake to rely on the global config so much. In typical usage scenarios, this does not matter: users do not concurrently register a dozen enlistments. But the Functional Tests do.

To some extent, the problem was alleviated by my patch that asks for a back-off strategy to be used when creating that write lock.

I expect the remaining problems to be rooted in the lack of a read lock. That is, when we read the global Git config, we do not expect there to be any problems.

And those problems would only occur on Windows, anyway: on Linux/macOS, the rename() that commits the write lock is atomic. Either you get the old, or you get the new version of the config.

In contrast, on Windows there is the potential that a different process is holding a lock on that file (I still suspect Defender to interfere here, but it could potentially be the MoveFilesExW() call that might not be lock-free).

My best guess is that we should actually implement a back-off strategy with a very short time-out in mingw_open() and mingw_fopen(). It could be either modeled after the strategy in lock_file_timeout(), or even preferable: we should attempt to refactor that strategy into a reusable form and use that. I could imagine something like this:

struct back_off_t back_off;

back_off_init(&back_off, time_out_ms);
do {
  file = _wfreopen(wfilename, wotype, stream);
  if (file || errno != EPERM)
    break;
} while (back_off_sleep(&back_off));

This is still a bit clunky, and could potentially be wrapped in a macro, somewhat similar to how SWAP() is implemented.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

The diff looks really awesome!

@derrickstolee derrickstolee merged commit 04c5d59 into microsoft:main Jun 17, 2021
derrickstolee added a commit that referenced this pull request Jun 18, 2021
**Scalar has moved!**

We deleted the product code in #511. (There was actually a too-aggressive deletion of some images that are restored in this PR.)

Now, let's update the README and other docs to point to `microsoft/git` for the latest details. Include the latest description of Scalar from the `microsoft/git` docs as well as some reasoning for our move of the code. Include details for users to transition to the new version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants