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 workspaces files uncompressed in the repository #4579

Merged

Conversation

dmitrio95
Copy link
Contributor

@dmitrio95 dmitrio95 commented Jan 14, 2019

This PR makes workspaces data be stored uncompressed in the repository. This makes it easier to track changes made to them in version control system. The workspace files being installed are produced at build time using CMake built-in tar tool. Potentially important that this change requires raising CMake minimal required version to 3.3. Please leave a comment here if this is undesirable for some reason.

I updated also a license header in the changed CMakeLists.txt, it was apparently not very actual.

@anatoly-os
Copy link
Contributor

Duplicate of #4341? :)

@anatoly-os
Copy link
Contributor

Let's decide which one is better after the release.

@dmitrio95 dmitrio95 force-pushed the git-store-workspaces-uncompressed branch from fffa632 to 398065a Compare January 14, 2019 11:59
@dmitrio95
Copy link
Contributor Author

Oh, I wasn't aware of that :)

@dmitrio95 dmitrio95 force-pushed the git-store-workspaces-uncompressed branch from 398065a to 79348a7 Compare January 14, 2019 12:03
@JoshuaBonn1
Copy link
Contributor

I'd go for this one personally. Mine is quite out of date with all the changes that keep happening with the workspace and this one looks better. It also has more info in the pr that would be useful for any later changes/blames.

@Jojo-Schmitz
Copy link
Contributor

Can we please have this sooner rather than later? There are several open issues that require changed to the workspaces, better to have this here first.

@shoogle
Copy link
Contributor

shoogle commented Jan 19, 2019

If these are being unzipped by QZipReader then you are likely to run into this issue: https://musescore.org/en/node/280231.

@Jojo-Schmitz
Copy link
Contributor

Unzipped?

@dmitrio95
Copy link
Contributor Author

dmitrio95 commented Jan 19, 2019

@shoogle is probably talking about unzipping the file when it is read by MuseScore. And, according to this code, it is indeed done with QZipReader.

Still I didn't run into this issue while testing this PR locally. But this should be probably tested on all platforms, or it would be even better if the mentioned issue could be resolved.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Jan 19, 2019

The unzipping has always been done with this method and never cause an issue as far as I know. Zipping neither. But zipping with something other than QZipReader may indeed cause issues when unzipping with that. However this is not done here as far as I can tell

@anatoly-os anatoly-os merged commit 5e42b27 into musescore:master Jan 19, 2019
set(_FILES workspace.xml META-INF/container.xml)
add_custom_command(OUTPUT ${_OUTPUT}
COMMAND ${CMAKE_COMMAND} -E tar cf "${_OUTPUT}" --format=zip -- ${_FILES}
DEPENDS
Copy link
Contributor

@shoogle shoogle Jan 19, 2019

Choose a reason for hiding this comment

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

Should be DEPENDS ${_FILES} to ensure the zip is rebuilt when the files change.

It might be necessary to prepend ${CMAKE_CURRENT_SOURCE_DIR} to each of the file paths because the behaviour of DEPENDS is counter-intuitive (see this code comment in PR #3269). You can use this function to prepend a string to each item in a list:

prepend_to_list_items(_FILES "${CMAKE_CURRENT_SOURCE_DIR}/" _FILES_ABS)

You will probably need to copy the function code into this file because it won't be accessible outside of the mscore directory where it is defined.

@shoogle
Copy link
Contributor

shoogle commented Jan 19, 2019

@Jojo-Schmitz, this PR zips the files with cmake. It does not unzip them; that is done by MuseScore with QZipReader as it always has been. The question is whether QZipReader can unzip files that have been zipped by cmake. It couldn't I tried on macOS. It might be able to on Linux and Windows if either QZipReader or cmake uses a different zip implementation on those platforms.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Jan 19, 2019

Ah, now I got it. Seems to work on Windows

@dmitrio95 dmitrio95 deleted the git-store-workspaces-uncompressed branch June 3, 2020 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants