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

Burn duplicates autogenerated ExePackage/@CacheId #4628

Closed
wixbot opened this issue Dec 19, 2014 · 11 comments · Fixed by wixtoolset/Core#273
Closed

Burn duplicates autogenerated ExePackage/@CacheId #4628

wixbot opened this issue Dec 19, 2014 · 11 comments · Fixed by wixtoolset/Core#273
Assignees
Milestone

Comments

@wixbot
Copy link

wixbot commented Dec 19, 2014

Consider a Bundle with two ExePackages with the same @sourcefile but different PayLoad. Both packages will have the same autogenerated CacheId. If one of the packages is cached, the other is marked partial (because of the same exe). The 'partial' package will be uncached and because of the shared @cacheid the other package gets uncached too!
Which algorithm is used to generate the CacheId for an Exepackage?

Originally opened by erict

@wixbot
Copy link
Author

wixbot commented Dec 20, 2014

Which version of WiX are you using?

@wixbot
Copy link
Author

wixbot commented Dec 22, 2014

Version 3.9.1006.0.

Originally posted by erict

@wixbot
Copy link
Author

wixbot commented Jan 8, 2015

Detect duplicate cache ids at bind time and fail.

Release changed from v3.9 to v3.x

@wixbot wixbot added this to the v3.x milestone Dec 20, 2015
@barnson barnson modified the milestones: v3.x, v4.0 Aug 5, 2020
@rseanhall
Copy link
Contributor

Although the CacheId attribute is planned to be removed (#6329), the duplicate check still needs to be done.

@cpuwzd
Copy link

cpuwzd commented Apr 5, 2021

I tried working on this issue, but the failing test is not valid. When I enable it, it passes because the test is looking for non-specific errors. Sure enough, non-specific errors occur. The code that generates the errors is:

            // Compiler_Bundle.cs, lines 2196 - 2208

            // Detect condition is recommended or required for Exe and Msu packages
            // (depending on whether uninstall arguments were provided).
            if ((packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msu) && String.IsNullOrEmpty(detectCondition))
            {
                if (String.IsNullOrEmpty(uninstallArguments))
                {
                    this.Core.Write(WarningMessages.DetectConditionRecommended(sourceLineNumbers, node.Name.LocalName));
                }
                else
                {
                    this.Core.Write(ErrorMessages.ExpectedAttributeWithValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DetectCondition", "UninstallArguments"));
                }
            }

Adding DetectCondition="anything" to each ExePackage makes these two errors go away. Now the test fails as intended.

I don't know how far the "build" will get under WixRunner, but it would need to get to burn in order to check duplicate cache id's. Having DetectCondition true would prevent both copies from being cached. Having them both false leaves us with the errors I first mentioned at the beginning of this comment. Can I assume that burn is going to evaluate DetectCondition as an expression? If so, what could I pass that will evaluate to false so that the caching will be attempted?

I haven't gotten into burn, itself, yet. Is this failing test in the wrong repo? Is there a test similar enough to this one that would help me sniff out the missing bits?

Ron Martin

@rseanhall
Copy link
Contributor

The test is in the right repo, this needs to be an error at build time. It was valid when it was written, the DetectConditionRecommended warning was added later. So yes, adding DetectCondition="anything" is necessary to make these tests valid again.

@barnson
Copy link
Member

barnson commented Apr 5, 2021

A downside to long-Skipped tests...

@cpuwzd
Copy link

cpuwzd commented Apr 5, 2021 via email

@rseanhall
Copy link
Contributor

It is valid for multiple bundles to have a package with the same CacheId. Reusing a CacheId like that has restrictions, but we can't enforce those since we only build one bundle at a time.

Auto-generated CacheIds are generated at bind time. The Symbol mechanism takes place at link time, which is too early.

@cpuwzd
Copy link

cpuwzd commented Apr 5, 2021 via email

@cpuwzd
Copy link

cpuwzd commented Apr 5, 2021 via email

cpuwzd added a commit to cpuwzd/Core that referenced this issue Apr 11, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Cache ID's created from hashes are included in the process.

Fixes wixtoolset/issues#4628
cpuwzd added a commit to cpuwzd/Data that referenced this issue Apr 11, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Cache ID's created from hashes are included in the process.

Fixes wixtoolset/issues#4628
cpuwzd added a commit to cpuwzd/Core that referenced this issue Apr 11, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Cache ID's created from hashes are included in the process.

Fixes wixtoolset/issues#4628
cpuwzd added a commit to cpuwzd/Core that referenced this issue Apr 12, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Automatically generated Cache ID's are included in the process.

Fixes wixtoolset/issues#4628
cpuwzd added a commit to cpuwzd/Core that referenced this issue Apr 12, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Automatically generated Cache ID's are included in the process.

Fixes wixtoolset/issues#4628
cpuwzd added a commit to cpuwzd/Core that referenced this issue Apr 19, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Automatically generated Cache ID's are included in the process.

Fixes wixtoolset/issues#4628
cpuwzd added a commit to cpuwzd/Core that referenced this issue Apr 19, 2021
Issue a new error message each time a new duplicate cache ID is found. Each message refers to the original occurrence of the cache ID. Comparisons are case sensitive and culture insensitive. Automatically generated Cache ID's are included in the process.

Fixes wixtoolset/issues#4628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment