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

Make types returned by NEW_TYPE immutable #2395

Closed
wants to merge 1 commit into from

Conversation

fingolfin
Copy link
Member

We already do that in HPC-GAP.

However, I am slightly worried that this might break some package which might try to modify a type object. Perhaps @alex-konovalov can run this PR through the full set of package tests somehow (if there is a way to do that w/o too much work, that is!)

@stevelinton any thoughts about this?

@fingolfin fingolfin added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Apr 23, 2018
@olexandr-konovalov olexandr-konovalov self-assigned this Apr 23, 2018
@olexandr-konovalov
Copy link
Member

olexandr-konovalov commented Apr 23, 2018

@fingolfin I have a special parametrised Jenkins build for such purposes - all it requires is to specify the PR number as a parameter (and it runs tests on Linux, macOS and Windows!). I will check this PR - you can invite me to review it so it will be on my radar.

@stevelinton
Copy link
Contributor

I'm not convinced this change does anything much. MakeImmutable applied to a positional object (which a type is) just resets the IsMutableObj bit in the type (which is not set anyway) and calls PostMakeImmutable on the object.

You can only change a type through ![] and I can see no library code that does that. Any package that modifies types "by brute force" in this way, probably deserves whatever it gets :-)

@olexandr-konovalov
Copy link
Member

This has some impact on packages, indeed - the log reports:

LoadAllPackages test failed: 3 configurations successful out of 4
Additionally, 1 packages crashed during loading

I will look for more details in the log later.

@codecov
Copy link

codecov bot commented Apr 27, 2018

Codecov Report

Merging #2395 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2395      +/-   ##
==========================================
+ Coverage   74.01%   74.01%   +<.01%     
==========================================
  Files         484      484              
  Lines      245371   245377       +6     
==========================================
+ Hits       181615   181625      +10     
+ Misses      63756    63752       -4
Impacted Files Coverage Δ
src/c_type1.c 83.43% <100%> (+0.02%) ⬆️
hpcgap/src/c_type1.c 81.31% <100%> (+0.01%) ⬆️
hpcgap/lib/hpc/stdtasks.g 64.96% <0%> (+1.02%) ⬆️

@olexandr-konovalov
Copy link
Member

@fingolfin I will run tests again with the newer version of this PR

@stevelinton
Copy link
Contributor

I remain unsure why this change will do anything at all. If it does cause changes, can we try and understand why before we merge anything.

@fingolfin fingolfin added the do not merge PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results) label May 18, 2018
@fingolfin
Copy link
Member Author

I fully agree and added the DO NOT MERGE LABEL.

@olexandr-konovalov
Copy link
Member

I've triggered a new Jenkins test this morning to check this PR with the latest selection of packages. Will post updates from the test logs later today.

Copy link
Member

@olexandr-konovalov olexandr-konovalov left a comment

Choose a reason for hiding this comment

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

I've re-run tests with a new selection of packages, and don't see any problems any more.

@olexandr-konovalov olexandr-konovalov removed their assignment Jun 7, 2018
@fingolfin fingolfin closed this Jun 7, 2018
@fingolfin fingolfin deleted the mh/immutable-type branch June 7, 2018 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge PRs which are not yet ready to be merged (e.g. submitted for discussion, or test results) release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants