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

mono: fix build with updated dev. env. #5522

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

hgy59
Copy link
Contributor

@hgy59 hgy59 commented Dec 14, 2022

Description

This is another followup to #5441.
With the updated dev. env. default python is not python 2 anymore.

  • patch makefile templates for explicit use of python 2

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

- patch makefile templates for explicit use of python 2
@hgy59 hgy59 merged commit d8d0649 into SynoCommunity:master Dec 16, 2022
@hgy59 hgy59 deleted the fix_mono_build branch December 16, 2022 16:43
@mreid-tt
Copy link
Contributor

@hgy59 was something changed with permissions? I tried to do a clean-install with this build and I didn't get any of the certificate import errors you mentioned in #5051 (comment).
The installation log also looks clean -- https://pastebin.com/YQ78RegU. I was curious if there was something specific which may have changed or if this was an anomaly on my end.

@hgy59
Copy link
Contributor Author

hgy59 commented Dec 23, 2022

@mreid-tt This PR didn't change anything (IMHO) it fixed the build only, as python defaults now to python 3 and the build has scripts that need python 2.
#5070 mightfix this. Did you take mono from the repo or probably from #5070?

@mreid-tt
Copy link
Contributor

hmm, looking a bit more in the file system I think an uninstall and re-install doesn't in fact do a complete removal as there are many mono files left behind. This is what I suspect happened when I installed this build - the previous permissions set persisted and allowed the deployment to go in cleanly. I'll try that repo you mentioned but I think I'll need to start from a completely fresh Virtual DSM to do a true test

@mreid-tt
Copy link
Contributor

@hgy59, I've taken another look at this and while you are correct in that none of the files that changed in this PR should have affected the cert import I believe that something has changed. Take a look at this log file from a standard installation: https://controlc.com/d893f758. In it you see many lines like:

2023/02/12 15:23:35	System.UnauthorizedAccessException: Access to the path "/usr/share/.mono" is denied.

This is compared to the log file I posted previously (https://pastebin.com/YQ78RegU) which looks like this:

2022/12/23 03:16:13	Certificate added: CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES

Now I looked into why my results were inconsistent before and I found that the folder at /usr/share/.mono was not being removed when mono was uninstalled. However, I've manually removed it and recreated the issue with a clean install of the existing version in the repository. From there I uninstalled mono, rebooted and re-installed with the version from this build and the installation is still clean with the certificate files being added to /var/packages/mono/target/var/.mono as part of the installer.

Now, looking into the code I see this was something that the 'native' patches for mono should have fixed many years ago:

- return "/usr/share";
+ return "/var/packages/mono/target/var";

As such, I'm not sure why this is not working for the build in the repository. Perhaps something else in the framework prevented this from working at the last time mono was merged and published in #5029?

@hgy59
Copy link
Contributor Author

hgy59 commented Feb 12, 2023

@mreid-tt good catch!
we had times where patches did not work for native packages (and toolchains). (probably until #4852, i.e. December 2022)
So it might be that the published packages are missing this patch.

BTW we must update the patch to use /var/packages/mono/var instead of /var/packages/mono/target/var for DSM 7 compatibility.

@mreid-tt
Copy link
Contributor

mreid-tt commented Feb 12, 2023

BTW we must update the patch to use /var/packages/mono/var instead of /var/packages/mono/target/var for DSM 7 compatibility.

Yes, I think this is the case based on the upgrade install I just tried. The logs are found here: https://pastebin.com/KmLxtnNL. In it we see that as part of the upgrade the certs are generated in /var/packages/mono/var/ but then are automatically moved to /var/packages/mono/var with the lines:

2023/02/12 16:52:57	Begin syno_sync_var_folder
2023/02/12 16:52:58	Install files from var folder
2023/02/12 16:52:58	/bin/rsync -avh --ignore-existing --remove-source-files /volume1/@appstore/mono/var/ /volume1/@appdata/mono
[---snip---]
2023/02/12 16:52:59	/bin/rsync -avh --remove-source-files /volume1/@appstore/mono/var/ /volume1/@appdata/mono
[---snip---]
2023/02/12 16:52:59	End syno_sync_var_folder

So the certificates are still there but are unable to be referenced. I'll try to author a new PR for this but will need help reviewing.

@mreid-tt mreid-tt mentioned this pull request Feb 12, 2023
6 tasks
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.

2 participants